FHEM Forum

FHEM - Hausautomations-Systeme => Homematic => Thema gestartet von: raspberry am 31 Januar 2021, 23:39:28

Titel: HMCCU Initialisierung: Illegal RPC interface BidCos-RF
Beitrag von: raspberry am 31 Januar 2021, 23:39:28
Hallo zusammen,

ich betreibe auf einem Raspberry 2B mit Debian Buster, FHEM und Debmatic. Folgende Konfiguration habe ich eingetragen:

define Ccu HMCCU 10.10.10.10 ccudelay=180
setuuid Ccu 6016f997-f33f-90ad-2c23-ef1db27b1a7ede57
attr Ccu ccuaggregate name:battery,filter:room=Homematic,read:(LOWBAT|LOW_BAT),if:any=yes,else:no,prefix=battery_,coll:alias
attr Ccu ccudef-readingfilter ^(LOW_?BAT|UNREACH)$
attr Ccu ccudef-readingname ^(.+\.)?LOW_?BAT$:battery;;^(.+\.)?UNREACH$:activity
attr Ccu ccudef-substitute AES_KEY!(0|false):off,(1|true):on;;LOWBAT,LOW_BAT!(0|false):ok,(1|true):low;;UNREACH!(0|false):alive,(1|true):dead;;MOTION!(0|false):noMotion,(1|true):motion;;DIRECTION!0:stop,1:up,2:down,3:undefined;;WORKING!0:false,1:true;;INHIBIT!(0|false):unlocked,(1|true):locked
attr Ccu ccuflags procrpc
attr Ccu cmdIcon on:general_an off:general_aus
attr Ccu eventMap /rpcserver on:on/rpcserver off:off/
attr Ccu rpcinterfaces BidCos-RF
attr Ccu rpcport 2001
attr Ccu rpcserver on
attr Ccu stateFormat rpcstate/state

define Hm_BadezimmerFensterkontakt HMCCUDEV NEQ0627723
setuuid Hm_BadezimmerFensterkontakt 60170e58-f33f-90ad-d983-7231978b7d518216
attr Hm_BadezimmerFensterkontakt IODev Ccu
attr Hm_BadezimmerFensterkontakt alias Badzimmer Fenster
attr Hm_BadezimmerFensterkontakt ccureadingfilter STATE
attr Hm_BadezimmerFensterkontakt devStateIcon open:fts_window_1w_open closed:fts_window_1w
attr Hm_BadezimmerFensterkontakt genericDeviceType window
attr Hm_BadezimmerFensterkontakt group Badezimmer
attr Hm_BadezimmerFensterkontakt hmstatevals ERROR!7:sabotage;;SABOTAGE!1:sabotage
attr Hm_BadezimmerFensterkontakt icon fts_window_1w
attr Hm_BadezimmerFensterkontakt room Homematic,Home,homebridge
attr Hm_BadezimmerFensterkontakt statedatapoint 1.STATE
attr Hm_BadezimmerFensterkontakt substitute STATE!(0|false):closed,(1|true):open


Wenn ich nun einen Reboot durchführe, erhalte ich folgende Fehlermeldung bzw. folgenden Log:

2021.01.31 23:22:24 3: HMCCU: Illegal RPC interface BidCos-RF


2021.01.31 23:22:24 1: HMCCU: [Ccu : 826] Initialized version 4.3.025
2021.01.31 23:22:24 1: HMCCU: [Ccu : 826] HMCCU: Initializing device
2021.01.31 23:22:24 1: HMCCU: [Ccu : 826] HMCCU: Read 0 devices with 0 channels from CCU 10.10.10.10
2021.01.31 23:22:24 1: HMCCU: [Ccu : 826] HMCCU: Read 0 interfaces from CCU 10.10.10.10
2021.01.31 23:22:24 1: HMCCU: [Ccu : 826] HMCCU: Read 0 programs from CCU 10.10.10.10
2021.01.31 23:22:24 1: HMCCU: [Ccu : 826] HMCCU: Read 0 virtual groups from CCU 10.10.10.10
2021.01.31 23:22:24 3: HMCCU: Illegal RPC interface BidCos-RF
2021.01.31 23:22:24 2: HMCCUDEV: [Hm_BadezimmerFensterkontakt] Cannot detect IO device, maybe CCU not ready. Trying later ...
2021.01.31 23:22:25 1: define d_rpc010010BidCos_RF HMCCURPCPROC http://10.10.10.10 BidCos-RF: Invalid port or interface BidCos-RF
2021.01.31 23:22:25 1: Messages collected while initializing FHEM:configfile: HMCCU: Illegal RPC interface BidCos-RF
Invalid port or interface BidCos-RF
Please define d_rpc010010BidCos_RF 60172699-f33f-90ad-ad14-d694835d377f556f first
2021.01.31 23:22:25 0: HMCCU: Start of RPC server after FHEM initialization in 12 seconds
2021.01.31 23:22:37 2: HMCCU: [Ccu : 826] Get RPC device for interface BidCos-RF
2021.01.31 23:22:37 0: HMCCU: [Ccu : 826] Definition of some RPC devices failed


Es scheint so, wie wenn die CCU noch nicht vollständig initialisiert ist, aber FHEM trotzdem den Zugriff versucht. Wenn ich direkt nach dieser Fehlermeldung FHEM neustarte, funktioniert die HMCCU Einbindung korrekt.

Wenn ich BidCos_RF definiere:

define d_rpc010010BidCos_RF HMCCURPCPROC http://10.10.10.10 BidCos-RF
setuuid d_rpc010010BidCos_RF 6016f9b2-f33f-90ad-4b21-107e9e04a792d680
attr d_rpc010010BidCos_RF alias CCU RPC BidCos-RF
attr d_rpc010010BidCos_RF eventMap /rpcserver on:on/rpcserver off:off/
attr d_rpc010010BidCos_RF stateFormat rpcstate/state
attr d_rpc010010BidCos_RF verbose 2


Erhalte ich weiterhin die genannte Fehlermeldung:

2021.01.31 23:32:19 1: HMCCU: [Ccu : 852] Initialized version 4.3.025
2021.01.31 23:32:19 1: HMCCU: [Ccu : 852] HMCCU: Initializing device
2021.01.31 23:32:19 1: HMCCU: [Ccu : 852] HMCCU: Read 0 devices with 0 channels from CCU 10.10.10.10
2021.01.31 23:32:19 1: HMCCU: [Ccu : 852] HMCCU: Read 0 interfaces from CCU 10.10.10.10
2021.01.31 23:32:19 1: HMCCU: [Ccu : 852] HMCCU: Read 0 programs from CCU 10.10.10.10
2021.01.31 23:32:19 1: HMCCU: [Ccu : 852] HMCCU: Read 0 virtual groups from CCU 10.10.10.10
2021.01.31 23:32:20 3: HMCCU: Illegal RPC interface BidCos-RF
2021.01.31 23:32:20 1: define d_rpc010010BidCos_RF HMCCURPCPROC http://10.10.10.10 BidCos-RF: Invalid port or interface BidCos-RF
2021.01.31 23:32:20 2: HMCCUDEV: [Hm_BadezimmerFensterkontakt] Cannot detect IO device, maybe CCU not ready. Trying later ...
2021.01.31 23:32:20 1: define d_rpc010010BidCos_RF HMCCURPCPROC http://10.10.10.10 BidCos-RF: Invalid port or interface BidCos-RF
2021.01.31 23:32:20 1: Messages collected while initializing FHEM:configfile: HMCCU: Illegal RPC interface BidCos-RF
Invalid port or interface BidCos-RF
Please define d_rpc010010BidCos_RF 6016f9b2-f33f-90ad-4b21-107e9e04a792d680 first
Invalid port or interface BidCos-RF
Please define d_rpc010010BidCos_RF 60172699-f33f-90ad-ad14-d694835d377f556f first
2021.01.31 23:32:20 0: HMCCU: Start of RPC server after FHEM initialization in 12 seconds
2021.01.31 23:32:32 2: HMCCU: [Ccu : 852] Get RPC device for interface BidCos-RF
2021.01.31 23:32:34 0: HMCCU: [Ccu : 852] Definition of some RPC devices failed


Wenn ich in der Definition von HMCCU ccudelay durch delyedinit ersetze, funktioniert die Einbindung der CCU in FHEM direkt im ersten Anlauf:


2021.01.31 23:00:28 1: HMCCU: [Ccu : 833] Forced delayed initialization
2021.01.31 23:00:28 1: HMCCU: [Ccu : 833] Initialized version 4.3.025
2021.01.31 23:00:28 1: HMCCU: [Ccu : 833] Scheduling delayed initialization in 180 seconds
2021.01.31 23:00:28 2: HMCCUDEV: [Hm_BadezimmerFensterkontakt] Cannot detect IO device, maybe CCU not ready. Trying later ...
2021.01.31 23:00:29 2: HMCCURPCPROC: [d_rpc010010BidCos_RF : 833] Cannot detect IO device, maybe CCU not ready. Trying later ...
2021.01.31 23:00:29 1: Including ./log/fhem.save
2021.01.31 23:00:29 0: HMCCU: Start of RPC server after FHEM initialization in 200 seconds
2021.01.31 23:03:28 1: HMCCU: [Ccu : 833] HMCCU: Initializing devices
2021.01.31 23:03:28 2: HMCCU: [Ccu : 833] Initializing 2 client devices in state 'pending'
2021.01.31 23:03:28 1: HMCCURPCPROC: [d_rpc010010BidCos_RF : 833] Initialized version 1.9.001 for interface BidCos-RF with I/O device Ccu
2021.01.31 23:03:28 1: HMCCU: [Ccu : 833] HMCCU: Read 3 devices with 104 channels from CCU 10.10.10.10
2021.01.31 23:03:28 1: HMCCU: [Ccu : 833] HMCCU: Read 3 interfaces from CCU 10.10.10.10
2021.01.31 23:03:28 1: HMCCU: [Ccu : 833] HMCCU: Read 0 programs from CCU 10.10.10.10
2021.01.31 23:03:28 1: HMCCU: [Ccu : 833] HMCCU: Read 0 virtual groups from CCU 10.10.10.10
2021.01.31 23:03:49 2: HMCCU: [Ccu : 833] Get RPC device for interface BidCos-RF
2021.01.31 23:03:49 2: HMCCURPCPROC: [d_rpc010010BidCos_RF : 833] RPC server process started for interface BidCos-RF with PID=1840
2021.01.31 23:03:49 2: HMCCURPCPROC: [d_rpc010010BidCos_RF : 1840] Initializing RPC server CB2001010010010010 for interface BidCos-RF
2021.01.31 23:03:49 1: HMCCURPCPROC: [d_rpc010010BidCos_RF : 833] RPC server starting
2021.01.31 23:03:49 2: HMCCURPCPROC: [d_rpc010010BidCos_RF : 1840] Callback server CB2001010010010010 created. Listening on port 7411
2021.01.31 23:03:49 2: HMCCURPCPROC: [d_rpc010010BidCos_RF : 1840] CB2001010010010010 accepting connections. PID=1840
2021.01.31 23:03:49 2: HMCCURPCPROC: [d_rpc010010BidCos_RF : 833] RPC server CB2001010010010010 enters server loop
2021.01.31 23:03:49 2: HMCCURPCPROC: [d_rpc010010BidCos_RF : 833] Registering callback http://10.10.10.10:7411/fh2001 of type A with ID CB2001010010010010 at http://10.10.10.10:2001
2021.01.31 23:03:50 1: HMCCURPCPROC: [d_rpc010010BidCos_RF : 833] RPC server CB2001010010010010 running
2021.01.31 23:03:50 1: HMCCU: [Ccu : 833] All RPC servers running
2021.01.31 23:03:50 2: HMCCU: [Ccu : 833] Updating 1 of 1 client devices matching devexp=.* filter=ccudevstate=active,ccuif=BidCos-RF
2021.01.31 23:03:50 1: HMCCURPCPROC: [d_rpc010010BidCos_RF : 833] Scheduled CCU ping every 300 seconds
2021.01.31 23:03:50 2: HMCCU: [Ccu : 833] Update success=1 failed=0
2021.01.31 23:03:50 2: HMCCURPCPROC: [d_rpc010010BidCos_RF : 1840] CB2001010010010010 NewDevice received 55 device and channel specifications


Daher die Frage:
1. muss define d_rpc010010BidCos_RF HMCCURPCPROC http://10.10.10.10 BidCos-RF definiert werden?
2. Gibt es eine Möglichkeit die CCU bzw. FHEM so zu konfigurieren, dass es mit der Definition "ccudelay" klappt, und dass ich nicht delyedinit verwenden muss? (Dabei wird nicht geprüft, ob die CCU wirklich verfügbar ist, daher würde ich gerne mit "ccudelay" arbeiten.)

Vielen Dank und beste Grüße!
Titel: Antw:HMCCU Initialisierung: Illegal RPC interface BidCos-RF
Beitrag von: zap am 01 Februar 2021, 18:44:31
Das hängt alles mit der Initialisierung von HMCCU zusammen. Das Modul liest erstmal die Config der CCU ein, u.a. die Liste der Interfaces. Da die CCU noch nicht richtig initialisiert ist, bekommt HMCCU keine Interfaces.
Wenn nun HMCCURPCPROC versucht, ein Device für ein Interface zu definieren, das das IO Device nicht kennt, schlägt das eben fehl. Ich schaue nochmal, warum ccudelay nicht wie erwartet funktioniert. Wenn es da ein Problem gibt, werde ich es in der 4.4 fixen. In der 4.3 wohl eher nicht mehr.
Titel: Antw:HMCCU Initialisierung: Illegal RPC interface BidCos-RF
Beitrag von: raspberry am 01 Februar 2021, 22:30:37
Vielen Dank für die Rückmeldung. Mit dem Workaround über "delayedinit" funktioniert es aktuell.

Habe HMCCURPCPROC wie beschrieben konfiguriert.

Noch etwas, vielleicht hat das was damit zu tun bzw. vielleicht stimmt was mit dem RPC-Server nicht: Wenn ich "rereadcfg" ausführe, kann ich danach den RPC-Server nicht mehr starten.

HMCCU: Ccu Start of RPC server failed

Das gilt auch, wenn ich vor "rereadcfg" den Server stoppe:

set Ccu rpcserver off

Wenn ich fhem komplett neustarte (keinen reboot, also CCU nicht neugestartet), funktioniert es korrekt. Allerdings nur, wenn der RPC Server durch delayedinit automatisch gestartet wird. Wenn ich vor dem automatischen Start

set Ccu rpcserver on

ausführe, erhalte ich wieder die oben genannte Fehlermeldung.
Titel: Antw:HMCCU Initialisierung: Illegal RPC interface BidCos-RF
Beitrag von: zap am 02 Februar 2021, 17:17:36
HMCCU unterstützt rereadcfg nicht.
Im konkreten Fall laufen die RPC Prozesse im Hintergrund noch. Daher die Probleme.

rereadcfg ist ja eigentlich nur sinnvoll, wenn man die fhem.cfg manuell editiert. Das wiederum unterstütze ich nicht ;)