Hi @ssalonen,
Once more thanks a lot for your help on the serial connection!
Since i’m still busy with experiments on how to do the final implementation of the modbus communication in OpenHAB, I’m now doing a small experiment with the use a TCP connection.
I encounter a rather small problem but worth mentioning in my opinion.
Here you can find my current config (which should be more or less final): https://pastebin.com/LfxJt734
The problem I encounter occurs at startup.
As you can see in the config I keep the connection open for 5 minutes via reconnectAfterMillis.
But at startup it looks like the modbus binding doesn’t use this parameter since it opens and closes every 10 seconds 7 new connections to the slave (because of the 7 pollers I’ve defined that refresh every 10 seconds).
Now, there seems to be a simple “fix” for this. In my case I save the things file again, this causes all poll tasks to be unregistered (see info/error messages bellow), and after that everything is going fine and only one connection remains.
These info/error messages appear after saving the things file again:
2017-09-11 16:23:46.879 [INFO ] [rt.modbus.internal.ModbusManagerImpl] - Unregistering regular poll task PollTaskImpl@5364bc3f[request=ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@535cbf28[slaveId=11,functionCode=READ_MULTIPLE_REGISTERS,start=4027,length=8],endpoint=ModbusTCPSlaveEndpoint@7fff2661[address=192.168.50.113,port=502],callback=org.openhab.binding.modbus.handler.ModbusPollerThingHandlerImpl$ReadCallbackDelegator@5dbe1587] (interrupting if necessary)
2017-09-11 16:23:46.880 [INFO ] [rt.modbus.internal.ModbusManagerImpl] - Unregistering regular poll task PollTaskImpl@6a04e204[request=ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@459a1708[slaveId=11,functionCode=READ_MULTIPLE_REGISTERS,start=4021,length=5],endpoint=ModbusTCPSlaveEndpoint@7fff2661[address=192.168.50.113,port=502],callback=org.openhab.binding.modbus.handler.ModbusPollerThingHandlerImpl$ReadCallbackDelegator@5dbe1586] (interrupting if necessary)
2017-09-11 16:23:46.880 [INFO ] [rt.modbus.internal.ModbusManagerImpl] - Unregistering regular poll task PollTaskImpl@1865a804[request=ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@6990e825[slaveId=11,functionCode=READ_MULTIPLE_REGISTERS,start=4015,length=5],endpoint=ModbusTCPSlaveEndpoint@7fff2661[address=192.168.50.113,port=502],callback=org.openhab.binding.modbus.handler.ModbusPollerThingHandlerImpl$ReadCallbackDelegator@5dbe1585] (interrupting if necessary)
2017-09-11 16:23:46.881 [INFO ] [rt.modbus.internal.ModbusManagerImpl] - Unregistering regular poll task PollTaskImpl@7d5b2382[request=ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@393927aa[slaveId=11,functionCode=READ_MULTIPLE_REGISTERS,start=4000,length=12],endpoint=ModbusTCPSlaveEndpoint@7fff2661[address=192.168.50.113,port=502],callback=org.openhab.binding.modbus.handler.ModbusPollerThingHandlerImpl$ReadCallbackDelegator@5dbe1584] (interrupting if necessary)
2017-09-11 16:23:46.881 [INFO ] [rt.modbus.internal.ModbusManagerImpl] - Unregistering regular poll task PollTaskImpl@222c6581[request=ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@3ff7ac94[slaveId=11,functionCode=READ_MULTIPLE_REGISTERS,start=4036,length=9],endpoint=ModbusTCPSlaveEndpoint@7fff2661[address=192.168.50.113,port=502],callback=org.openhab.binding.modbus.handler.ModbusPollerThingHandlerImpl$ReadCallbackDelegator@5dbe1588] (interrupting if necessary)
2017-09-11 16:23:46.881 [INFO ] [rt.modbus.internal.ModbusManagerImpl] - Poll task PollTaskImpl@6a04e204[request=ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@459a1708[slaveId=11,functionCode=READ_MULTIPLE_REGISTERS,start=4021,length=5],endpoint=ModbusTCPSlaveEndpoint@7fff2661[address=192.168.50.113,port=502],callback=org.openhab.binding.modbus.handler.ModbusPollerThingHandlerImpl$ReadCallbackDelegator@5dbe1586] canceled
2017-09-11 16:23:46.881 [INFO ] [rt.modbus.internal.ModbusManagerImpl] - Poll task PollTaskImpl@222c6581[request=ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@3ff7ac94[slaveId=11,functionCode=READ_MULTIPLE_REGISTERS,start=4036,length=9],endpoint=ModbusTCPSlaveEndpoint@7fff2661[address=192.168.50.113,port=502],callback=org.openhab.binding.modbus.handler.ModbusPollerThingHandlerImpl$ReadCallbackDelegator@5dbe1588] canceled
2017-09-11 16:23:46.882 [INFO ] [rt.modbus.internal.ModbusManagerImpl] - Poll task PollTaskImpl@5364bc3f[request=ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@535cbf28[slaveId=11,functionCode=READ_MULTIPLE_REGISTERS,start=4027,length=8],endpoint=ModbusTCPSlaveEndpoint@7fff2661[address=192.168.50.113,port=502],callback=org.openhab.binding.modbus.handler.ModbusPollerThingHandlerImpl$ReadCallbackDelegator@5dbe1587] canceled
2017-09-11 16:23:46.882 [INFO ] [rt.modbus.internal.ModbusManagerImpl] - Unregistering regular poll task PollTaskImpl@6e4afca9[request=ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@7b7d943f[slaveId=11,functionCode=READ_MULTIPLE_REGISTERS,start=4046,length=5],endpoint=ModbusTCPSlaveEndpoint@7fff2661[address=192.168.50.113,port=502],callback=org.openhab.binding.modbus.handler.ModbusPollerThingHandlerImpl$ReadCallbackDelegator@5dbe1589] (interrupting if necessary)
2017-09-11 16:23:46.882 [INFO ] [rt.modbus.internal.ModbusManagerImpl] - Poll task PollTaskImpl@7d5b2382[request=ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@393927aa[slaveId=11,functionCode=READ_MULTIPLE_REGISTERS,start=4000,length=12],endpoint=ModbusTCPSlaveEndpoint@7fff2661[address=192.168.50.113,port=502],callback=org.openhab.binding.modbus.handler.ModbusPollerThingHandlerImpl$ReadCallbackDelegator@5dbe1584] canceled
2017-09-11 16:23:46.883 [INFO ] [rt.modbus.internal.ModbusManagerImpl] - Unregistering regular poll task PollTaskImpl@7c6b98ea[request=ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@a18561c[slaveId=11,functionCode=READ_MULTIPLE_REGISTERS,start=4052,length=5],endpoint=ModbusTCPSlaveEndpoint@7fff2661[address=192.168.50.113,port=502],callback=org.openhab.binding.modbus.handler.ModbusPollerThingHandlerImpl$ReadCallbackDelegator@5dbe158a] (interrupting if necessary)
2017-09-11 16:23:46.883 [INFO ] [rt.modbus.internal.ModbusManagerImpl] - Poll task PollTaskImpl@1865a804[request=ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@6990e825[slaveId=11,functionCode=READ_MULTIPLE_REGISTERS,start=4015,length=5],endpoint=ModbusTCPSlaveEndpoint@7fff2661[address=192.168.50.113,port=502],callback=org.openhab.binding.modbus.handler.ModbusPollerThingHandlerImpl$ReadCallbackDelegator@5dbe1585] canceled
2017-09-11 16:23:46.883 [INFO ] [rt.modbus.internal.ModbusManagerImpl] - Poll task PollTaskImpl@7c6b98ea[request=ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@a18561c[slaveId=11,functionCode=READ_MULTIPLE_REGISTERS,start=4052,length=5],endpoint=ModbusTCPSlaveEndpoint@7fff2661[address=192.168.50.113,port=502],callback=org.openhab.binding.modbus.handler.ModbusPollerThingHandlerImpl$ReadCallbackDelegator@5dbe158a] canceled
2017-09-11 16:23:46.884 [INFO ] [rt.modbus.internal.ModbusManagerImpl] - Unregistering regular poll task PollTaskImpl@6825c617[request=ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@3671cfc7[slaveId=11,functionCode=READ_MULTIPLE_REGISTERS,start=4015,length=5],endpoint=ModbusTCPSlaveEndpoint@7b30305b[address=192.168.50.113,port=502],callback=org.openhab.binding.modbus.handler.ModbusPollerThingHandlerImpl$ReadCallbackDelegator@5dbe1585] (interrupting if necessary)
2017-09-11 16:23:46.884 [INFO ] [rt.modbus.internal.ModbusManagerImpl] - Poll task PollTaskImpl@6825c617[request=ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@3671cfc7[slaveId=11,functionCode=READ_MULTIPLE_REGISTERS,start=4015,length=5],endpoint=ModbusTCPSlaveEndpoint@7b30305b[address=192.168.50.113,port=502],callback=org.openhab.binding.modbus.handler.ModbusPollerThingHandlerImpl$ReadCallbackDelegator@5dbe1585] canceled
2017-09-11 16:23:46.885 [INFO ] [rt.modbus.internal.ModbusManagerImpl] - Unregistering regular poll task PollTaskImpl@7b7dbe00[request=ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@78698d96[slaveId=11,functionCode=READ_MULTIPLE_REGISTERS,start=4021,length=5],endpoint=ModbusTCPSlaveEndpoint@7b30305b[address=192.168.50.113,port=502],callback=org.openhab.binding.modbus.handler.ModbusPollerThingHandlerImpl$ReadCallbackDelegator@5dbe1586] (interrupting if necessary)
2017-09-11 16:23:46.885 [INFO ] [rt.modbus.internal.ModbusManagerImpl] - Poll task PollTaskImpl@7b7dbe00[request=ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@78698d96[slaveId=11,functionCode=READ_MULTIPLE_REGISTERS,start=4021,length=5],endpoint=ModbusTCPSlaveEndpoint@7b30305b[address=192.168.50.113,port=502],callback=org.openhab.binding.modbus.handler.ModbusPollerThingHandlerImpl$ReadCallbackDelegator@5dbe1586] canceled
2017-09-11 16:23:46.885 [INFO ] [rt.modbus.internal.ModbusManagerImpl] - Unregistering regular poll task PollTaskImpl@3c8b1d88[request=ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@3ac1e856[slaveId=11,functionCode=READ_MULTIPLE_REGISTERS,start=4027,length=8],endpoint=ModbusTCPSlaveEndpoint@7b30305b[address=192.168.50.113,port=502],callback=org.openhab.binding.modbus.handler.ModbusPollerThingHandlerImpl$ReadCallbackDelegator@5dbe1587] (interrupting if necessary)
2017-09-11 16:23:46.885 [INFO ] [rt.modbus.internal.ModbusManagerImpl] - Unregistering regular poll task PollTaskImpl@6dde750c[request=ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@2b8d13de[slaveId=11,functionCode=READ_MULTIPLE_REGISTERS,start=4036,length=9],endpoint=ModbusTCPSlaveEndpoint@7b30305b[address=192.168.50.113,port=502],callback=org.openhab.binding.modbus.handler.ModbusPollerThingHandlerImpl$ReadCallbackDelegator@5dbe1588] (interrupting if necessary)
2017-09-11 16:23:46.885 [INFO ] [rt.modbus.internal.ModbusManagerImpl] - Poll task PollTaskImpl@3c8b1d88[request=ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@3ac1e856[slaveId=11,functionCode=READ_MULTIPLE_REGISTERS,start=4027,length=8],endpoint=ModbusTCPSlaveEndpoint@7b30305b[address=192.168.50.113,port=502],callback=org.openhab.binding.modbus.handler.ModbusPollerThingHandlerImpl$ReadCallbackDelegator@5dbe1587] canceled
2017-09-11 16:23:46.886 [INFO ] [rt.modbus.internal.ModbusManagerImpl] - Unregistering regular poll task PollTaskImpl@52ad96cf[request=ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@362ea64f[slaveId=11,functionCode=READ_MULTIPLE_REGISTERS,start=4052,length=5],endpoint=ModbusTCPSlaveEndpoint@7b30305b[address=192.168.50.113,port=502],callback=org.openhab.binding.modbus.handler.ModbusPollerThingHandlerImpl$ReadCallbackDelegator@5dbe158a] (interrupting if necessary)
2017-09-11 16:23:46.886 [INFO ] [rt.modbus.internal.ModbusManagerImpl] - Poll task PollTaskImpl@52ad96cf[request=ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@362ea64f[slaveId=11,functionCode=READ_MULTIPLE_REGISTERS,start=4052,length=5],endpoint=ModbusTCPSlaveEndpoint@7b30305b[address=192.168.50.113,port=502],callback=org.openhab.binding.modbus.handler.ModbusPollerThingHandlerImpl$ReadCallbackDelegator@5dbe158a] canceled
2017-09-11 16:23:46.885 [INFO ] [rt.modbus.internal.ModbusManagerImpl] - Poll task PollTaskImpl@6dde750c[request=ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@2b8d13de[slaveId=11,functionCode=READ_MULTIPLE_REGISTERS,start=4036,length=9],endpoint=ModbusTCPSlaveEndpoint@7b30305b[address=192.168.50.113,port=502],callback=org.openhab.binding.modbus.handler.ModbusPollerThingHandlerImpl$ReadCallbackDelegator@5dbe1588] canceled
2017-09-11 16:23:46.887 [INFO ] [rt.modbus.internal.ModbusManagerImpl] - Poll task PollTaskImpl@6e4afca9[request=ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@7b7d943f[slaveId=11,functionCode=READ_MULTIPLE_REGISTERS,start=4046,length=5],endpoint=ModbusTCPSlaveEndpoint@7fff2661[address=192.168.50.113,port=502],callback=org.openhab.binding.modbus.handler.ModbusPollerThingHandlerImpl$ReadCallbackDelegator@5dbe1589] canceled
2017-09-11 16:23:46.884 [INFO ] [rt.modbus.internal.ModbusManagerImpl] - Unregistering regular poll task PollTaskImpl@a1c3d4[request=ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@69b6c4b5[slaveId=11,functionCode=READ_MULTIPLE_REGISTERS,start=4000,length=12],endpoint=ModbusTCPSlaveEndpoint@7b30305b[address=192.168.50.113,port=502],callback=org.openhab.binding.modbus.handler.ModbusPollerThingHandlerImpl$ReadCallbackDelegator@5dbe1584] (interrupting if necessary)
2017-09-11 16:23:46.887 [INFO ] [rt.modbus.internal.ModbusManagerImpl] - Poll task PollTaskImpl@a1c3d4[request=ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@69b6c4b5[slaveId=11,functionCode=READ_MULTIPLE_REGISTERS,start=4000,length=12],endpoint=ModbusTCPSlaveEndpoint@7b30305b[address=192.168.50.113,port=502],callback=org.openhab.binding.modbus.handler.ModbusPollerThingHandlerImpl$ReadCallbackDelegator@5dbe1584] canceled
2017-09-11 16:23:46.888 [WARN ] [odbus.handler.ModbusReadThingHandler] - Poller 'Poll definition' of ReadWrite bridge 'Modbus read-write definition' of ReadThing 'Modbus read definition' has no poll task. Aborting config validation
2017-09-11 16:23:46.889 [WARN ] [odbus.handler.ModbusReadThingHandler] - Poller 'Poll definition' of ReadWrite bridge 'Modbus read-write definition' of ReadThing 'Modbus read definition' has no poll task. Aborting config validation
2017-09-11 16:23:46.890 [WARN ] [rt.modbus.internal.ModbusManagerImpl] - Error getting a new connection for endpoint ModbusTCPSlaveEndpoint@7b30305b[address=192.168.50.113,port=502]. Error was: java.lang.InterruptedException null
2017-09-11 16:23:46.890 [WARN ] [rt.modbus.internal.ModbusManagerImpl] - Not connected to endpoint ModbusTCPSlaveEndpoint@7b30305b[address=192.168.50.113,port=502] -- aborting request ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@69b6c4b5[slaveId=11,functionCode=READ_MULTIPLE_REGISTERS,start=4000,length=12]
2017-09-11 16:23:46.901 [INFO ] [rt.modbus.internal.ModbusManagerImpl] - Unregistering regular poll task PollTaskImpl@42b0da59[request=ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@4c010eb8[slaveId=11,functionCode=READ_MULTIPLE_REGISTERS,start=4000,length=12],endpoint=ModbusTCPSlaveEndpoint@7b30305b[address=192.168.50.113,port=502],callback=org.openhab.binding.modbus.handler.ModbusPollerThingHandlerImpl$ReadCallbackDelegator@5dbe1584] (interrupting if necessary)
2017-09-11 16:23:46.891 [WARN ] [rt.modbus.internal.ModbusManagerImpl] - Poll task was unregistered -- not executing/proceeding with the poll
org.openhab.io.transport.modbus.internal.ModbusManagerImpl$PollTaskUnregistered: Poll task PollTaskImpl@a1c3d4[request=ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@69b6c4b5[slaveId=11,functionCode=READ_MULTIPLE_REGISTERS,start=4000,length=12],endpoint=ModbusTCPSlaveEndpoint@7b30305b[address=192.168.50.113,port=502],callback=org.openhab.binding.modbus.handler.ModbusPollerThingHandlerImpl$ReadCallbackDelegator@5dbe1584] is unregistered
at org.openhab.io.transport.modbus.internal.ModbusManagerImpl.verifyTaskIsRegistered(ModbusManagerImpl.java:400) ~[?:?]
at org.openhab.io.transport.modbus.internal.ModbusManagerImpl.executeOneTimePoll(ModbusManagerImpl.java:433) ~[?:?]
at org.openhab.io.transport.modbus.internal.ModbusManagerImpl.lambda$11(ModbusManagerImpl.java:500) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:?]
at java.lang.Thread.run(Thread.java:748) [?:?]
2017-09-11 16:23:46.902 [INFO ] [rt.modbus.internal.ModbusManagerImpl] - Poll task PollTaskImpl@42b0da59[request=ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@4c010eb8[slaveId=11,functionCode=READ_MULTIPLE_REGISTERS,start=4000,length=12],endpoint=ModbusTCPSlaveEndpoint@7b30305b[address=192.168.50.113,port=502],callback=org.openhab.binding.modbus.handler.ModbusPollerThingHandlerImpl$ReadCallbackDelegator@5dbe1584] canceled
2017-09-11 16:23:46.900 [WARN ] [rt.modbus.internal.ModbusManagerImpl] - Error getting a new connection for endpoint ModbusTCPSlaveEndpoint@7b30305b[address=192.168.50.113,port=502]. Error was: java.lang.InterruptedException null
2017-09-11 16:23:46.903 [WARN ] [rt.modbus.internal.ModbusManagerImpl] - Not connected to endpoint ModbusTCPSlaveEndpoint@7b30305b[address=192.168.50.113,port=502] -- aborting request ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@2b8d13de[slaveId=11,functionCode=READ_MULTIPLE_REGISTERS,start=4036,length=9]
2017-09-11 16:23:46.899 [INFO ] [rt.modbus.internal.ModbusManagerImpl] - Unregistering regular poll task PollTaskImpl@3928ef77[request=ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@3bb977ca[slaveId=11,functionCode=READ_MULTIPLE_REGISTERS,start=4046,length=5],endpoint=ModbusTCPSlaveEndpoint@7b30305b[address=192.168.50.113,port=502],callback=org.openhab.binding.modbus.handler.ModbusPollerThingHandlerImpl$ReadCallbackDelegator@5dbe1589] (interrupting if necessary)
2017-09-11 16:23:46.905 [INFO ] [rt.modbus.internal.ModbusManagerImpl] - Poll task PollTaskImpl@3928ef77[request=ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@3bb977ca[slaveId=11,functionCode=READ_MULTIPLE_REGISTERS,start=4046,length=5],endpoint=ModbusTCPSlaveEndpoint@7b30305b[address=192.168.50.113,port=502],callback=org.openhab.binding.modbus.handler.ModbusPollerThingHandlerImpl$ReadCallbackDelegator@5dbe1589] canceled
2017-09-11 16:23:46.906 [WARN ] [.handler.ModbusReadWriteThingHandler] - Read write thing handler got read error: org.openhab.io.transport.modbus.internal.ModbusConnectionException Error connecting to endpoint ModbusTCPSlaveEndpoint@7b30305b[address=192.168.50.113,port=502]
2017-09-11 16:23:46.897 [WARN ] [odbus.handler.ModbusReadThingHandler] - Poller 'Poll definition' of ReadWrite bridge 'Modbus read-write definition' of ReadThing 'Modbus read definition' has no poll task. Aborting config validation
2017-09-11 16:23:46.909 [ERROR] [odbus.handler.ModbusReadThingHandler] - Thing Modbus read definition received read error: org.openhab.io.transport.modbus.internal.ModbusConnectionException Error connecting to endpoint ModbusTCPSlaveEndpoint@7b30305b[address=192.168.50.113,port=502]. Stack trace follows for unexpected errors.
org.openhab.io.transport.modbus.internal.ModbusConnectionException: Error connecting to endpoint ModbusTCPSlaveEndpoint@7b30305b[address=192.168.50.113,port=502]
at org.openhab.io.transport.modbus.internal.ModbusManagerImpl.lambda$5(ModbusManagerImpl.java:436) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:?]
at java.lang.Thread.run(Thread.java:748) [?:?]
2017-09-11 16:23:46.913 [WARN ] [.handler.ModbusReadWriteThingHandler] - Read write thing handler got read error: org.openhab.io.transport.modbus.internal.ModbusConnectionException Error connecting to endpoint ModbusTCPSlaveEndpoint@7b30305b[address=192.168.50.113,port=502]
2017-09-11 16:23:46.915 [ERROR] [rt.modbus.internal.ModbusManagerImpl] - Error when executing read request (ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@78698d96[slaveId=11,functionCode=READ_MULTIPLE_REGISTERS,start=4021,length=5]): net.wimpi.modbus.ModbusIOException Thread acquiring lock was interrupted.
2017-09-11 16:23:46.914 [ERROR] [odbus.handler.ModbusReadThingHandler] - Thing Modbus read definition received read error: org.openhab.io.transport.modbus.internal.ModbusConnectionException Error connecting to endpoint ModbusTCPSlaveEndpoint@7b30305b[address=192.168.50.113,port=502]. Stack trace follows for unexpected errors.
org.openhab.io.transport.modbus.internal.ModbusConnectionException: Error connecting to endpoint ModbusTCPSlaveEndpoint@7b30305b[address=192.168.50.113,port=502]
at org.openhab.io.transport.modbus.internal.ModbusManagerImpl.lambda$5(ModbusManagerImpl.java:436) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:?]
at java.lang.Thread.run(Thread.java:748) [?:?]
2017-09-11 16:23:46.918 [WARN ] [.handler.ModbusReadWriteThingHandler] - Read write thing handler got read error: org.openhab.io.transport.modbus.internal.ModbusConnectionException Error connecting to endpoint ModbusTCPSlaveEndpoint@7b30305b[address=192.168.50.113,port=502]
2017-09-11 16:23:46.918 [ERROR] [odbus.handler.ModbusReadThingHandler] - Thing Modbus read definition received read error: org.openhab.io.transport.modbus.internal.ModbusConnectionException Error connecting to endpoint ModbusTCPSlaveEndpoint@7b30305b[address=192.168.50.113,port=502]. Stack trace follows for unexpected errors.
org.openhab.io.transport.modbus.internal.ModbusConnectionException: Error connecting to endpoint ModbusTCPSlaveEndpoint@7b30305b[address=192.168.50.113,port=502]
at org.openhab.io.transport.modbus.internal.ModbusManagerImpl.lambda$5(ModbusManagerImpl.java:436) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:?]
at java.lang.Thread.run(Thread.java:748) [?:?]
Another important note is that sometimes, at startup I also see this unregistering appearing at startup. In this case everything is fine from startup and I don’t need to save the things file again to fix it.
Question: is there a reason why the connection should be closed after every poll operation or after the timeout defined by reconnectAfterMillis? Isn’t it also fine to leave the connection permanently open?
Thanks!
Greetings,
Frederic