Hi
Here are the lines before, but I suspected that failure to be my own, because I was playing around with Modbus and I might switched + and - on RS485. That is why I wrote no errors before that. But the message you mention is present.
2020-02-29 17:57:57.791 [WARN ] [rt.modbus.internal.ModbusManagerImpl] - Try 1 out of 3 failed when executing request (ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@6bab2106[slaveId=1,functionCode=READ_MULTIPLE_REGISTERS,start=0,length=64,maxTries=3]). Will try again soon. Error was I/O error, so reseting the connection. Error details: net.wimpi.modbus.ModbusIOException I/O exception: IOException Error reading response (EOF) [operation ID ed9a92de-7275-4473-bf17-aebb9e6ddc08]
2020-02-29 17:57:59.424 [ERROR] [t.wimpi.modbus.io.ModbusRTUTransport] - Last request: 01 03 00 00 00 40 44 3a
2020-02-29 17:57:59.424 [ERROR] [t.wimpi.modbus.io.ModbusRTUTransport] - failed to read: Error reading response (EOF)
2020-02-29 17:57:59.425 [ERROR] [pi.modbus.io.ModbusSerialTransaction] - execute try 1/1 error: I/O exception: IOException Error reading response (EOF). Request: net.wimpi.modbus.msg.ReadMultipleRegistersRequest@6540f686 (unit id 1 & transaction 352). Serial parameters: SerialParameters@7c5dbfcb[portName=/dev/ttyUSB5,baudRate=9600,flowControlIn=none,flowControlOut=none,databits=8,stopbits=2,parity=none,encoding=rtu,echo=false,receiveTimeoutMillis=1500]
2020-02-29 17:57:59.425 [ERROR] [pi.modbus.io.ModbusSerialTransaction] - execute reached max tries 1, throwing last error: I/O exception: IOException Error reading response (EOF). Request: net.wimpi.modbus.msg.ReadMultipleRegistersRequest@6540f686 (unit id 1 & transaction 352). Serial parameters: SerialParameters@7c5dbfcb[portName=/dev/ttyUSB5,baudRate=9600,flowControlIn=none,flowControlOut=none,databits=8,stopbits=2,parity=none,encoding=rtu,echo=false,receiveTimeoutMillis=1500]
2020-02-29 17:57:59.426 [WARN ] [rt.modbus.internal.ModbusManagerImpl] - Try 2 out of 3 failed when executing request (ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@6bab2106[slaveId=1,functionCode=READ_MULTIPLE_REGISTERS,start=0,length=64,maxTries=3]). Will try again soon. Error was I/O error, so reseting the connection. Error details: net.wimpi.modbus.ModbusIOException I/O exception: IOException Error reading response (EOF) [operation ID ed9a92de-7275-4473-bf17-aebb9e6ddc08]
2020-02-29 17:57:59.829 [INFO ] [rt.modbus.internal.ModbusManagerImpl] - Unregistering regular poll task BasicPollTaskImpl@30a58586[request=ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@6bab2106[slaveId=1,functionCode=READ_MULTIPLE_REGISTERS,start=0,length=64,maxTries=3],endpoint=ModbusSerialSlaveEndpoint@788895a5[portName=/dev/ttyUSB5],callback=org.openhab.binding.modbus.internal.handler.ModbusPollerThingHandlerImpl$ReadCallbackDelegator@497c319a] (interrupting if necessary)
2020-02-29 17:57:59.830 [INFO ] [rt.modbus.internal.ModbusManagerImpl] - Poll task BasicPollTaskImpl@30a58586[request=ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@6bab2106[slaveId=1,functionCode=READ_MULTIPLE_REGISTERS,start=0,length=64,maxTries=3],endpoint=ModbusSerialSlaveEndpoint@788895a5[portName=/dev/ttyUSB5],callback=org.openhab.binding.modbus.internal.handler.ModbusPollerThingHandlerImpl$ReadCallbackDelegator@497c319a] canceled
2020-02-29 17:58:01.029 [ERROR] [t.wimpi.modbus.io.ModbusRTUTransport] - Last request: 01 03 00 00 00 40 44 3a
2020-02-29 17:58:01.030 [ERROR] [t.wimpi.modbus.io.ModbusRTUTransport] - failed to read: Error reading response (EOF)
2020-02-29 17:58:01.030 [ERROR] [pi.modbus.io.ModbusSerialTransaction] - execute try 1/1 error: I/O exception: IOException Error reading response (EOF). Request: net.wimpi.modbus.msg.ReadMultipleRegistersRequest@3acceea1 (unit id 1 & transaction 353). Serial parameters: SerialParameters@7c5dbfcb[portName=/dev/ttyUSB5,baudRate=9600,flowControlIn=none,flowControlOut=none,databits=8,stopbits=2,parity=none,encoding=rtu,echo=false,receiveTimeoutMillis=1500]
2020-02-29 17:58:01.030 [ERROR] [pi.modbus.io.ModbusSerialTransaction] - execute reached max tries 1, throwing last error: I/O exception: IOException Error reading response (EOF). Request: net.wimpi.modbus.msg.ReadMultipleRegistersRequest@3acceea1 (unit id 1 & transaction 353). Serial parameters: SerialParameters@7c5dbfcb[portName=/dev/ttyUSB5,baudRate=9600,flowControlIn=none,flowControlOut=none,databits=8,stopbits=2,parity=none,encoding=rtu,echo=false,receiveTimeoutMillis=1500]
2020-02-29 17:58:01.030 [ERROR] [rt.modbus.internal.ModbusManagerImpl] - Last try 3 failed when executing request (ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@6bab2106[slaveId=1,functionCode=READ_MULTIPLE_REGISTERS,start=0,length=64,maxTries=3]). Aborting. Error was I/O error, so reseting the connection. Error details: net.wimpi.modbus.ModbusIOException I/O exception: IOException Error reading response (EOF) [operation ID ed9a92de-7275-4473-bf17-aebb9e6ddc08]
2020-02-29 17:58:01.031 [WARN ] [rt.modbus.internal.ModbusManagerImpl] - Error invalidating connection in pool for endpoint ModbusSerialSlaveEndpoint@788895a5[portName=/dev/ttyUSB5]. Error was: java.lang.IllegalMonitorStateException null
java.lang.IllegalMonitorStateException: null
It is really interesting that it will try to keep the port open always, and only open/close in case of i/o error.
Then I guess my setup will always hit an i/o error, because I do a power off on the device ?
Also, I have yet not blocked for that the power outlet can be manually turned off in my smart house, and I have used this in my tests as well. This means that in some situations the power was turned off, before the poller was stopped. This is of course not the long term solution, but that might be the reason for the problems ??
The long term solution is:
openhab operation turn on: power on device, wait a few seconds, and enable poller
openhab operation turn off: disable poller, wait a few seconds, power off device
manual operation turn on: power on device using wall switch input, wait some seconds and then use remote control
manual operation turn off: turn off using remote control. My openhab rule will detect this and stop poller after some seconds, wait again and then power off device