I recently updated my system to OH4 stable. After two days of trying to get the Homematic Binding to work again, I need your help. Until the upgrade the binding was working, but since the new OH version, it seems as if the connection to the homegear rpc server could not be established.
The OH log states the following when I try to enable the bridge:
2023-07-26 19:32:09.899 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing ‘homematic:bridge:277af19682’ changed from INITIALIZING to OFFLINE (COMMUNICATION_ERROR): java.util.concurrent.ExecutionException: java.net.ConnectException: Verbindungsaufbau abgelehnt
Connection refused. The Homegear logfile states, that the rfc server is successfully started and running, written in the logfile as well as in the integrated lifetick function:
07/26/23 17:17:20.842 Initializing RPC server RPCServer1 listening on 0.0.0.0:2001…
But if I use netstat to show the open ports, port 2001 does not appear. This is the output of netstat -tlnp:
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:9001 0.0.0.0:* LISTEN 468/node
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 604/mariadbd
tcp 0 0 0.0.0.0:139 0.0.0.0:* LISTEN 4542/smbd
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 16779/nginx: master
tcp 0 0 0.0.0.0:8081 0.0.0.0:* LISTEN 16779/nginx: master
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 563/sshd: /usr/sbin
tcp 0 0 0.0.0.0:1880 0.0.0.0:* LISTEN 373/node-red
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 16779/nginx: master
tcp 0 0 0.0.0.0:1883 0.0.0.0:* LISTEN 501/mosquitto
tcp 0 0 0.0.0.0:445 0.0.0.0:* LISTEN 4542/smbd
tcp6 0 0 127.0.0.1:45091 :::* LISTEN 467/java
tcp6 0 0 127.0.0.1:8101 :::* LISTEN 467/java
tcp6 0 0 :::139 :::* LISTEN 4542/smbd
tcp6 0 0 :::5007 :::* LISTEN 467/java
tcp6 0 0 :::8080 :::* LISTEN 467/java
tcp6 0 0 :::22 :::* LISTEN 563/sshd: /usr/sbin
tcp6 0 0 :::3000 :::* LISTEN 4587/grafana-server
tcp6 0 0 :::8443 :::* LISTEN 467/java
tcp6 0 0 :::1883 :::* LISTEN 501/mosquitto
tcp6 0 0 :::445 :::* LISTEN 4542/smbd
The Homegear logfile shows, that the communication between the Homematic items and Homegear is working fine, but it seems that something is blocking the rpc server…
I think this is a contradiction.
Either the port is in listening mode and it is listed by running netstat command or it is not in listening mode then it is not listed.
Even if a firewall is used in front of the port the and port itself is in listening mode it will be shown using netstat.
Does journalctl show something about a problem e.g. that the rpc server stops again ?
This is exactly what I thought, if it is not avaiable via netstat, it should not be up.
The lifetick function from Homegear returns just the following:
RPC Client: OK
RPC Server (Port 2001): OK
Device families: OK
This is the output of journalctl -p 3 -xb, errors only from openhab:
Jul 26 23:25:20 openhab kernel: vc_sm_cma_vchi_init: failed to open VCHI service (-1)
Jul 26 23:25:20 openhab kernel: [vc_sm_connected_init]: failed to initialize shared memory service
Jul 26 23:25:21 openhab kernel: bcm2835_mmal_vchiq: Failed to open VCHI service connection (status=-1)
Jul 26 23:25:21 openhab kernel: bcm2835_mmal_vchiq: Failed to open VCHI service connection (status=-1)
Jul 26 23:25:21 openhab kernel: bcm2835_mmal_vchiq: Failed to open VCHI service connection (status=-1)
Jul 26 23:25:21 openhab kernel: brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6
Jul 26 23:25:21 openhab systemd-udevd[174]: eth0: Failed to rename network interface 2 from ‘eth0’ to ‘enxb827eb65287b’: Device or resource busy
Jul 26 23:25:22 openhab kernel: brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6
Jul 26 23:25:22 openhab kernel: brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4345/6 wl0: Nov 1 2021 00:37:25 version 7.45.241 (1a2f2fa CY) FWID 01-703fd60
Jul 26 23:25:58 openhab dhcpcd[323]: dhcpcd_prestartinterface: wlan0: Operation not possible due to RF-kill
Jul 26 23:26:11 openhab bluetoothd[1261]: profiles/sap/server.c:sap_server_register() Sap driver initialization failed.
Jul 26 23:26:11 openhab bluetoothd[1261]: sap-server: Operation not permitted (1)
Jul 26 23:26:11 openhab bluetoothd[1261]: Failed to set privacy: Rejected (0x0b)
What I forgot to mention, with the OH4 update Homegear wa updated to V0.8.1 (?), testing repo. I already tried the stable and the nightly versions (0.7 and 0.9), currently I am at the stable version again.
If I use homegear -r and lt for the lifetick the answer is:
RPC Client: OK
RPC Server (Port 2001): OK
RPC Server (Port 2002): OK
RPC Server (Port 2003): OK
RPC Server (Port 2004): OK
RPC Server (Port 9080): OK
RPC Server (Port 9443): OK
Device families: OK
But if I use rpc to list servers I get:
Name Interface Port SSL Auth
RPCServer1 :: 2001 false none
RPCServer2 :: 2002 true none
RPCServer4 127.0.0.1 2004 false none
WebServer1 :: 9080 false none
WebServer2 :: 9443 true none
Hi there
did you get anywhere with this issue? I do have major issues with the homematic binding / homegear setup. There has been no way to get it up and running.
I hope to get rid of the homematic devices soon, so I won’t invest more time into his issue.
At least for me, it is one of a few things that simply don’t work with OH 4.x…
thanks
I am absolutely with you. Got most of OH4 working after spending several hours adapting all kinds of settings to this version.
Homematic and homegear will not work at all. Even switching back to the old version nothing will connect.
Was lucky to have the old 3.4.4 setup on sd and ssd. So at least on that side I can switch between trail and operating. For now
Yes, here. I am using Homegear (0.8.1-3519) with OH 4.0.2 without any problems. If netstat -al doesn’t show port 2001 in your case, the issue clearly is with HG, not OH, since it’s totally listed for me:
With or without any of the many manual adjustments suggested by homegear? Back in the old days some changes besides the adjustment in the homematicwired, homematicbidcos, etc were required. Plus changes to the GPIO settings.
I am currently restarting another fresh install. Would be nice to get it working this time.
Without any manual adjustments (that I’m aware of - the HG installation isn’t new, so I may have forgotten something), except the needed ones (rfKey, centralAddress, RF hardware).
I’m not using a Raspi though, but an Intel NUC with a CULv3 stick.
Does the homegear.log file shed any light?
Ok, just got the next install started. First thing out of the log ‘could not start listening on port 80’. More important ‘Could not set owner on /var/lib/homegear/defaultPassword.txt’
did change the port 80 and 443. Homegear connects to the CUN. It did before but it took forever on these two ports.
Now I still need to get the homematic binding to react as well. there it still shows an Error ‘java.util.concurrent.ExecutionException: java.net.ConnectException: Connection refused’
In the binding there is no more Gateway-Extras which does not seem to be correct. In the old setup it appeared right away. It is also mentioned in the documentation for openhab 4.
This suggests port 2001 still is not reachable. Did you double check netstat -al after making the port changes?
If it’s listed in netstat, a trace log of the HM binding startup (log:set TRACE org.openhab.binding.homematic) would be helpful.
A change of the port 80 and 443 to something like 8180 and 8143 is necessary to access the homegear webserver. I did this too, but it should not be necessary for basic operation.