Check slave on Modbus network

Hi.
How can I check if a Modbus slave is online or I have lost the connection with it?
Something like network health but using Modbus
Thanks in advance.

If you are using Modbus binding 1.x, and the slave includes any polled (read) Items, and you have postundefinedonreaderror set true in the binding config - you should be able to write a rule triggered on any one Item state changing from a valid value to Undefined to detect a device failure.

If you move to binding 2.x, you should be able to detect a Thing going offline as an event, in theory.

Hi
My system is based on OH2.
I’m not using Things. All the configuration is made with Services and Items.
Am I doing it wrong? It is working right now.
Thanks.

modbus.items

Number Temperature "Temperature [%.1f ºC]" <temperature>  {modbus="slave1:0"}
Switch Rele "Estado" <switch> {modbus="slave1:1"}
Number pin3 "pir1 [%.1f]" <shield>  {modbus="slave1:2"}

Modbus.cfg

poll=1000
serial.slave1.connection=/dev/ttyUSB0:115200:8:none:1:rtu:35:1500:none:none
serial.slave1.type=holding
serial.slave1.id=1
serial.slave1.start=0
serial.slave1.length=3

I’m searching into documentation but can’t find information about Modbus and Things.

I’ve got no idea about how to check if a Modbus slave is online.
Can you help me friends?
Thanks

Hi
I’m still looking for a solution for this issue.
Any tip?
Thanks

Are you now using Modbus binding 1.x or 2.x?
For this job, it will be worth your while moving to version 2 if you haven’t already. It will mean a bit of work.

Hi rossko57.
Thanks for your interest.
I’m using OH2 and config files shown above.
I’m checking witch version of Modbus binding I’m using.

From openhab.log…
186:org.openhab.binding.modbus:1.10.0
How can I upgrade to 2.x?

How can I move from Modbus binding 1.x to 2.x?
Please, help, I can’t find how to do it
Thanks