Hi!
I’m qiute new about OpenHAB world and this is my first post in this community.
I’ve installed openHABian v1.6.2 with Stable 3.0.0 version into a RaspberryPi4, 1GB RAM, 64GB SDXC.
I had already had a first approach with an old notebook with Ubuntu 20.04 and OpenHAB 2.5.5-1 and the same problems described below already occurred.
I’m trying to polling some (4 or more) modbus RTU devices with some (256 contacts and 30 analogs) registers to read.
At the beginning I’ve try to configure the *.things
files for each slave like this:
Bridge modbus:serial:Scheda_IN_01 [port="/dev/ttyUSB0",baud=38400,id=1,dataBits=8,parity="none",stopBits="1.0",encoding="rtu",timeBetweenTransactionsMillis="0",updateUnchangedValuesEveryMillis="1000000" ] {
Bridge poller S1_Digital_IN [ start=16, length=256, refresh=20, type="coil" ] {
Thing data di_R_1 [ readStart="16", readValueType="bit", writeStart="16", writeValueType="bit", writeType="coil" ]
Thing data di_R_2 [ readStart="17", readValueType="bit", writeStart="17", writeValueType="bit", writeType="coil" ]
...
...
Thing data di_R_256 [ readStart="273", readValueType="bit", writeStart="273", writeValueType="bit", writeType="coil" ]
}
Bridge poller S1_Analog [ start=300, length=30, refresh=20, type="holding"] {
Thing data A_IN_1 [ readStart="300", readValueType="int16", readTransform="JS(analog_to_percent.js)" ]
Thing data A_IN_2 [ readStart="301", readValueType="int16", readTransform="JS(analog_to_percent.js)" ]
...
...
Thing data A_IN_30 [ readStart="330", readValueType="int16", readTransform="JS(analog_to_percent.js)" ]
}
}
but polling is too slow for my application (140-150 ms between the end of the slave response and the start of the master’s query) and also it stopped after less than 20 minutes, apparently without any logs errors.
I’ve try to change refresh
,timeBetweenTransactionsMillis
and set updateUnchangedValuesEveryMillis
but nothing has changed.
I thought at the design of Modbus protocol limits around 120 registers in one poll (though 256 contacts are 16 registers and they are less than 120 registers), so i split the poll into 2 sections… but nothing has changed.
After reading several posts about modbus related issues, I’ve decided to install mbusd (Modbus TCP to Modbus RTU gateway) https://github.com/3cky/mbusd and replace the:
Bridge modbus:serial:Scheda_IN_01 [port="/dev/ttyUSB0",baud=38400,id=1,dataBits=8,parity="none",stopBits="1.0",encoding="rtu",timeBetweenTransactionsMillis="0",updateUnchangedValuesEveryMillis="1000000" ]
with:
Bridge modbus:tcp:Scheda_IN_01 [ host="localhost", port=502, id=1, receiveTimeoutMillis="100", timeBetweenTransactionsMillis="1", updateUnchangedValuesEveryMillis="1000000" ]
Now at least the comunication is up from 3 days, but it still too slow.
There isn’t any parameter to set for reduce this timeout?
And is there no way to make communication more fault rugged?
Maybe am I making some errors?
Or maybe is an hardware limit?
Thank you