Jeelink stops receiving readings

I am very happy with the jeelink binding when it works, but after some time, days or weeks, it simply stops receiving messages. Rebooting the server starts up the readings again, so I don’t think it is related to the sensors. I am running org.openhab.binding.jeelink-2.3.0-20180113.094132-24.jar. I have set the logging to DEBUG, but it doesn’t contain anything useful. The last entry:

2018-02-25 17:22:12.068 [DEBUG] [sse.LaCrosseTemperatureSensorHandler] - updating states for thing LaCrosse Temperature Sensor (12): temp=19.8 (19.840244), humidity=48, batteryNew=false, batteryLow=false
1 Like

You are the second user that reports this problem, and I have seen this myself for the first time last week. Doors that happen regularly for you? If yes, I could add some logging to the binding and you could try to reproduce.

When the problem occurs, try to edit the stick thing in paper ui and see if it starts working again.

I enabled TRACE logging and rebootet, and it has not happened yet, but it has happened for me multiple times. It would be great with a version with additional logging.

Can you install this jar please and reduce logging to INFO:
https://github.com/vbier/openhab2-addons/raw/testjar/addons/binding/org.openhab.binding.jeelink/org.openhab.binding.jeelink-2.3.0-SNAPSHOT.jar

See if you have an error message in the log once the sensors go offline.

Edit: is your stick connected via USB or TCP?

I have set logging to INFO and copied the .jar to the addons directory and deleted the one that was already there, and rebooted. That should do it, right? My jeelink stick is connected via USB on a raspberry pi 3.

Yes, that should be everything that is needed. Now we only need to wait and hope we see something in the log.

Is it possible that the sensors went offline shortly after you have edited the stick configuration?

No, I don’t think it is related to the change of settings. It didn’t happen until days after and it also happened after reboot without having changed settings. It has not happened yet with the new version, but I had a few spurious readings. Is the fix of large deltas not part of this build?

Looks like i added the debug statements to an older version. I just updated my workspace and added the debug statements again: https://github.com/vbier/openhab2-addons/raw/addDebug/addons/binding/org.openhab.binding.jeelink/org.openhab.binding.jeelink-2.3.0-SNAPSHOT.jar

Everything has been working so far, which could be seen as a good thing :slight_smile: I have just installed your new build and rebooted, so now it’s back to waiting.

@vbier Thanks for the binding and your support!

I’m experincing the same problems with the jeelink binding (I’m using the snapshot linked in the topic). After a few days the binding stops receiving data from my sensors.

There are no special messages in the openhab logs. What log level settings need to be type in the openhab console in order to change to the required log level?

INFO level should be sufficient if you use the binding jar from this thread. I am pretty sure that I added exception handlers to every code branch with logging output. There should be some message in the logs, if not, then it looks like the serial port library has some bug. I will look into the binding code once again to make sure.

The openHABian default log level for the package org.openhab was already INFO. Currently the jar linked in this topic is installed. I added a rule for the subpackage org.openhab.binding.jeelink with the level DEBUG. Now I am getting much more log messages from the JeeLink binding. Let’s see what will be logged when the binding stopps receiving data again in the next days.

More over I tried to sniff the serial data in order to see whether there are still messages from my JeeLink to openHAB. But I didn’t get it working with socat. The newly created virtual serial device /dev/ttyV0 was not shown in the thing configuration of the JeeLink USB receiver as serial interface option. A name change of the virtual serial (e.g. /dev/ttyUSB1) didn’t help either. Thus I cannot confirm I the data streams still to openHAB and have no evidence for a bug in the serial library. The used socat command was e.g.:

sudo socat /dev/ttyUSB0,raw,echo=0 SYSTEM:'tee /tmp/ttyUSB0_input.txt | socat - "PTY,link=/dev/ttyUSB1,raw,echo=0,waitslave" | tee /tmp/ttyUSB0_output.txt'

Another information: The JeeLink (or even my raspi) doesn’t need to be reset in order to get things working again. It’s suffcient to restart the openhab service. Then the data from my sensors are received properly.

I have also tried to monitor the serial port traffic, but to no avail. I have therefore added log messages to all exception handlers, the open and close methods and the method that gets called by the serial library when new data is available. This is why I hoped to see anything useful next time the problem occurs.

I would expect it is sufficient to edit the thing for the stick in the paper UI in order to get readings again, instead of restarting openHAB (or to restart the bundle in the openHAB console).

Now I have encountered a stop of the service, but I also cannot see anything from the logs.
events.log:

2018-04-02 19:59:35.985 [vent.ItemStateChangedEvent] - Temperature_2 changed from 18.9 to 19.0
2018-04-02 20:02:28.237 [hingStatusInfoChangedEvent] - 'jeelink:lacrosse:56' changed from ONLINE to OFFLINE
2018-04-02 20:02:34.121 [hingStatusInfoChangedEvent] - 'jeelink:lacrosse:12' changed from ONLINE to OFFLINE

openhab.log:

2018-04-02 19:59:25.922 [DEBUG] [ocol.ZWaveController$ZWaveSendThread] - NODE 2: Response processed after 121ms/4913ms.
2018-04-02 20:23:09.999 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 2: Polling...

If there are no messages in the log, I am pretty confident that the binding is working as it should, but it simply does not get any readings. This could be caused by the serial library, but I am no longer convinced that this is the culprit, as I also use it in my Elero Transmitter Stick binding and it works there as it should.

According to some posts in the JeeLabs and FHEM forum this could be caused by glitchy USB power on the port, or a USB cable that is too long. Could any of this be the reason for your problems?

I guess I could add some code to the binding that checks if any readings are received in a certain time frame and that then reconnects if not.

I experience the same problems with a Jeelink connected to a raspberry pi 3. the stick ist directly connected to the raspberry pi. A reboot fixes the problem, but not always. Sometimes I need to reboot 2 or 3 times until its working again. It happens every 2-3 weeks (I’m using it since last christmas)

Update: Ah and I forgot. Sometimes all sensors stop working and sometimes only one. (3 are connected). I don’t know if its always the same that stops if only one stops working.

This seem to be two different things. The already mentioned problem is that all sensors go offline because the binding can no longer read anything from the serial port. As I have written before, I believe that this is caused by the stick no longer writing anything to the port. The question is how to verify this…

If you have to restart several times than this looks even more like a hardware problem. A single restart should always be sufficient from SW point of view, as all resources are freed on shutdown.

When only one sensor goes offline, the binding still reads data from the port. If you have this case enable TRACE logging and check if you get data from the sensor that is offline. I would expect that this is not the case, as from the binding code it should be that if one sensor works, all sensors work. A single sensor has no specific handling thread that could die, but all sensors are handled by the same thread.

I have the same problem with my jeelink-raspi combination. I faced the issue 2 years ago, when I was running the jeelink with a old raspi 1 and a self written python script. The last two years it runs with a rpi3 without any problems (on an old 1000mA power supply). Two weeks ago I set up my openhab system completely new on a different rpi3 (with a cheap 2000mA power supply) and connected the jeelink to this one. Since then the jeelink stops working again after some time.

This brings me to a similar conclusion that volker: This issue is caused by the raspi or the power supply.

This assumption is supported by the fact, that the blue jeelink led is no longer blinking when the items are offline. The jeelink is therefore no longer writing any readings to the serial port or is not receiving any values.

I will check this weekend, if the issue occurs with the old power supply.

1 Like

I have a small usb cable extender between the jeelink and the raspberry pi, as this is suggested in the jeelink manual to get better receiving. It does sound plausible that a power issue causes it to disconnect, but if it fits with in the binding, I would appreciate a reconnect when all sensors go offline. It seems the detection is already in place.