Hi @ssalonen & @splatch,
you cut my question away. The question is what are the recommended connection parameters for the Modbus TCP Slave?
I just upgraded to the new milestone release 3.3.0-M5. That one comes with enhancement #12642 which enables the afterConnectionDelayMillis parameter in the GUI. It work reasonable well now, thanks! This is the configuration I’m using now:
UID: modbus:tcp:5b0337a743
label: Modbus TCP Slave WR1
thingTypeUID: modbus:tcp
configuration:
rtuEncoded: false
connectMaxTries: 1
reconnectAfterMillis: 60000
timeBetweenTransactionsMillis: 500
port: 502
timeBetweenReconnectMillis: 3000
connectTimeoutMillis: 10000
host: 192.168.178.82
afterConnectionDelayMillis: 2000
id: 1
enableDiscovery: false
I still see 3 scenarios happening, 2 recovering and 1 failing:
022-05-08 08:45:11.924 [WARN ] [rt.modbus.internal.ModbusManagerImpl] - Try 1 out of 3 failed when executing request (ModbusReadRequestBlueprint [slaveId=1, functionCode=READ_MULTIPLE_REGISTERS, start=37000, length=70, maxTries=3]). Will try again soon. Error was I/O error, so resetting the connection. Error details: net.wimpi.modbus.ModbusIOException I/O exception: SocketTimeoutException Read timed out [operation ID a44c09a9-9672-4c99-8f6e-17b62fee9f78]
2022-05-08 09:50:07.225 [WARN ] [rt.modbus.internal.ModbusManagerImpl] - Try 1 out of 3 failed when executing request (ModbusReadRequestBlueprint [slaveId=1, functionCode=READ_MULTIPLE_REGISTERS, start=37100, length=39, maxTries=3]). Will try again soon. Error was I/O error, so resetting the connection. Error details: net.wimpi.modbus.ModbusIOException I/O exception: SocketTimeoutException Read timed out [operation ID bc69f5d7-2a16-49f6-8e00-ab28b7f13ce9]
2022-05-08 09:50:09.232 [WARN ] [rt.modbus.internal.ModbusManagerImpl] - Try 2 out of 3 failed when executing request (ModbusReadRequestBlueprint [slaveId=1, functionCode=READ_MULTIPLE_REGISTERS, start=37100, length=39, maxTries=3]). Will try again soon. The response did not match the request. Resetting the connection. Error details: org.openhab.core.io.transport.modbus.exception.ModbusUnexpectedTransactionIdException Transaction id of request (728) does not equal response (727). Slave response is invalid. [operation ID bc69f5d7-2a16-49f6-8e00-ab28b7f13ce9]
2022-05-08 09:10:06.605 [WARN ] [rt.modbus.internal.ModbusManagerImpl] - Try 1 out of 3 failed when executing request (ModbusReadRequestBlueprint [slaveId=2, functionCode=READ_MULTIPLE_REGISTERS, start=32016, length=100, maxTries=3]). Will try again soon. Error was I/O error, so resetting the connection. Error details: net.wimpi.modbus.ModbusIOException I/O exception: SocketTimeoutException Read timed out [operation ID 4d227069-bc15-4e25-a47a-25791b664d78]
2022-05-08 09:10:08.622 [WARN ] [rt.modbus.internal.ModbusManagerImpl] - Try 2 out of 3 failed when executing request (ModbusReadRequestBlueprint [slaveId=2, functionCode=READ_MULTIPLE_REGISTERS, start=32016, length=100, maxTries=3]). Will try again soon. Error was: net.wimpi.modbus.ModbusSlaveException Error Code = 6 [operation ID 4d227069-bc15-4e25-a47a-25791b664d78]
2022-05-08 09:10:09.124 [ERROR] [rt.modbus.internal.ModbusManagerImpl] - Last try 3 failed when executing request (ModbusReadRequestBlueprint [slaveId=2, functionCode=READ_MULTIPLE_REGISTERS, start=32016, length=100, maxTries=3]). Aborting. The response did not match the request. Resetting the connection. Error details: org.openhab.core.io.transport.modbus.exception.ModbusUnexpectedTransactionIdException Transaction id of request (513) does not equal response (511). Slave response is invalid. [operation ID 4d227069-bc15-4e25-a47a-25791b664d78]
BTW, I’m using 2 Modbus TCP Slaves, one for each inverter in a cascade configuration with a single SDongle - so same IP, but different ModbusIDs.
4 Modbus Pollers (3+1) are accessing the 2 Salves in 1min resolution (refresh: 60000). The SDongle is connected over WLAN to my home network.
Please share your setup details for further configuration optimization.
Thanks