Modbus Binding OH2

Hi
I’m trying to implement the modbus binding in OH2, I have don it before and it was working great.

For some reason I manage to write a wrong IP in the config file, I tried to change it back but the IP address was stuck. I also changed the modbus slave name from slave to slave1. Of course this name change got stuck too. I have tried to uninstall the binding several times from Paper UI and deleted it from the services folder, but no luck. Does anyone have I clue whats wrong?

I hope some of you have an idea of whats wrong.

This is what my log file show.

2016-09-30 00:13:05.763 [WARN ] [.binding.modbus.internal.ModbusSlave] - ModbusSlave (slave2) not connected – aborting read request net.wimpi.modbus.msg.ReadMultipleRegistersRequest@12b8a869. Endpoint ModbusTCPSlaveEndpoint@31baf354[address=192.168.0.140,port=502]
2016-09-30 00:13:05.769 [ERROR] [.binding.modbus.internal.ModbusSlave] - ModbusSlave (slave): Error getting modbus data for request net.wimpi.modbus.msg.ReadMultipleRegistersRequest@6a07102e. Error: Error Code = 2. Endpoint ModbusTCPSlaveEndpoint@2c2e9802[address=192.168.0.107,port=502]. Connection: TCPMasterConnection@55cecbcd[socket=Socket[addr=/192.168.0.107,port=502,localport=58086]]
2016-09-30 00:13:05.830 [ERROR] [.binding.modbus.internal.ModbusSlave] - ModbusSlave (slave1): Error getting modbus data for request net.wimpi.modbus.msg.ReadMultipleRegistersRequest@2d974ac7. Error: Error Code = 2. Endpoint ModbusTCPSlaveEndpoint@29f4063d[address=192.168.0.107,port=502]. Connection: TCPMasterConnection@ea4687d[socket=Socket[addr=/192.168.0.107,port=502,localport=58087]]
2016-09-30 00:13:28.336 [ERROR] [ing.ModbusSlaveConnectionFactoryImpl] - connect try 1/3 error: Connection timed out: connect. Connection TCPMasterConnection@6517b846[socket=]. Endpoint ModbusTCPSlaveEndpoint@31baf354[address=192.168.0.140,port=502]:

1 Like

Hey!
Unfortunatley, I cannot help you. But I like to thank you for your work.

Without modbus I cannot use openHAB for my purposes. Espessially the use case of rollershutter is of my interest (see this: Modbus binding of rollershutter).

Thanks for your work!

Helmut

Hi,

I have same error:

2016-11-20 19:19:44.760 [ERROR] [.binding.modbus.internal.ModbusSlave] - ModbusSlave (slave181): Error getting modbus data for request net.wimpi.modbus.msg.ReadMultipleRegistersRequest@113f12a. Error: Error Code = 2. Endpoint ModbusTCPSlaveEndpoint@100f627[address=192.168.1.198,port=502]. Connection: TCPMasterConnection@1dee83f[socket=Socket[addr=/192.168.1.198,port=502,localport=58950]]
2016-11-20 19:20:00.390 [ERROR] [.binding.modbus.internal.ModbusSlave] - ModbusSlave (slave181): Error getting modbus data for request net.wimpi.modbus.msg.ReadMultipleRegistersRequest@7ccdb. Error: Error Code = 2. Endpoint ModbusTCPSlaveEndpoint@100f627[address=192.168.1.198,port=502]. Connection: TCPMasterConnection@c658ac[socket=Socket[addr=/192.168.1.198,port=502,localport=59594]]

I have removed Slave181 from *.items-file and openhab.cfg. But still it wants to read slave181 and the error appears in the openhab.log-file.

I have restarted OH2, no change.

It seems like the info of the modbus-binding is copied somewhere else and not in these files i have imported from OH1 installation…?

At the same time I have added slaves to openhab.cfg and added them in my *.items file, and the new items work.

So, how does this work??

Hello!

I had the same problem and solved it by reinstalling OS :smiley:

But later I noticed the directory/var/lib/openhab2/cache/org.eclipse.osgi/7/data/config/org/openhab and the modbus.config file inside it. You might consider taking a look at it, maybe it has your old configuration.