Openhabian, modbus watt reader stop reading after some times

  • Platform information:
    • Hardware: Raspberri Pi 3 B,
    • OS: Openhabian Linux 4.19.66-v7+
    • Java Runtime Environment: openjdk version “1.8.0_265”
    • openHAB version: Openhab 2.5.7-1
  • Issue of the topic: I Have a a SDM120 Wattage power reader connected via Modbus to a USB Modbus transcriver. After some times it stops updating values.

I use influxdb on a dedicated VM as persistence database.
I’ve noticed yesterday from the graphs that Voltage, Watt and Ampere were all flat lines. After some investigation from logs i’ve noticed that values are never readed. No new ItemStateChangedEvent are registred.

Restarting the Pi resolve the situation for a while, sometimes it stops working again after 15 minutes, some times after 4 hours.
When this problem happen, in PaperUI a have all the modbus things (I.e. Modbus Serial Slave items, Regular Poll Items and Modbus Date items) online, no one show some kind of error.

Here the Openhab.log entries i think are relevant:
2020-08-20 00:42:41.452 [WARN ] [rt.modbus.internal.ModbusManagerImpl] - Try 1 out of 3 failed
when executing request

 (ModbusPollerThingHandler.ModbusPollerReadRequest@1bacbc8[slaveId=1,functionCode=READ_INPUT_REGISTERS,start=0,length=2,maxTries=3]). Will try again soon. Error was I/O error, so reseting the connection. Error details: net.wimpi.modbus.ModbusIOException I/O exception: IOException Error reading response (EOF) [operation ID 142aea11-1db8-44c6-93d5-53427a935a3f]
2020-08-20 00:42:41.528 [WARN ] [rt.modbus.internal.ModbusManagerImpl] - Error invalidating connection in pool for endpoint ModbusSerialSlaveEndpoint@14bd952[portName=/dev/ttyUSB-modbus]. Error was: java.lang.NullPointerException null
java.lang.NullPointerException: null
	at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:936) ~[?:1.8.0_265]
	at org.openhab.io.transport.modbus.internal.pooling.ModbusSlaveConnectionFactoryImpl$PooledConnection.maybeResetConnection(ModbusSlaveConnectionFactoryImpl.java:87) ~[?:?]

The strange thing is that after that entry i start seeing errors from EnOcean Plugin, error that i haven’t seen before:

2020-08-20 00:43:10.979 [WARN ] [rnal.handler.EnOceanBaseThingHandler] - Exception while 
sending telegram!
java.lang.IllegalArgumentException: Command REFRESH of channel repeaterMode(repeaterMode) 
is not supported
at org.openhab.binding.enocean.internal.eep.EEP.convertFromCommand(EEP.java:79) ~[?:?]

Any hint?
I’m also trying to restore the backup from amanda one week before the error started on a fresh sd card (sd card inside the Raspi is pretty new, 6 month and a decent brand, Samsung EVO 32GB)

Set the log to DEBUG or TRACE, for the binding, via the console too see if you get any additional info that may help.

1 Like

There is a issue with the modbus 2.5.7 binding… Look for updates here on the community in the past 1-2 weeks. You need to get the 2.5.8 fix.

3 Likes

Thank you! i missed that, i’ll try! I thought i broke something :slight_smile:

1 Like

Ok i’ve confirmed the solutions seems to work,
i’ve only a problem that i get only one Modbus item in karaf console:
openhab> bundle:list -s |grep modbus
270 x Active x 80 x 2.5.8.202008220359 x org.openhab.binding.modbus

Instead having 3 as the guide said:
openhab> bundle:list -s |grep modbus
203 │ Installed │ 80 │ 2.5.8.202008131350 │ org.openhab.io.transport.modbus
204 │ Installed │ 80 │ 2.5.8.202008131401 │ org.openhab.binding.modbus.sunspec
205 │ Installed │ 80 │ 2.5.8.202008131350 │ org.openhab.binding.modbus

but seems to operating fine: i get the data into influxdb

Cant help you on that one… I think @ssalonen may be a better help.
But on the other hand, if it works, then maybe thats how its suppose to be :smiley:

Odd… :sweat_smile: there should be the bundles corresponding to kar files you installed following the instructions.

I’ve tried to reboot and i have the same only one line.
I’ve tried to remove org.openhab.io.transport.modbus-2.5.8-SNAPSHOT.jar from the addons folder and suddenly all my modbus things break (going to UNINITIALIZED (HANDLER_MISSING_ERROR state)

Then i readded the jar files, it get installed again and now is back in the karaf console.
strange!

1 Like

Openhab 2.5.8 is now released, including the fixes discussed here

2 Likes