Homematic binding connection problem with Raspberrymatic

Hi everyone,
I am trying to connect OH to my Raspberrymatic “CCU”, following the many tutorials out there. During my research I found quite a lot of threads about connection problems between the two, but so far none of the solutions worked for me and I just don’t know anymore what else to try out.

Systems
OH: openHAB 2.5.6 Release Build on Windows10 1909 (just getting started and trying to get stuff running)

  • Homematic binding 2.5.6
    Java x64 1.8.0_251 (latest, Oracle)

CCU: Raspberrymatic 3.51.6.20200420

  • XML-API 1.20

Error description
Try to add Homematic Thing, CCU is discovered with correct IP, I add it.
After some seconds, status goes to OFFLINE - COMMUNICATION ERROR - Jetty start failed.
rm_in_oh

events.log

2020-06-30 20:29:31.973 [home.event.InboxAddedEvent] - Discovery Result with UID ‘homematic:bridge:3014F711A0001F5A4993E591’ has been added.
2020-06-30 20:29:45.126 [me.event.InboxRemovedEvent] - Discovery Result with UID ‘homematic:bridge:3014F711A0001F5A4993E591’ has been removed.
2020-06-30 20:29:45.128 [hingStatusInfoChangedEvent] - ‘homematic:bridge:3014F711A0001F5A4993E591’ changed from UNINITIALIZED to INITIALIZING
2020-06-30 20:29:58.336 [hingStatusInfoChangedEvent] - ‘homematic:bridge:3014F711A0001F5A4993E591’ changed from INITIALIZING to OFFLINE (COMMUNICATION_ERROR): Jetty start failed

and less interesting I guess, the

openhab.log

2020-06-30 20:29:31.972 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing ‘homematic:bridge:3014F711A0001F5A4993E591’ to inbox.
2020-06-30 20:29:45.167 [INFO ] [ternal.communicator.client.RpcClient] - Interface ‘WIRED’ on gateway ‘3014F711A0001F5A4993E591’ not available, disabling support
2020-06-30 20:29:47.278 [INFO ] [ternal.communicator.client.RpcClient] - Interface ‘CUXD’ on gateway ‘3014F711A0001F5A4993E591’ not available, disabling support
2020-06-30 20:29:47.297 [INFO ] [ommunicator.AbstractHomematicGateway] - HmGatewayInfo[id=CCU,type=CCU2,firmware=3.51.6.20200420,address=QEQ0687505,rf=true,wired=false,hmip=true,cuxd=false,group=true]
2020-06-30 20:30:08.402 [INFO ] [ternal.communicator.client.RpcClient] - Interface ‘WIRED’ on gateway ‘3014F711A0001F5A4993E591’ not available, disabling support
2020-06-30 20:30:10.518 [INFO ] [ternal.communicator.client.RpcClient] - Interface ‘CUXD’ on gateway ‘3014F711A0001F5A4993E591’ not available, disabling support
2020-06-30 20:30:10.537 [INFO ] [ommunicator.AbstractHomematicGateway] - HmGatewayInfo[id=CCU,type=CCU2,firmware=3.51.6.20200420,address=QEQ0687505,rf=true,wired=false,hmip=true,cuxd=false,group=true]
continues like that

Failed solution attempts

  • restart CCU multiple times, restart OH
  • try again next day
  • Disable COMODO Firewall software on Windows
  • Raspberrymatic / CCU Firewall + Auth configuration:

    The ports shouldn’t be required as access is anyway set to “Full” above.
  • Note that I can manually access the XML-API via http://<ip-of-ccu>/addons/xmlapi/info.html
  • At the beginning I started out with error " Unknown XML-RPC tag: title" instead of “Jetty start failed”. I guess that was solved when I changed auth/firewall settings?

These are the hints I found. Did I maybe miss something? Do you have a hunch which direction I could go?

Thanks in advance

1 Like

Welcome to the Community!

Use the console and set the binding to DEBUG or TRACE and see if you get any additional info that may help resolve the issue.

1 Like

Hi tsnow,

your post caused me to finally open an account at this great community as well, as I now know that I’m not alone with my problems and that it’s not my own stupidity’s fault :wink:

I’ve started with openHAB (2.5.4, on a Pi 4) a few weeks ago and also have a RaspberryMatic (3.47.15.20190831, on a Pi B+). The screenshots of the settings you show all seem correct to me. I have been running into very similar problems as you have. A list of the symptoms I see:

  • Homematic binding seems to not be able to completely install (continuously rotating circle)
  • CCU doesn’t get found by the binding discovery in the first place
  • Homematic bridge shows “COMMUNICATION_ERROR”
  • Homematic bridge shows “INITIALIZING” and doesn’t finish initializing
  • Homematic things cannot get removed (stay at “REMOVING”)
  • Homematic binding cannot get uninstalled (continuously rotating circle)

The frustrating thing for me was that the Homematic binding just seems flaky, meaning that in general it works for me for a while. Sometimes for a few days (when I continued tinkering with openHAB) and just now for three weeks (when I did not touch the running system). At some point however, the homematic bridge loses contact to the RaspberryMatic (COMMUNICATION_ERROR) and cannot gain it back. The RaspberryMatic itself works fine and is accessible via XML-API.

What I try then, is removing the Homematic bridge thing and readding it. Sometimes that works, other times the bridge gets stuck at “INITIALIZING”. Just today that again happened to me. I was not able to get the binding to communicate with my CCU.

So, the last drastic step I do is the following, which always works for me (and just worked again today with 2.5.6):

  1. Re-flash openhabian and let my Pi completely initialize a fresh installation.
  2. In Paper UI, install Homematic Binding as the first binding.
  3. Go to Inbox and wait until the CCU shows up. Add it as a thing.
  4. Wait until all the homematic devices show up in the Inbox.

After that, I can continue install and configure the rest of the bindings without Homematic not losing connection.

I moved my Homematic things (actually, all things) to a .things file instead of letting Paper UI manage it, because it is much faster just copying the .things file back to the new installation instead of clicking and configuring all the things in PaperUI.

Not sure if this helps you at all, but there seems to be problems with the Homematic binding support for RaspberryMatic, unless somebody else chimes in who seems similar issues with a “real” CCU.

1 Like

Hi Jens,
welcome to the community.
I have the same setup - OH and Raspberrymatic. and had similar issue some time back but i dont remember how i solved it… :frowning:
i was trying different settings in the raspberrymatic and restarting OH time-to-time and at some point it started to work again.

my OH has the IP 192.168.1.80
raspberrymatic: 192.168.1.46

here are my setting in raspberrymatic

i have few more ports offen but im not sure whether all needed (probably not).
but maybe you could try to add these ports to your setup
2000;
2001;
2010;
8701;
9200;
9201;
9202;
9127;
9292

here are my bridge settings in OH things config

Bridge homematic:bridge:rasmatic [ gatewayAddress="192.168.1.46", callbackHost="192.168.1.80", binCallbackPort="9202", xmlCallbackPort="9201" ]

2 Likes

First, thank you all for your moral support. Today I found new energy to approach the issue.

Thanks H102 especially for the hint on the logging functionality, that is indeed very helpful.

In the DEBUG log of org.openhab.binding.homematic I found

java.io.IOException: Jetty start failed
...
Caused by: java.io.IOException: Failed to bind to NEXTKEKS.fritz.box/192.168.178.21:9125
...
Caused by: java.net.BindException: Cannot assign requested address: bind
Full message

java.io.IOException: Jetty start failed
at org.openhab.binding.homematic.internal.communicator.server.XmlRpcServer.start(XmlRpcServer.java:92) ~[?:?]
at org.openhab.binding.homematic.internal.communicator.AbstractHomematicGateway.startServers(AbstractHomematicGateway.java:254) ~[?:?]
at org.openhab.binding.homematic.internal.communicator.AbstractHomematicGateway.initialize(AbstractHomematicGateway.java:192) ~[?:?]
at org.openhab.binding.homematic.internal.handler.HomematicBridgeHandler.initializeInternal(HomematicBridgeHandler.java:110) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_251]
at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_251]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source) [?:1.8.0_251]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) [?:1.8.0_251]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_251]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_251]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_251]
Caused by: java.io.IOException: Failed to bind to NEXTKEKS.fritz.box/192.168.178.21:9125
at org.eclipse.jetty.server.ServerConnector.openAcceptChannel(ServerConnector.java:346) ~[bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:307) ~[bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80) ~[bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:231) ~[bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72) ~[bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.server.Server.doStart(Server.java:385) ~[bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72) ~[bundleFile:9.4.20.v20190813]
at org.openhab.binding.homematic.internal.communicator.server.XmlRpcServer.start(XmlRpcServer.java:87) ~[?:?]
… 10 more
Caused by: java.net.BindException: Cannot assign requested address: bind
at sun.nio.ch.Net.bind0(Native Method) ~[?:1.8.0_251]
at sun.nio.ch.Net.bind(Unknown Source) ~[?:1.8.0_251]
at sun.nio.ch.Net.bind(Unknown Source) ~[?:1.8.0_251]
at sun.nio.ch.ServerSocketChannelImpl.bind(Unknown Source) ~[?:1.8.0_251]
at sun.nio.ch.ServerSocketAdaptor.bind(Unknown Source) ~[?:1.8.0_251]
at org.eclipse.jetty.server.ServerConnector.openAcceptChannel(ServerConnector.java:342) ~[bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:307) ~[bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80) ~[bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:231) ~[bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72) ~[bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.server.Server.doStart(Server.java:385) ~[bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72) ~[bundleFile:9.4.20.v20190813]
at org.openhab.binding.homematic.internal.communicator.server.XmlRpcServer.start(XmlRpcServer.java:87) ~[?:?]

That binding issue reminds me on the topic [solved] Homematic no pong / OFFLINE - BRIDGE_OFFLINE after update to 2.5M1. It did not follow up on it because I didn’t have an appropriate tool or experience ready to do the same analysis on Windows.

Now the exception “java.net.BindException: Cannot assign requested address” can be googled quickly, there is a detailed explanation eg in https://javarevisited.blogspot.com/2014/02/fixing-javanetbindexception-cannot-assign-requested-address-JVMbind.html (or many stackoverflow posts). The issue is caused by the local hostname resolution.

My nslookup tells me for my computer:

Name:    NEXTKEKS.fritz.box
Addresses:  192.168.178.21
            192.168.4.21

and I don’t know where this 192.168.178.21 is coming from. The .4.21 is the subnet configured in my fritzBox DHCP.
I will try to find out

  1. where that comes from
  2. how it can be fixed in the openhab context

I could not find the answer to 1, but a solution 2 :slight_smile:

Not very satisfying, but working hack in Window’s host file, setting the correct local IP for the computer’s hostname. Now the CCU connection works :tada:

1 Like

Now that I know the root cause and read through your answers again, @yfre gave the better solution:

OH things configuration of CCU, set in PaperUI or in things file
callbackHost = 127.0.0.1

(you might have to disable the thing and re-enable to get it Online properly. Watching the DEBUG logging helps)

Hi Eugen,

thanks for your extended explanations, but the root cause seems to have been a more simplistic one. I was running RaspberryMatic on a Pi B+ without problems for many years now. Fed up with the connectivity problems I gave upgrading to a Pi 3 B+ a try and voilà, all my troubles are a thing of the past (at least have not had any problems for the last two weeks, I hope that lasts). The Homematic Binding does not seem to like a sluggish counter part.

Jens

1 Like