New Jeelink Openhab2 Binding

Why you make the code complicated? The 2.2 from jfrog works like a charm except the reconnection problem.
Youre right, i’m silly, i dont have the LGW too far from my server so i can connect it via usb, but others may have the reconnection problem also, so we work for the community, not for me :wink:

Nobody holds you back to work for the community. It is a lot easier for you having a LGW than for me writing code that I can not test.

The 2.2 from jfrog does not have pca301 support.

Sorry its nothing against you, i know that this version doesnt has pca301 support, what i mean is, just let the TCP/LGW things of this version untouched.
Dont try to improve something else than this minor reconnection problem someday, its not important for me because i can use usb.
The TCP/LGW things of the 2.2 jfrog works like a charm because when i delete your current version and put the 2.2 jfrog inside, it starts working immediately until the first wlan interruption/disconnection.

Youre a great coder! I dont know java code @ all.
Please try my suggestion and write back so i can look if its behaves like the jfrog 2.2 so you can stay on this and continue your more important work on full pca301 support.
Thanks!

Edit:
Your current version dont work on usb too.

Volker please revert your LGW changes, the pcaTest version works very good with this:

Thing jeelink:jeelinkUsb:lgwusb [ serialPort="/dev/ttyUSB02", initCommands="20000#2r;3,868950,5i" ]
Thing jeelink:lacrosse:46 "Thermometer Bad" (jeelink:jeelinkUsb:lgwusb) [ sensorId="46", updateInterval=5, sensorTimeout=60, bufferSize=0, minTemp=-40, maxTemp=60, maxDiff=0]
Thing jeelink:lacrosse:13 "Thermometer Balkon" (jeelink:jeelinkUsb:lgwusb) [ sensorId="13", updateInterval=5, sensorTimeout=60, bufferSize=0, minTemp=-40, maxTemp=60, maxDiff=0]
Thing jeelink:lacrosse:16 "Thermometer Kuehlschrank" (jeelink:jeelinkUsb:lgwusb) [ sensorId="16", updateInterval=5, sensorTimeout=60, bufferSize=0, minTemp=-40, maxTemp=60, maxDiff=0]
Thing jeelink:lacrosse:29 "Thermometer Schlafzimmer" (jeelink:jeelinkUsb:lgwusb) [ sensorId="29", updateInterval=5, sensorTimeout=60, bufferSize=0, minTemp=-40, maxTemp=60, maxDiff=0]
Thing jeelink:ec3k:5828 "PC Ecke" (jeelink:jeelinkUsb:lgwusb) [ sensorId="5828", updateInterval=0, sensorTimeout=60, bufferSize=0 ]
Thing jeelink:ec3k:591E "TV Ecke" (jeelink:jeelinkUsb:lgwusb) [ sensorId="591E", updateInterval=0, sensorTimeout=60, bufferSize=0 ]
Thing jeelink:ec3k:BC81 "TV Schlafzimmer" (jeelink:jeelinkUsb:lgwusb) [ sensorId="BC81", updateInterval=0, sensorTimeout=60, bufferSize=0 ]
Thing jeelink:ec3k:B0A7 "Technik Kueche" (jeelink:jeelinkUsb:lgwusb) [ sensorId="B0A7", updateInterval=0, sensorTimeout=60, bufferSize=0 ]

Now i try to get pca301 working…
Why have your pca301 example id’s 7 chars?
My sockets id’s having all 6 chars (230645 in decimal (standard) or 0384F5 in hex (LGW)).
Have you seen this old pca301 binding? https://github.com/ribbeck/openhab-binding-pca301
Maybe you can get some code from there.

Hi Volker,

thanks for your reply. I used the latest SNAPSHOT releases (they were from 20171202, 20171203 and 20171204). None of them worked. I thought i damaged something during my upgrade from 2.1 to 2.2, thats why I reinstalled everything yesterday night (redownloaded OpenHabian, reflashed, used UNSTABLE branch again). Result was:

Exact same (bad) behaviour of JeeLink PLUS this error: https://github.com/openhab/openhab-distro/issues/571

I guess I reinstall OpenHAB again tonight and use the Stable release.

Thank you very much anyway.

Best regards

Edit 20171207: Iam on OpenHAB 2.1 now and everything works like a charm.

Hey guys,

I’ve got the same problem with the 2.2 snapshot here. Stable 2.1 runs, but i needed to update to version 2.2 because of an error in the astro-binding (Astro not updating every day) in 2.1. Now it’s a clean installation of Debian 9 and Openhab.

==> /var/log/openhab2/events.log <==
2017-12-09 00:53:39.641 [thome.event.ExtensionEvent] - Extension 'binding-jeelink' has been installed.
2017-12-09 00:54:13.307 [hingStatusInfoChangedEvent] - 'jeelink:jeelinkUsb:acfdd6f5' changed from UNINITIALIZED to INITIALIZING

==> /var/log/openhab2/openhab.log <==
2017-12-09 00:54:13.307 [ERROR] [ore.thing.internal.ThingRegistryImpl] - Could not inform the ThingTracker 'org.eclipse.smarthome.core.thing.internal.ThingManager@6138fe5f' about the 'THING_ADDED' event!
java.lang.IllegalArgumentException: repeated interface: org.eclipse.smarthome.core.thing.binding.BridgeHandler
        at java.lang.reflect.Proxy$ProxyClassFactory.apply(Proxy.java:597) [?:?]
        at java.lang.reflect.Proxy$ProxyClassFactory.apply(Proxy.java:557) [?:?]
        at java.lang.reflect.WeakCache$Factory.get(WeakCache.java:230) [?:?]
        at java.lang.reflect.WeakCache.get(WeakCache.java:127) [?:?]
        at java.lang.reflect.Proxy.getProxyClass0(Proxy.java:419) [?:?]
        at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:719) [?:?]
        at org.eclipse.smarthome.core.internal.common.SafeCallerBuilderImpl.build(SafeCallerBuilderImpl.java:65) [109:org.eclipse.smarthome.core:0.9.0.201712011551]
        at org.eclipse.smarthome.core.thing.internal.ThingManager.doInitializeHandler(ThingManager.java:630) [116:org.eclipse.smarthome.core.thing:0.9.0.201712011551]
        at org.eclipse.smarthome.core.thing.internal.ThingManager.initializeHandler(ThingManager.java:557) [116:org.eclipse.smarthome.core.thing:0.9.0.201712011551]
        at org.eclipse.smarthome.core.thing.internal.ThingManager.registerAndInitializeHandler(ThingManager.java:914) [116:org.eclipse.smarthome.core.thing:0.9.0.201712011551]
        at org.eclipse.smarthome.core.thing.internal.ThingManager.thingAdded(ThingManager.java:370) [116:org.eclipse.smarthome.core.thing:0.9.0.201712011551]
        at org.eclipse.smarthome.core.thing.internal.ThingRegistryImpl.notifyTrackers(ThingRegistryImpl.java:213) [116:org.eclipse.smarthome.core.thing:0.9.0.201712011551]
        at org.eclipse.smarthome.core.thing.internal.ThingRegistryImpl.notifyListenersAboutAddedElement(ThingRegistryImpl.java:132) [116:org.eclipse.smarthome.core.thing:0.9.0.201712011551]
        at org.eclipse.smarthome.core.thing.internal.ThingRegistryImpl.notifyListenersAboutAddedElement(ThingRegistryImpl.java:1) [116:org.eclipse.smarthome.core.thing:0.9.0.201712011551]
        at org.eclipse.smarthome.core.common.registry.AbstractRegistry.added(AbstractRegistry.java:136) [109:org.eclipse.smarthome.core:0.9.0.201712011551]
        at org.eclipse.smarthome.core.common.registry.AbstractRegistry.added(AbstractRegistry.java:1) [109:org.eclipse.smarthome.core:0.9.0.201712011551]
        at org.eclipse.smarthome.core.common.registry.AbstractProvider.notifyListeners(AbstractProvider.java:56) [109:org.eclipse.smarthome.core:0.9.0.201712011551]
        at org.eclipse.smarthome.core.common.registry.AbstractProvider.notifyListeners(AbstractProvider.java:74) [109:org.eclipse.smarthome.core:0.9.0.201712011551]
        at org.eclipse.smarthome.core.common.registry.AbstractProvider.notifyListenersAboutAddedElement(AbstractProvider.java:78) [109:org.eclipse.smarthome.core:0.9.0.201712011551]
        at org.eclipse.smarthome.core.common.registry.AbstractManagedProvider.add(AbstractManagedProvider.java:64) [109:org.eclipse.smarthome.core:0.9.0.201712011551]
        at org.eclipse.smarthome.core.common.registry.AbstractRegistry.add(AbstractRegistry.java:210) [109:org.eclipse.smarthome.core:0.9.0.201712011551]
        at org.eclipse.smarthome.io.rest.core.internal.thing.ThingResource.create(ThingResource.java:213) [126:org.eclipse.smarthome.io.rest.core:0.9.0.201712011551]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
        at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81) [178:org.glassfish.jersey.core.jersey-server:2.22.2]
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144) [178:org.glassfish.jersey.core.jersey-server:2.22.2]
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161) [178:org.glassfish.jersey.core.jersey-server:2.22.2]
        at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:160) [178:org.glassfish.jersey.core.jersey-server:2.22.2]
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99) [178:org.glassfish.jersey.core.jersey-server:2.22.2]
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389) [178:org.glassfish.jersey.core.jersey-server:2.22.2]
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347) [178:org.glassfish.jersey.core.jersey-server:2.22.2]
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102) [178:org.glassfish.jersey.core.jersey-server:2.22.2]
        at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326) [178:org.glassfish.jersey.core.jersey-server:2.22.2]
        at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271) [177:org.glassfish.jersey.core.jersey-common:2.22.2]
        at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267) [177:org.glassfish.jersey.core.jersey-common:2.22.2]
        at org.glassfish.jersey.internal.Errors.process(Errors.java:315) [177:org.glassfish.jersey.core.jersey-common:2.22.2]
        at org.glassfish.jersey.internal.Errors.process(Errors.java:297) [177:org.glassfish.jersey.core.jersey-common:2.22.2]
        at org.glassfish.jersey.internal.Errors.process(Errors.java:267) [177:org.glassfish.jersey.core.jersey-common:2.22.2]
        at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317) [177:org.glassfish.jersey.core.jersey-common:2.22.2]
        at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305) [178:org.glassfish.jersey.core.jersey-server:2.22.2]
        at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154) [178:org.glassfish.jersey.core.jersey-server:2.22.2]
        at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473) [175:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2]
        at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427) [175:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2]
        at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388) [175:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2]
        at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341) [175:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2]
        at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228) [175:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2]
        at com.eclipsesource.jaxrs.publisher.internal.ServletContainerBridge.service(ServletContainerBridge.java:76) [15:com.eclipsesource.jaxrs.publisher:5.3.1.201602281253]
        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:848) [88:org.eclipse.jetty.servlet:9.3.22.v20171030]
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:584) [88:org.eclipse.jetty.servlet:9.3.22.v20171030]
        at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:71) [191:org.ops4j.pax.web.pax-web-jetty:6.0.7]
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) [87:org.eclipse.jetty.server:9.3.22.v20171030]
        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548) [85:org.eclipse.jetty.security:9.3.22.v20171030]
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226) [87:org.eclipse.jetty.server:9.3.22.v20171030]
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180) [87:org.eclipse.jetty.server:9.3.22.v20171030]
        at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:284) [191:org.ops4j.pax.web.pax-web-jetty:6.0.7]
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:512) [88:org.eclipse.jetty.servlet:9.3.22.v20171030]
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185) [87:org.eclipse.jetty.server:9.3.22.v20171030]
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112) [87:org.eclipse.jetty.server:9.3.22.v20171030]
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) [87:org.eclipse.jetty.server:9.3.22.v20171030]
        at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80) [191:org.ops4j.pax.web.pax-web-jetty:6.0.7]
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134) [87:org.eclipse.jetty.server:9.3.22.v20171030]
        at org.eclipse.jetty.server.Server.handle(Server.java:534) [87:org.eclipse.jetty.server:9.3.22.v20171030]
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:333) [87:org.eclipse.jetty.server:9.3.22.v20171030]
        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251) [87:org.eclipse.jetty.server:9.3.22.v20171030]
        at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:283) [79:org.eclipse.jetty.io:9.3.22.v20171030]
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:108) [79:org.eclipse.jetty.io:9.3.22.v20171030]
        at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93) [79:org.eclipse.jetty.io:9.3.22.v20171030]
        at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303) [90:org.eclipse.jetty.util:9.3.22.v20171030]
        at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148) [90:org.eclipse.jetty.util:9.3.22.v20171030]
        at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136) [90:org.eclipse.jetty.util:9.3.22.v20171030]
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671) [90:org.eclipse.jetty.util:9.3.22.v20171030]
        at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589) [90:org.eclipse.jetty.util:9.3.22.v20171030]
        at java.lang.Thread.run(Thread.java:748) [?:?]

Maybe it helps to sort out the issue.

Which build number of openHAB have you installed? From where did you take the binding jar? Did you use this one:
https://openhab.jfrog.io/openhab/libs-pullrequest-local/org/openhab/binding/org.openhab.binding.jeelink/2.2.0-SNAPSHOT/
?

If not, can you please check if this jar behaves identically to the one you have currently installed?

Edit: what exactly did you do when the exception was raised? Did you try to discover sensors, did you define the thing for the bridge, or did you just start the binding without having things defined?

Hey,

same issue here. Five weeks since installing OH 2.2.0 the Jeelink Bindings works fine. But after apt-get update/upgrade three days before it shows: “JeeLink USB Empfänger Status: INITIALIZING” Thing removal or uninstall/install of the Bindings in PaperUI does not help.

In PaperUI the configuration parameters / serial settings are shown: “/dev/ttyUSB0, /dev/ttyUSB0”. I think it was only one “/dev/ttyUSB0” before.

openhab2 version: (2.2.0~20171209104822-1), Binding installed with PaperUI (binding-jeelink - 2.2.0.SNAPSHOT) openhab.binding.jeelink:2.2.0.201712062218.

Thanks,

Tobias

Hi Volker,

i installed openhab with the snapshot ppa:
2.2.0.201712041513 │ openHAB Core

and the jeelink-binding by adding it to the addons.cfg
2.2.0.201712081653 │ JeeLink Binding

And your question what i’ve done:
I installed openhab, added the astro-binding (in addons.cfg) after that i added the jeelink-binding (as well through the addons.cfg):

2017-12-09 00:53:39.641 [thome.event.ExtensionEvent] - Extension 'binding-jeelink' has been installed.

Then I tried to set up the usb-receiver, put my /dev/ttyUSB0 in it and saved. On this moment the error was raised.

So from my point of view, the installation worked well, but the setup of the USB-bridge is broken. I rebooted the system, unplugged the USB-receiver, removed the thing, tried everything again and again. The error was always the same.

Michael

I have no idea what the problem is. I just updated openHAB and do now also have the same problem. I asked for help in another thread: Problems after upgrade to 2.2 (CircularReference, bindings no longer work)

Hi guys,

I can confirm that this is a bug on the framework side, I have created https://github.com/eclipse/smarthome/issues/4713 for it.

Latest distro #1130 should have the fix included - please retest and report back!

Binding is working again. Thanks.

I can confirm this, its working again.

Thanks guys.

Hey,

it’s working again… Thanks.

Hi Volker,

I see in the log sporadically (once per 30min) the following message:

11:18:21.180 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - ‘jeelink:jeelinkUsb:15d71c67’ changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): propagate: Underlying input stream returned zero bytes
11:18:21.180 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - ‘jeelink:lacrosse:52’ changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)

I am using the LaCrosse sketch and a Technoline TX 29 DTH-IT sensor which are actually working without any problems, but everytime the error occurs the things go offline and after a while online again.
I am using the latest snapshot on Windows 10.

Do you have any clue what is going wrong?

Thanks!

This sounds as if there is a problem reading from the stick. If the binding gets an exception reading from the stick, it closes the connection and reopens it 5 seconds later.

Is this a known issue? Is it possible to modify the error handling to simply suppress this kind of error?

You are the first one to report such a problem. And modifying the error handling would only hide a problem, as these exceptions should not occur on a normal installation.

I have updated the binding. It have added some bug fixes for pca301 and reworked the mechanism that detects which sensors are connected. So If you have pca301 sockets, test the new version:
https://github.com/vbier/openhab2-addons/blob/pca301/addons/binding/org.openhab.binding.jeelink/org.openhab.binding.jeelink-2.2.0-SNAPSHOT.jar