ramack / openhab-addons

Add-ons for openHAB 2.x
Eclipse Public License 1.0
1 stars 1 forks source link

Communication error in device discovery with resol vbus lan #25

Closed niebuhrhood closed 4 years ago

niebuhrhood commented 5 years ago

Hi ramack, I installed the resol binding via eclipse market binding in paper ui on a fresh installed openhabian 2.4.0-1 with openhab 2.4 Then it says "Offline - Communication error" in the thing configuration. My Raspbi 3 uses a normal dhcp lan connection and the resol interface is accesible in the browser.

The openhab.log says:

2019-02-27 20:12:35.243 [WARN ] [org.eclipse.jetty.server.HttpChannel] - /rest/discovery/bindings/resol/scan javax.servlet.ServletException: javax.servlet.ServletException: org.glassfish.jersey.server.ContainerException: java.lang.IncompatibleClassChangeError: Expected static field org.openhab.binding.resol.internal.discovery.ResolVBusBridgeDiscovery.scheduler at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:88) ~[?:?] at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132) ~[84:org.eclipse.jetty.server:9.4.11.v20180605] at org.eclipse.jetty.server.Server.handle(Server.java:531) ~[84:org.eclipse.jetty.server:9.4.11.v20180605] at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:352) [84:org.eclipse.jetty.server:9.4.11.v20180605] at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:260) [84:org.eclipse.jetty.server:9.4.11.v20180605] at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:281) [75:org.eclipse.jetty.io:9.4.11.v20180605] at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102) [75:org.eclipse.jetty.io:9.4.11.v20180605] at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:118) [75:org.eclipse.jetty.io:9.4.11.v20180605] at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333) [87:org.eclipse.jetty.util:9.4.11.v20180605] at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310) [87:org.eclipse.jetty.util:9.4.11.v20180605] at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168) [87:org.eclipse.jetty.util:9.4.11.v20180605] at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126) [87:org.eclipse.jetty.util:9.4.11.v20180605] at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366) [87:org.eclipse.jetty.util:9.4.11.v20180605] at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:762) [87:org.eclipse.jetty.util:9.4.11.v20180605] at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:680) [87:org.eclipse.jetty.util:9.4.11.v20180605] at java.lang.Thread.run(Thread.java:748) [?:?] Caused by: javax.servlet.ServletException: org.glassfish.jersey.server.ContainerException: java.lang.IncompatibleClassChangeError: Expected static field org.openhab.binding.resol.internal.discovery.ResolVBusBridgeDiscovery.scheduler at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:489) ~[?:?] at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427) ~[?:?] at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388) ~[?:?] at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341) ~[?:?] at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228) ~[?:?] at com.eclipsesource.jaxrs.publisher.internal.ServletContainerBridge.service(ServletContainerBridge.java:76) ~[?:?] at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:865) ~[?:?] at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:535) ~[?:?] at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:71) ~[?:?] at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146) ~[?:?] at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548) ~[?:?] at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132) ~[?:?] at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257) ~[?:?] at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595) ~[?:?] at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255) ~[?:?] at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1317) ~[?:?] at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:293) ~[?:?] at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203) ~[?:?] at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473) ~[?:?] at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564) ~[?:?] at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201) ~[?:?] at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1219) ~[?:?] at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144) ~[?:?] at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80) ~[?:?]

and the debug log:

20:29:34.026 [DEBUG] [ding.resol.handler.ResolBridgeHandler] - Dispose Resol bridge handlerorg.openhab.binding.resol.handler.ResolBridgeHandler@2dbcc8 20:29:34.037 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'resol:vbuslan:db5b17fa' changed from OFFLINE (COMMUNICATION_ERROR): Verbindungsaufbau abgelehnt (Connection refused) to OFFLINE 20:29:34.042 [INFO ] [smarthome.event.ThingUpdatedEvent ] - Thing 'resol:vbuslan:db5b17fa' has been updated. 20:29:34.040 [DEBUG] [ding.resol.handler.ResolBridgeHandler] - Initializing Resol bridge handler org.openhab.binding.resol.handler.ResolBridgeHandler@2dbcc8 20:29:34.065 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'resol:vbuslan:db5b17fa' changed from OFFLINE to OFFLINE (COMMUNICATION_ERROR): Verbindungsaufbau abgelehnt (Connection refused) 20:29:34.070 [INFO ] [ding.resol.handler.ResolBridgeHandler] - Cannot establish connection to 192.168.178.25 (Verbindungsaufbau abgelehnt (Connection refused))

Is there any chance to get it working in 2.4? Any help is greatly appreciated :-)

niebuhrhood commented 5 years ago

Found the solution: The resol device KM2 MUST have a dhcp ip address in the web interface. Static ip address will NOT work. Then i had to stop/start openhab again.

ramack commented 5 years ago

Sorry for the late response, I am far from my dev computer these days. The issue with the incompatible class change should be solvable by a resomoile against the current coder base. For the dhcp 'solution' I'd like to better understand why this happens. Did you also try to configure it back to a static IP after it had worked? And could you try to telnet the ip and port directly in both configurations? @danielwippermann do you have an idea for the root cause?

danielwippermann commented 5 years ago

The error @niebuhrhood reports looks a lot like the one here: https://community.openhab.org/t/new-binding-resol-vbus/2203/148 .

Back then we found out the KM2 firmware 1.1.1 and before has a bug that prevents device discovery to work if the LAN interface uses a static IP address. The bug was fixed in firmware 1.1.2, which will be published to the RESOL homepage soon™️

In the meantime you can already download it from their CDN:

https://cdn.resol.de/download/tFIOVM7eDERSstYt1RVfgra2zqSB09tfIeswoVwduVlgw9M2K8cfcwqRm2fMdpR6/11213524_RESOL_RESOL_KM2_1.1.2-rc1-SDK.zip

Unzip the file and use the contained firmware.cbor file to perform the firmware update using the KM2's web interface.

niebuhrhood commented 5 years ago

Hey, yes, I agree with Daniel that is the same error.

Let's go into details: Actually I did a update from 2.3 to 2.4 via openhabian config and everything was fine. I thought it would be nice to have static ip for my raspbi, so I configured one in /etc/dhcpcd.conf and then the mess began. The binding stopped working and i got the error named in this issue. After a long try and error session I resetted the raspbi static ip to dhcp and finally also in the resol device km2. Then it runned again.

I saw the advice in the openhab blog issue Daniel mentioned but didn't find out how to connect to the km2 with ssh => "port 22: Connection refused". Also I cannot find any ssh configuration settings in the web interface. Maybe I'm using an old firmware?

I'm confused with the version number, because my km2 says it the version 2.0

Thanks for your clarification :)

danielwippermann commented 5 years ago

The SSH config section is not directly accessible from any page, you have to change the URL in the browser's address bar to get there.

You log into your KM2's web interface as admin and click on "Configuration > General" in the sidebar. The URL should be something like "http://<IP of KM2>/#config/general". Then replace the "general" part of the URL with "ssh" -> "http://<IP of KM2>/#config/ssh". Hit return, enable SSH and change the password (the default is on the sticker on the back of the device / manual). Click "Save" and several seconds later you should be able to log in using SSH.

I'm confused with the version number, because my km2 says it the version 2.0

Hmmm, interesting :) I want that too :) I'm not aware of any public firmware using that version, but since the source code is publicly available that might be a custom built version I'm not aware of.

EDIT: Fixed wrongly escaped < / >

niebuhrhood commented 5 years ago

Hi, ok, now i know: i don't have the km2, instead i own an Schnittstellenadapter VBus®/LAN => https://www.resol.de/de/produktdetail/76 The device case is quite similar compared to the km2, but without the switch on the side.

I can download a new firmware from resol website, but this .jar (VBus2LAN-Update-1.0.3.jar) is from 2012 :-( But i can live with the dhcp ip setting as long as it works :-)

ramack commented 5 years ago

mh, the versioning of the VBUS/LAN adapters seems a bit messy. I have one with version 1.0.0 and one with 1.0.2 - without a clue whether I could or should update (the 1.0.2 seems updateable to 1.0.3, but without release notes, I am not sure what to do)

I configured the 1.0.2 variant to use a static IP and openhab was still able to show the data - even without a connection loss during the change back from static to dynamic IP. But wait... if I read you hav a VBUS/LAN with a version 2.0 I guess that Resol did a redesign and uses the same MCU in the KM2 and the VBUS/LAN (v2.x) just with the difference of the WIFI interface... So it might still be the same bug - and I am not affected, because I have sufficiently old HW :smile:

@danielwippermann is there also be an update for the VBUS/LAN firmware upcoming?

danielwippermann commented 5 years ago

The VBus/LAN exists in two different, incompatible hardware versions. @ramack obviously has first-gen hardware (running firmware version 1.0.x) and @niebuhrhood has a second-gen hardware (running firmware 2.0.0).

But wait... if I read you hav a VBUS/LAN with a version 2.0 I guess that Resol did a redesign and uses the same MCU in the KM2 and the VBUS/LAN (v2.x) just with the difference of the WIFI interface...

Sadly no. The VBus/LAN and KM2 do not share the same hardware and software. While the KM2 runs an embedded Linux, the two VBus/LANs do not.

@danielwippermann is there also be an update for the VBUS/LAN firmware upcoming?

No, not that I know of.

ramack commented 4 years ago

If I am not mistaken this is an issue in the Resol firmware and not in the binding, so I close it. If anyone sees an issue in the binding, don't hesitate to reopen.