Hello!
I have an OH2beta4-online with modbus binding 1.9.0 running on latest raspbian jessie.
Hardware is Raspberry Pi 3 Model B connected via USART to a custom AVR-based home controller.
Controller has some discrete inputs, coils and holding registers.
As for discretes and coils there are no problems, everything’s working like a charm.
But with holding registers I have an issue that items associated with registers do not change when registers are changed. They change only when I send commands to these registers via UI / script / rule but not when controller itself changes them.
I have traced logs and I see that modbus binding receives these updated values but does not generate any events (but does so for discrete and coil items):
18:56:51.090 [DEBUG] [t.wimpi.modbus.io.ModbusRTUTransport] - Sent: 01 03 00 00 00 3d 84 1b
18:56:51.091 [TRACE] [t.wimpi.modbus.io.ModbusRTUTransport] - Managed to read at least one byte
18:56:51.216 [DEBUG] [t.wimpi.modbus.io.ModbusRTUTransport] - Response: 01 03 7a 00 01 00 04 …
…
18:56:56.509 [DEBUG] [t.wimpi.modbus.io.ModbusRTUTransport] - Sent: 01 03 00 00 00 3d 84 1b
18:56:56.510 [TRACE] [t.wimpi.modbus.io.ModbusRTUTransport] - Managed to read at least one byte
18:56:56.637 [DEBUG] [t.wimpi.modbus.io.ModbusRTUTransport] - Response: 01 03 7a 00 02 00 04 …
Take a look at the response: 01 is slave address, 03 - “read holding registers” function, 7a - number of bytes to follow, and the next two bytes are the value of the first holding register. In the first response it is 00 01 and in the second it’s 00 02 which means there was a change but I cannot see this neither from UI (old value there), nor from events.log.
This issue takes place for all holding registers.
I have tried updateunchangeditems=true with no luck.
Here is my modbus.config:
serial.coils.connection=/dev/ttyS0:9600:8:none:1:rtu:35:500:none:none
serial.discrete.connection=/dev/ttyS0:9600:8:none:1:rtu:35:1500:none:none
serial.holding.connection=/dev/ttyS0:9600:8:none:1:rtu:35:1500:none:none
serial.mcu2.connection=/dev/ttyS0:9600:8:none:1:rtu:35:500:none:none
serial.coils.type=coil
serial.discrete.type=discrete
serial.holding.type=holding
serial.mcu2.type=coil
serial.mcu2.id=2
serial.coils.length=18
serial.discrete.length=13
serial.holding.length=61
serial.mcu2.length=8
serial.coils.valuetype=bit
serial.discrete.valuetype=bit
serial.holding.valuetype=uint16
serial.mcu2.valuetype=bit
serial.holding.updateunchangeditems=true
Thanks in advance!