Datenaustausch zwischen RaspberryMatic und fhem hängt sich auf

Begonnen von Sauron, 11 März 2021, 17:36:26

Vorheriges Thema - Nächstes Thema

Sauron

Datenaustausch zwischen RaspberryMatic und fhem hängt sich auf

Hallo,
ich betreibe eine RaspberryMatic mit FW Version 3.55.10.20210213. Bei der CCU habe ich einige homematic IP Komponenten angemeldet. Deren Events verarbeite ich in fhem, um z.B. Intertechno, zigbee... Geräte zu schalten. 
Als einheitliche Übertragungsschnittstellen benutze ich seitens  CCU3 die virtuellen Kanäle der ccu3. (HmIp´s schalten virtuelle Kanäle) Zur Kommunikation verwende ich den RPC-Server. Das geht meist mehrere Stunden gut und dann hängt sich die Verbindung auf. Die Variablen werden weiterhin übertragen. Nach fhem Neustart geht es dann wieder ein paar Stunden.
Im  Log finde ich zu diesem Zeitpunkt auch meist Meldungen im Abstand von 10min dieser Art.:
2021.03.11 14:29:40 2: HMCCURPCPROC: [d_rpc000161BidCos_RF : 28239] Received no events from interface CB2001000151000166 for 600.820672988892 seconds

Den RpcServer habe ich wie folgt eingebunden:
define d_ccu HMCCU 192.168.0.166
attr d_ccu ccuGetVars 10 ^A
attr d_ccu ccuflags procrpc
attr d_ccu group Info
attr d_ccu room System
attr d_ccu rpcinterfaces BidCos-RF,HmIP-RF,VirtualDevices
attr d_ccu rpcport 2001,2010,9292
attr d_ccu rpcserver on
attr d_ccu stateFormat rpcstate/state

define d_rpc000161BidCos_RF HMCCURPCPROC http://192.168.0.166 BidCos-RF
attr d_rpc000161BidCos_RF alias CCU RPC BidCos-RF
attr d_rpc000161BidCos_RF eventMap /rpcserver on:on/rpcserver off:off/
attr d_rpc000161BidCos_RF stateFormat rpcstate/state
attr d_rpc000161BidCos_RF verbose 2

define d_rpc000161HmIP_RF HMCCURPCPROC http://192.168.0.166 HmIP-RF
attr d_rpc000161HmIP_RF alias CCU RPC HmIP-RF
attr d_rpc000161HmIP_RF eventMap /rpcserver on:on/rpcserver off:off/
attr d_rpc000161HmIP_RF stateFormat rpcstate/state
attr d_rpc000161HmIP_RF verbose 2

define d_rpc000161VirtualDevices HMCCURPCPROC http://192.168.0.166 VirtualDevices
attr d_rpc000161VirtualDevices alias CCU RPC VirtualDevices
attr d_rpc000161VirtualDevices eventMap /rpcserver on:on/rpcserver off:off/
attr d_rpc000161VirtualDevices stateFormat rpcstate/state
attr d_rpc000161VirtualDevices verbose 2


ein Einsatzbeispiel das so mehrere Stunden funktioniert:

define Event_LichtToilette HMCCUCHN BidCoS-RF:11
attr Event_LichtToilette IODev d_ccu

define NotifyEvent_LichtToilette notify Event_LichtToilette {\
if (Value("Li_Toilette") eq "off")\
{   \
fhem "set Li_Toilette on" \
}\
else \
{ \
fhem "set Li_Toilette off" \
} \
}


Über Unterstützung würde ich mich sehr freuen
Gruß
Reiner

Sauron

kann mir denn niemand weiterhelfen?

Heute nacht hat er sich wieder aufgehängt:

2021.03.14 03:45:06 2: HMCCU: [d_ccu : 4716] HMScript failed. http://192.168.0.166:8181/tclrega.exe: Can't connect(1) to http://192.168.0.166:8181: IO::Socket::INET: connect: timeout
2021.03.14 03:45:20 2: HMCCU: [d_ccu : 4716] HMScript failed. http://192.168.0.166:8181/tclrega.exe: Can't connect(1) to http://192.168.0.166:8181: IO::Socket::INET: connect: timeout
2021.03.14 03:45:34 2: HMCCU: [d_ccu : 4716] HMScript failed. http://192.168.0.166:8181/tclrega.exe: Can't connect(1) to http://192.168.0.166:8181: IO::Socket::INET: connect: timeout
2021.03.14 03:45:34 1: in SktFussbodenIntervall
2021.03.14 03:45:34 1: Check Abwesenheitssimulation
2021.03.14 03:45:47 2: HMCCU: [d_ccu : 4716] HMScript failed. http://192.168.0.166:8181/tclrega.exe: Can't connect(1) to http://192.168.0.166:8181: IO::Socket::INET: connect: No route to host
2021.03.14 03:46:00 2: HMCCU: [d_ccu : 4716] HMScript failed. http://192.168.0.166:8181/tclrega.exe: Can't connect(1) to http://192.168.0.166:8181: IO::Socket::INET: connect: No route to host
2021.03.14 03:46:10 2: HMCCURPCPROC: [d_rpc000161BidCos_RF : 4716] RPC request error RPC::XML::Client::simple_request: RPC::XML::Client::send_request: HTTP server error: Can't connect to 192.168.0.166:2001 (No route to host)
2021.03.14 03:46:13 2: HMCCU: [d_ccu : 4716] HMScript failed. http://192.168.0.166:8181/tclrega.exe: Can't connect(1) to http://192.168.0.166:8181: IO::Socket::INET: connect: No route to host
2021.03.14 03:46:26 2: HMCCU: [d_ccu : 4716] HMScript failed. http://192.168.0.166:8181/tclrega.exe: Can't connect(1) to http://192.168.0.166:8181: IO::Socket::INET: connect: No route to host
2021.03.14 03:46:39 2: HMCCU: [d_ccu : 4716] HMScript failed. http://192.168.0.166:8181/tclrega.exe: Can't connect(1) to http://192.168.0.166:8181: IO::Socket::INET: connect: No route to host
2021.03.14 03:46:53 2: HMCCU: [d_ccu : 4716] HMScript failed. http://192.168.0.166:8181/tclrega.exe: Can't connect(1) to http://192.168.0.166:8181: IO::Socket::INET: connect: No route to host
2021.03.14 03:47:06 2: HMCCU: [d_ccu : 4716] HMScript failed. http://192.168.0.166:8181/tclrega.exe: Can't connect(1) to http://192.168.0.166:8181: IO::Socket::INET: connect: No route to host
2021.03.14 03:47:19 2: HMCCU: [d_ccu : 4716] HMScript failed. http://192.168.0.166:8181/tclrega.exe: Can't connect(1) to http://192.168.0.166:8181: IO::Socket::INET: connect: No route to host
2021.03.14 03:47:32 2: HMCCU: [d_ccu : 4716] HMScript failed. http://192.168.0.166:8181/tclrega.exe: Can't connect(1) to http://192.168.0.166:8181: IO::Socket::INET: connect: No route to host
2021.03.14 03:47:45 2: HMCCU: [d_ccu : 4716] HMScript failed. http://192.168.0.166:8181/tclrega.exe: Can't connect(1) to http://192.168.0.166:8181: IO::Socket::INET: connect: No route to host
2021.03.14 03:52:14 3: CUL_0 IT: Code 0101 not supported by IT_1527xa87fe.
2021.03.14 03:52:14 3: CUL_0 IT: Code 0101 not supported by IT_1527xa87fe.
2021.03.14 03:52:14 3: CUL_0: Unknown code ia87fe5, help me!
2021.03.14 03:53:34 1: Notify regensensor
2021.03.14 03:53:34 3: CUL_0 IT_set: Dachfenster off
2021.03.14 03:54:56 2: HMCCURPCPROC: [d_rpc000161BidCos_RF : 4716] Received no events from interface CB2001000151000166 for 600.819864988327 seconds

alle 10 min kommt dann:
2021.03.14 04:04:57 2: HMCCURPCPROC: [d_rpc000161BidCos_RF : 4716] Received no events from interface CB2001000151000166 for 600.816391944885 seconds




nach einem
set d_ccu rpcserver off
set d_ccu rpcserver on
reagierte fhem wieder auf auf Änderungen bei meiner virtuellen homematic Geräte der CCU

Zuvor hatte ich den Aufruf
set d_ccu rpcserver on
versuchet. Dieser medetet, dass er bereits laufen würde.

Sauron

Workaround den ich aktuell versuche
Falls zukünftig noch jemand das Problem haben sollte, kann ich diesen unschönen Workaround anbieten:

Event_RPC_Alive ist ein Virtueller Kanal der CCU3 der per Timer jede Minute einen Tastendruck kurz auslöst.
Sollte dieser mehr als 2 Min ausfallen, rebootet der RPC-Server neu.

Den Thread werde ich noch nicht schliessen, da ich die Hoffnung habe, dass vielleicht jemand noch eine bessere Idee hat

define Event_RPC_Alive HMCCUCHN BidCoS-RF:12
attr Event_RPC_Alive IODev d_ccu
attr Event_RPC_Alive room CCU_HM

define RPC_Alive dummy
attr RPC_Alive room Automatik
attr RPC_Alive webCmd on:off

## solange RPC Server läuft .....
define NotifyRPC_Alive notify Event_RPC_Alive {\
    { \
# Log 1, "XXXXXXXXXXX Erneuere NotifyRPC_Alive_ON";;\
if(Value("NotifyRPC_Alive_ON") ne "")\
{ \
      fhem ("delete NotifyRPC_Alive_ON") ;;\
} \
fhem ("define NotifyRPC_Alive_ON at +00:02:00 set RPC_Alive on")\\
} \
}


## wenn der RPC Server hängt .....
define NotifyRPC_Restart notify RPC_Alive:*.on {\
    { \
        Log 1, "************ RPC Neuestart ****************";;\
    fhem("set d_ccu rpcserver off ;;\
set d_ccu rpcserver on ;;\
define NotifyRPC_Alive_ON at +00:02:00 set RPC_Alive on")\\
} \
}