Mysensors 3.1 serial binding stops working

Hi,
Not sure of the best place to post this sorry…? …

However, i upgraded to OH3 and installed the mysensors 3.1.0 binding, for a serial connection. My Arduino gateway has mysensors 2.3.2 installed.

Everything seems to work well or a while, and then at random times the connection is lost and i have to reboot the server.

The linux command line shows the error message:
“usb 2-3: failed to send control message: -110”

and the openhab.log shows the message below:-

What is the best way to troubleshoot this? I can get anything between 5 minutes and an hour before the problem occurs and i have to reboot.

Many thanks
Keith

[WARN ] [rsAbstractConnection$MySensorsReader] - Exception on reading from connection
java.text.ParseException: class java.text.ParseException : Message length is not > 4
at org.openhab.binding.mysensors.internal.protocol.message.MySensorsMessage.parse(MySensorsMessage.java:346) ~[bundleFile:?]
at org.openhab.binding.mysensors.internal.protocol.MySensorsAbstractConnection$MySensorsReader.run(MySensorsAbstractConnection.java:342) [bundleFile:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
at java.lang.Thread.run(Thread.java:834) [?:?]

Serial errors are not too alarming of themselves, and there is usually a retry capability.
Are there further logs after your original error? What does your serial Bridge Thing say in the UI? What happens if you disable/re-enable it after an error?

The bridge shows as ‘Offline’ in the UI (after the issue is triggered), and when I disable it and then re-enable it, it stays stuck on ‘initializing’. And the last entry in the log file stays as…

‘mysensors:bridge-ser:9e527ea8ae’ changed from UNINITIALIZED (DISABLED) to INITIALIZING.

For testing, I created a rule that plays a sound when the status of the gateway changes, and didn’t realise its going off and online randomly, until eventually it goes off until a reboot.

The the first entry in events.log that indicates a problem is :

Thing ‘mysensors:temperature:9e527ea8ae:temperature_1_5’ changed from ONLINE to OFFLINE (COMMUNICATION_ERROR)

Then there is a similar entry corresponding to each mysensors childID.

However, after these entries, the bridge seems to re-connect and the sound plays to confirm this.

In openhab.log i get the following entries repeatedly,…

2021-03-25 22:56:10.791 [WARN ] [rsAbstractConnection$MySensorsReader] - Exception on reading from connection
java.text.ParseException: class java.text.ParseException : Message length is not > 4
at org.openhab.binding.mysensors.internal.protocol.message.MySensorsMessage.parse(MySensorsMessage.java:346) ~[bundleFile:?]
at org.openhab.binding.mysensors.internal.protocol.MySensorsAbstractConnection$MySensorsReader.run(MySensorsAbstractConnection.java:342) [bundleFile:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
at java.lang.Thread.run(Thread.java:834) [?:?]

but occasionally it also has

2021-03-25 22:49:15.776 [INFO ] [col.serial.MySensorsSerialConnection] - Connection request disconnection…
2021-03-25 22:49:15.776 [WARN ] [rsAbstractConnection$MySensorsWriter] - Interrupted MySensorsWriter
2021-03-25 22:49:15.777 [WARN ] [rsAbstractConnection$MySensorsReader] - Interrupted MySensorsReader
2021-03-25 22:49:19.114 [WARN ] [col.serial.MySensorsSerialConnection] - Skipping I_VERSION connection test, not recommended…
2021-03-25 22:49:19.134 [INFO ] [col.serial.MySensorsSerialConnection] - Successfully connected to MySensors Bridge.
2021-03-25 22:49:20.351 [WARN ] [rs.internal.gateway.MySensorsGateway] - Presented child is alredy present in gateway
2021-03-25 22:49:20.363 [WARN ] [rsAbstractConnection$MySensorsReader] - Exception on reading from connection

Im not sure what to do next, can i increase the log levels?

update:
i turned a node off (which was sending frequent updates) and noticed that the bridge wasn’t disconnecting as often.

I left a single node on, which sends a message each time a button is pressed. If i press the button too quickly then the bridge disconnects and re-connects; (however I’ve not had a single instance with the message “usb 2-3: failed to send control message: -110”)

If i don’t press a button, the bridge stays online. That is until the node sends its 5minute temperature update - and then i the bridge is disconnected again.

The issue seems to be compounded with the frequency of messages: low frequency avoids the Linux error “usb 2-3: failed to send control message: -110”, however even a single update form a node causes the bridge to disconnect briefly

I’m not sure that will reveal much more.
Message length is not > 4
seems fairly explicit. The message may get truncated because it’s had an transmission error.

Now that you’ve discovered there is a fairly constant error/retry process going on, it goes a way to explain the eventual “total death”. Users of other bindings have noted that the current underlying serial transport is bit prone to lock up with repeated disconnect/reconnect.

Ahh…i found the following post which seems to have solved the problem - at least so far.

Openhab resets serial connection with my gateway every couple seconds - #5 by pawlo999

I disabled debug messages on the gateway, and so far the total death has not occurred :slight_smile: .

However there is still some kind of issue with random dropouts, where the bridge stays online but the nodes appear to be lost… the log entry reflecting this is …

2021-03-26 07:54:05.468 [DEBUG] [rs.internal.gateway.MySensorsGateway] - Node 102 found in gateway
2021-03-26 07:54:05.468 [DEBUG] [rs.internal.gateway.MySensorsGateway] - Child 4 not present in node 102

I tend to update linux often, and as part of that process i seemed to have take a step back with this issue and lost serial connection again. I’ve decided to change to an mqtt ethernet gateway which i’m under the impression may be a better solution than using the binding.

update: the MQTT ethernet gateway has worked solidly since setting it up