Jeelink stops receiving readings

The next time you have the problem, can you please check if a bundle:restart in the openHAB console makes the binding work again? If the stick has hung up, it might not help to add an automatic reconnect.

Will do.

It happened for me again and I tried a bundle:restart of the JeeLink binding. That worked and I started receiving updates again.

openhab.log:

2018-05-12 21:53:43.781 [INFO ] [l.connection.JeeLinkSerialConnection] - Closing serial connection to port /dev/ttyUSB0...
2018-05-12 21:53:44.120 [INFO ] [l.connection.JeeLinkSerialConnection] - Opening serial connection to port /dev/ttyUSB0 with baud rate 57600...

events.log:

2018-05-12 21:53:43.734 [hingStatusInfoChangedEvent] - 'jeelink:lacrosse:12' changed from OFFLINE to UNINITIALIZED
2018-05-12 21:53:43.771 [hingStatusInfoChangedEvent] - 'jeelink:lacrosse:12' changed from UNINITIALIZED to UNINITIALIZED (HANDLER_MISSING_ERROR)
2018-05-12 21:53:43.774 [hingStatusInfoChangedEvent] - 'jeelink:lacrosse:56' changed from OFFLINE to UNINITIALIZED
2018-05-12 21:53:43.781 [hingStatusInfoChangedEvent] - 'jeelink:lacrosse:56' changed from UNINITIALIZED to UNINITIALIZED (HANDLER_MISSING_ERROR)
2018-05-12 21:53:43.787 [hingStatusInfoChangedEvent] - 'jeelink:jeelinkUsb:4689aba5' changed from ONLINE to UNINITIALIZED
2018-05-12 21:53:43.846 [hingStatusInfoChangedEvent] - 'jeelink:jeelinkUsb:4689aba5' changed from UNINITIALIZED to OFFLINE
2018-05-12 21:53:43.861 [hingStatusInfoChangedEvent] - 'jeelink:jeelinkUsb:4689aba5' changed from OFFLINE to UNINITIALIZED (HANDLER_MISSING_ERROR)
2018-05-12 21:53:44.116 [hingStatusInfoChangedEvent] - 'jeelink:jeelinkUsb:4689aba5' changed from UNINITIALIZED (HANDLER_MISSING_ERROR) to INITIALIZING
2018-05-12 21:53:44.146 [hingStatusInfoChangedEvent] - 'jeelink:jeelinkUsb:4689aba5' changed from INITIALIZING to ONLINE
2018-05-12 21:53:44.169 [hingStatusInfoChangedEvent] - 'jeelink:lacrosse:12' changed from INITIALIZING to UNKNOWN
2018-05-12 21:53:44.171 [hingStatusInfoChangedEvent] - 'jeelink:lacrosse:12' changed from UNINITIALIZED (HANDLER_MISSING_ERROR) to INITIALIZING
2018-05-12 21:53:44.173 [hingStatusInfoChangedEvent] - 'jeelink:lacrosse:56' changed from INITIALIZING to UNKNOWN
2018-05-12 21:53:44.179 [hingStatusInfoChangedEvent] - 'jeelink:lacrosse:56' changed from UNINITIALIZED (HANDLER_MISSING_ERROR) to INITIALIZING
2018-05-12 21:53:48.221 [hingStatusInfoChangedEvent] - 'jeelink:lacrosse:56' changed from UNKNOWN to ONLINE
2018-05-12 21:53:48.255 [me.event.ThingUpdatedEvent] - Thing 'jeelink:lacrosse:56' has been updated.
2018-05-12 21:53:49.303 [hingStatusInfoChangedEvent] - 'jeelink:lacrosse:12' changed from UNKNOWN to ONLINE
2018-05-12 21:53:49.318 [me.event.ThingUpdatedEvent] - Thing 'jeelink:lacrosse:12' has been updated.
2018-05-12 21:53:53.233 [vent.ItemStateChangedEvent] - Temperature_1 changed from 23.1 to 21.8
2018-05-12 21:53:53.242 [vent.ItemStateChangedEvent] - Humidity_1 changed from 50 to 49
2018-05-12 21:53:54.314 [vent.ItemStateChangedEvent] - Temperature_2 changed from 23.0 to 18.9
2018-05-12 21:53:54.336 [vent.ItemStateChangedEvent] - Humidity_2 changed from 52 to 55

I will add some code that monitors sensor state and reconnects to the jeelink once all sensors are offline as soon as I have the time.

Edit: here is a binding jar you can test: https://github.com/vbier/openhab2-addons/raw/test/addons/binding/org.openhab.binding.jeelink/org.openhab.binding.jeelink-2.3.0-SNAPSHOT.jar

It should try to reconnect when there have been no readings for 5 minutes.

My pull request with other changes got approved, so I rebased the changes on current master and updated the jar file.

I just had some doubts if the chosen approach is good. Instead on relying on whether readings have been read in a certain time frame, I am thinking about writing something to the stick instead and checking if there is a response. The question is only if the stick does answer even though it does not receive any readings or if it is completely blocked.

I would need somebody that has the problem and is willing to test. Anybody?

I will be happy to test, although, as is evident, I am not the most responsive user. I am not relying on my automation setup too much yet, so I can handle failures once in a while.

Any news? Have you seen the stick going offline and online again during the last time?

No news. I recently upgraded to 2.3, and reinstalled your .jar just now.

The readings stopped for me, and the binding did not reset for me. There is nothing in the openhab.log.
Events.log:

2018-06-21 04:01:14.055 [vent.ItemStateChangedEvent] - Temperature_1 changed from 23.1 to 23.0
2018-06-21 04:17:25.469 [hingStatusInfoChangedEvent] - 'jeelink:lacrosse:56' changed from ONLINE to OFFLINE
2018-06-21 04:17:26.477 [hingStatusInfoChangedEvent] - 'jeelink:lacrosse:12' changed from ONLINE to OFFLINE

I checked the logging level of jeelink which was INFO. I then did a bundle:restart of the jeelink, and that made it come back up.

Are you sure you only have the patched version of the binding installed? Please set it to debug. If sensors go offline, you should see something like:

Monitoring job for port /dev/ttyUSB0 detected missing readings. Triggering reconnect…

I noticed with a bundle:list the jeelink was called org.openhab.bindings.jeelink2018… which I interpreted as a custom built version. I did uninstall everything first. Unfortunately, I think my SD card just failed, so I need a few days to get everything up and running. Why is it that you can do a headless install of everything but after a checkdisk it goes to “Emergency mode” without ssh? That’s annoying (and another topic, I know).

Just want to let you know that I got the system up and running in a few days, but nothing has happened since. I searched the logs for “missing” but found nothing.

Did you see the “Monitoring job started.” message? If not please turn on debug, restart the jeelink bundle and check if your get the message. Just to make sure you have the correct version of the binding installed.

Debugging is turned on, but I could not find the message. I restarted the bundle and it appeared, so maybe I set it to DEBUG and haven’t restarted since. But I guess it should be the right version.

2018-07-15 14:55:29.551 [DEBUG] [ding.jeelink.internal.JeeLinkHandler] - Monitoring job started.

Any news?

No news. I just searched the logs for “missing” again and nothing relevant comes up. Also, I checked the persisted timestamp. I have it reporting every ten seconds, and the max period is 14 seconds, so I just don’t think it has happened.

As mentioned before I am facing the same issue every 2 or 3 weeks. At this moment my jeelink is in the error state, all items are offline.
bundle:restart works for me, but I would be able to support your development, if it is still needed.

Should I try something in this error state?

I am running JeeLink Binding 2.3.0.201804042202

No. You can Install the jar i linked above and see if this fixes your problems.