Getting "CRC Error" and "EOF Error" in modbus

Hi All,

I am using Modbus binding to control and access my devices. Previously, I was working in simulator HW where Modbus is working properly and able to access devices.

Now, I am working in actual HW and getting error. I have read and implemented other’s solutions. But it is not fixing my issue. Below, I have provided the details,

.things

Bridge modbus:serial:slave04 [port="/dev/ttyACM0",baud=9600,id=4,stopBits="1.0",parity="none",dataBits=8,encoding="rtu"]
{
    // InputControlModule is Manual call point
    // Analog Input Register , 30001 + 0x08
    Bridge poller inputControlModule[start=8, length=2, refresh=300, type="input"]
    {
            Thing data input1[readStart="8",readValueType="int32",readTransform="JS(conversion.js)"]    
    }    
}

//slave 0x80 = 128 - First Smoke Detector
Bridge modbus:serial:slave0x80 [port="/dev/ttyACM0",baud=9600,id=128,stopBits="1.0",parity="none",dataBits=8,encoding="rtu"]
{  

    //Holding Register = 40001 + 8 = 40009
    Bridge poller smokeDetector [start=8, length=2, refresh=1000,type="input"]
    {
        Thing data smokeDetector01[readStart="8",readValueType="int32",readTransform="JS(conversion.js)"]  //Working one         
    }
    
    //Reset the SmokeDetector at register 0xAD
    Bridge poller resetSmokeDetector [ start=173, length=2, refresh=0,type="coil"]
    {
        Thing data resetSmokeDetector01[writeTransform="01",writeStart="173",writeValueType="bit",writeType="coil"]
    }

}

//slave 0x40 = 64 - Second Smoke Detector
Bridge modbus:serial:slave0x40 [port="/dev/ttyACM0",baud=9600,id=64,stopBits="1.0",parity="none",dataBits=8,encoding="rtu"]
{  

    //Holding Register = 40001 + 8 = 40009
    Bridge poller smokeDetector [start=8, length=2, refresh=1000,type="input"]
    {
        Thing data smokeDetector02[readStart="8",readValueType="int32",readTransform="JS(conversion.js)"]  //Working one         
    }
    
    //Reset the SmokeDetector at register 0xAD
    Bridge poller resetSmokeDetector [ start=173, length=2, refresh=0,type="coil"]
    {
        Thing data resetSmokeDetector02[writeTransform="01",writeStart="173",writeValueType="bit",writeType="coil"]
    }

}


//slave 0x01 - Third Smoke Detector
Bridge modbus:serial:slave0x01 [port="/dev/ttyACM0",baud=9600,id=01,stopBits="1.0",parity="none",dataBits=8,encoding="rtu"]
{  

    //Holding Register = 40001 + 8 = 40009
    Bridge poller smokeDetector [start=8, length=2, refresh=1000,type="input"]
    {
        Thing data smokeDetector03[readStart="8",readValueType="int32",readTransform="JS(conversion.js)"]  //Working one         
    }
    
    //Reset the SmokeDetector at register 0xAD
    Bridge poller resetSmokeDetector [ start=173, length=2, refresh=0,type="coil"]
    {
        Thing data resetSmokeDetector04[writeTransform="01",writeStart="173",writeValueType="bit",writeType="coil"]
    }
 
}



//slave 0x20 = 32 - Fourth Smoke Detector
Bridge modbus:serial:slave0x20 [port="/dev/ttyACM0",baud=9600,id=32,stopBits="1.0",parity="none",dataBits=8,encoding="rtu"]
{  

    //Holding Register = 40001 + 8 = 40009
    Bridge poller smokeDetector [start=8, length=2, refresh=1000,type="input"]
    {
        Thing data smokeDetector04[readStart="8",readValueType="int32",readTransform="JS(conversion.js)"]  //Working one         
    }
    
    //Reset the SmokeDetector at register 0xAD
    Bridge poller resetSmokeDetector [ start=173, length=2, refresh=0,type="coil"]
    {
        Thing data resetSmokeDetector04[writeTransform="01",writeStart="173",writeValueType="bit",writeType="coil"]
    }

}


// Fire Alram
//slave 0x10 = 16
Bridge modbus:serial:slave0x10 [port="/dev/ttyACM0",baud=9600,id=16,stopBits="1.0",parity="none",dataBits=8,encoding="rtu"]{
    // OutputControlModule is fire alarm or Hooter
    // Discrete output Coils
    // Discrete register = 0xAC
    // 0xAC = 172d
    Bridge poller fireAlram [start=172,length=2,refresh=1000,type="holding"]
    {
        Thing data fireAlram1[readStart="172",readValueType="int32",writeStart="172",writeValueType="int32",writeType="holding"]
    }
}

.items

// Fire Alram
Number FireAlarm "FireAlarm_Value [%d]" <fire> {channel="modbus:data:slave0x10:fireAlram:fireAlram1:number"}
Switch FireAlarm_Switch "FireAlarm_Switch"  {channel="modbus:data:slave0x10:fireAlram:fireAlram1:switch"}

//Manual Call Point
Number Manual_Value "Manual_Call_Point [%d]" <wallswitch> {channel="modbus:data:slave01:inputControlModule:input1:number"}
Switch Manual_Switch "Manual_CallPoint_Switch [%d]" {channel="modbus:data:slave01:inputControlModule:input1:switch"}

//First Smoke Detector
Number SmokeDetector01    "SmokeDetector01_Value [%d]"  <smoke>  { channel="modbus:data:slave0x80:smokeDetector:smokeDetector01:number" }
Switch SmokeDetector01_Switch    "SmokeDetector01_Switch [%d]"  <smoke>  { channel="modbus:data:slave0x80:smokeDetector:smokeDetector01:switch" }
Switch ResetSmokeDetector01 "Reseting_SmokeDetector01 [%d]"    { channel="modbus:data:slave0x80:resetSmokeDetector:resetSmokeDetector01:switch" }

//Second Smoke Detector
Number SmokeDetector02    "SmokeDetector02_Value [%d]"  <smoke>  { channel="modbus:data:slave0x40:smokeDetector:smokeDetector02:number" }
Switch SmokeDetector02_Switch    "SmokeDetector02_Switch [%d]"  <smoke>  { channel="modbus:data:slave0x40:smokeDetector:smokeDetector02:switch" }
Switch ResetSmokeDetector02 "Reseting_SmokeDetector02 [%d]"    { channel="modbus:data:slave0x40:resetSmokeDetector:resetSmokeDetector02:switch" }

//Third Smoke Detector
Number SmokeDetector03    "SmokeDetector03_Value [%d]"  <smoke>  { channel="modbus:data:slave0x01:smokeDetector:smokeDetector03:number" }
Switch SmokeDetector03_Switch    "SmokeDetector03_Switch [%d]"  <smoke>  { channel="modbus:data:slave0x80:smokeDetector:smokeDetector03:switch" }
Switch ResetSmokeDetector03 "Reseting_SmokeDetector03 [%d]"    { channel="modbus:data:slave0x01:resetSmokeDetector:resetSmokeDetector03:switch" }

//Fourth Smoke Detector
Number SmokeDetector04    "SmokeDetector04_Value [%d]"  <smoke>  { channel="modbus:data:slave0x20:smokeDetector:smokeDetector04:number" }
Switch SmokeDetector04_Switch    "SmokeDetector04_Switch [%d]"  <smoke>  { channel="modbus:data:slave0x20:smokeDetector:smokeDetector04:switch" }
Switch ResetSmokeDetector04 "Reseting_SmokeDetector04 [%d]"    { channel="modbus:data:slave0x40:resetSmokeDetector:resetSmokeDetector04:switch" }

.log

5:19:09.518 [ERROR] [et.wimpi.modbus.io.ModbusRTUTransport] - Last request: 04 04 00 08 00 02 f0 5c
15:19:09.518 [ERROR] [et.wimpi.modbus.io.ModbusRTUTransport] - failed to read: CRC Error in received frame: 3 bytes: 04 04 00 
15:19:09.518 [ERROR] [mpi.modbus.io.ModbusSerialTransaction] - execute try 1/1 error: I/O exception: IOException CRC Error in received frame: 3 bytes: 04 04 00 . Request: net.wimpi.modbus.msg.ReadInputRegistersRequest@24d94233 (unit id 4 & transaction 7396). Serial parameters: SerialParameters@29f6f91c[portName=/dev/ttyACM0,baudRate=9600,flowControlIn=none,flowControlOut=none,databits=8,stopbits=1,parity=none,encoding=rtu,echo=false,receiveTimeoutMillis=1500]
grep: java.nio.file.NoSuchFileException: /var/lib/openhab2/queued15:19:09.518 [ERROR] [mpi.modbus.io.ModbusSerialTransaction] - execute reached max tries 1, throwing last error: I/O exception: IOException CRC Error in received frame: 3 bytes: 04 04 00 . Request: net.wimpi.modbus.msg.ReadInputRegistersRequest@24d94233 (unit id 4 & transaction 7396). Serial parameters: SerialParameters@29f6f91c[portName=/dev/ttyACM0,baudRate=9600,flowControlIn=none,flowControlOut=none,databits=8,stopbits=1,parity=none,encoding=rtu,echo=false,receiveTimeoutMillis=1500]

15:19:09.518 [WARN ] [ort.modbus.internal.ModbusManagerImpl] - Try 2 out of 3 failed when executing request (ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@3e6ecadb[slaveId=4,functionCode=READ_INPUT_REGISTERS,start=8,length=2,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 CRC Error in received frame: 3 bytes: 04 04 00  [operation ID 71bd894e-f23c-47c1-a2ea-da1dcfb9ca5b]
15:19:09.519 [TRACE] [ling.ModbusSlaveConnectionFactoryImpl] - destroyObject for connection SerialConnection@182eac6d[portName=/dev/ttyACM0,port=/dev/ttyACM0] and endpoint ModbusSerialSlaveEndpoint@7b6c5372[portName=/dev/ttyACM0] -> closing the connection
15:19:09.561 [TRACE] [ling.ModbusSlaveConnectionFactoryImpl] - Created connection SerialConnection@3ab69fb8[portName=/dev/ttyACM0,port=<null>] for endpoint ModbusSerialSlaveEndpoint@7b6c5372[portName=/dev/ttyACM0]
15:19:09.561 [TRACE] [ling.ModbusSlaveConnectionFactoryImpl] - Passivating connection SerialConnection@3ab69fb8[portName=/dev/ttyACM0,port=<null>] for endpoint ModbusSerialSlaveEndpoint@7b6c5372[portName=/dev/ttyACM0]...
15:19:09.561 [TRACE] [ling.ModbusSlaveConnectionFactoryImpl] - (passivate) Connection SerialConnection@3ab69fb8[portName=/dev/ttyACM0,port=<null>] (endpoint ModbusSerialSlaveEndpoint@7b6c5372[portName=/dev/ttyACM0]) age (1554112149561ms) is below the reconnectAfterMillis (-1ms) limit and connection time (0) is after the "disconnectBeforeConnectedMillis"=-1. Keep the connection open.
15:19:09.562 [TRACE] [ling.ModbusSlaveConnectionFactoryImpl] - ...Passivated connection SerialConnection@3ab69fb8[portName=/dev/ttyACM0,port=<null>] for endpoint ModbusSerialSlaveEndpoint@7b6c5372[portName=/dev/ttyACM0]
15:19:09.562 [TRACE] [ort.modbus.internal.ModbusManagerImpl] - invalidating connection for endpoint ModbusSerialSlaveEndpoint@7b6c5372[portName=/dev/ttyACM0] took 43 ms
15:19:09.562 [TRACE] [ort.modbus.internal.ModbusManagerImpl] - Executing task BasicPollTaskImpl@3a515949[request=ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@3e6ecadb[slaveId=4,functionCode=READ_INPUT_REGISTERS,start=8,length=2,maxTries=3],endpoint=ModbusSerialSlaveEndpoint@7b6c5372[portName=/dev/ttyACM0],callback=org.openhab.binding.modbus.internal.handler.ModbusPollerThingHandlerImpl$ReadCallbackDelegator@818e012] (oneOff=false)! Waiting for connection. Idle connections for this endpoint: 0, and active 1 [operation ID 71bd894e-f23c-47c1-a2ea-da1dcfb9ca5b]
15:19:10.501 [TRACE] [ling.ModbusSlaveConnectionFactoryImpl] - Waited 939ms (interConnectDelayMillis 1000ms, interTransactionDelayMillis 35ms) before connecting disconnected connection SerialConnection@3ab69fb8[portName=/dev/ttyACM0,port=<null>] for endpoint ModbusSerialSlaveEndpoint@22a6ff3d[portName=/dev/ttyACM0], to allow delay between connections re-connects
15:19:10.502 [TRACE] [net.wimpi.modbus.net.SerialConnection] - Got Port Identifier
15:19:10.508 [TRACE] [net.wimpi.modbus.net.SerialConnection] - Got Serial Port
15:19:10.508 [TRACE] [net.wimpi.modbus.net.SerialConnection] - i/o Streams prepared
15:19:10.508 [TRACE] [ling.ModbusSlaveConnectionFactoryImpl] - Waited 0ms (interTransactionDelayMillis 35ms) before giving returning connection SerialConnection@3ab69fb8[portName=/dev/ttyACM0,port=/dev/ttyACM0] for endpoint ModbusSerialSlaveEndpoint@22a6ff3d[portName=/dev/ttyACM0], to ensure delay between transactions.
15:19:10.509 [TRACE] [ort.modbus.internal.ModbusManagerImpl] - borrowing connection (got Optional[SerialConnection@3ab69fb8[portName=/dev/ttyACM0,port=/dev/ttyACM0]]) for endpoint ModbusSerialSlaveEndpoint@22a6ff3d[portName=/dev/ttyACM0] took 5572 ms
15:19:10.509 [TRACE] [ort.modbus.internal.ModbusManagerImpl] - Executing task BasicPollTaskImpl@5d411317[request=ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@607b1c96[slaveId=32,functionCode=READ_INPUT_REGISTERS,start=8,length=2,maxTries=3],endpoint=ModbusSerialSlaveEndpoint@22a6ff3d[portName=/dev/ttyACM0],callback=org.openhab.binding.modbus.internal.handler.ModbusPollerThingHandlerImpl$ReadCallbackDelegator@329aa566] (oneOff=false)! Connection received in 5572 ms [operation ID f4fddf7d-7f7c-4a51-8c4f-b92a4cf5c76c]
15:19:10.509 [TRACE] [ort.modbus.internal.ModbusManagerImpl] - Try 2 out of 3 [operation ID f4fddf7d-7f7c-4a51-8c4f-b92a4cf5c76c]
15:19:10.509 [TRACE] [ort.modbus.internal.ModbusManagerImpl] - Ensuring that enough time passes before retrying again. Sleeping if necessary [operation ID f4fddf7d-7f7c-4a51-8c4f-b92a4cf5c76c]
15:19:10.509 [TRACE] [ort.modbus.internal.ModbusManagerImpl] - Sleep ended, slept 0 [operation ID f4fddf7d-7f7c-4a51-8c4f-b92a4cf5c76c]
15:19:10.509 [TRACE] [ort.modbus.internal.ModbusManagerImpl] - Going execute transaction with request request (FC=READ_INPUT_REGISTERS): 00 00 00 00 00 06 20 04 00 08 00 02  [operation ID f4fddf7d-7f7c-4a51-8c4f-b92a4cf5c76c]
15:19:10.510 [DEBUG] [et.wimpi.modbus.io.ModbusRTUTransport] - Sent: 20 04 00 08 00 02 f6 b8 
15:19:10.523 [TRACE] [et.wimpi.modbus.io.ModbusRTUTransport] - Managed to read at least one byte
15:19:10.527 [DEBUG] [et.wimpi.modbus.io.ModbusRTUTransport] - Response: 20 04 00 02 00 
15:19:10.528 [ERROR] [et.wimpi.modbus.io.ModbusRTUTransport] - Last request: 20 04 00 08 00 02 f6 b8
15:19:10.528 [ERROR] [et.wimpi.modbus.io.ModbusRTUTransport] - failed to read: CRC Error in received frame: 3 bytes: 20 04 00 
15:19:10.528 [ERROR] [mpi.modbus.io.ModbusSerialTransaction] - execute try 1/1 error: I/O exception: IOException CRC Error in received frame: 3 bytes: 20 04 00 . Request: net.wimpi.modbus.msg.ReadInputRegistersRequest@6af5510c (unit id 32 & transaction 7397). Serial parameters: SerialParameters@18a3aaba[portName=/dev/ttyACM0,baudRate=9600,flowControlIn=none,flowControlOut=none,databits=8,stopbits=1,parity=none,encoding=rtu,echo=false,receiveTimeoutMillis=1500]
15:19:10.528 [ERROR] [mpi.modbus.io.ModbusSerialTransaction] - execute reached max tries 1, throwing last error: I/O exception: IOException CRC Error in received frame: 3 bytes: 20 04 00 . Request: net.wimpi.modbus.msg.ReadInputRegistersRequest@6af5510c (unit id 32 & transaction 7397). Serial parameters: SerialParameters@18a3aaba[portName=/dev/ttyACM0,baudRate=9600,flowControlIn=none,flowControlOut=none,databits=8,stopbits=1,parity=none,encoding=rtu,echo=false,receiveTimeoutMillis=1500]
15:19:10.529 [WARN ] [ort.modbus.internal.ModbusManagerImpl] - Try 2 out of 3 failed when executing request (ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@607b1c96[slaveId=32,functionCode=READ_INPUT_REGISTERS,start=8,length=2,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 CRC Error in received frame: 3 bytes: 20 04 00  [operation ID f4fddf7d-7f7c-4a51-8c4f-b92a4cf5c76c]
15:19:10.529 [TRACE] [ling.ModbusSlaveConnectionFactoryImpl] - destroyObject for connection SerialConnection@3ab69fb8[portName=/dev/ttyACM0,port=/dev/ttyACM0] and endpoint ModbusSerialSlaveEndpoint@22a6ff3d[portName=/dev/ttyACM0] -> closing the connection
15:19:10.569 [TRACE] [ling.ModbusSlaveConnectionFactoryImpl] - Created connection SerialConnection@66176eb7[portName=/dev/ttyACM0,port=<null>] for endpoint ModbusSerialSlaveEndpoint@22a6ff3d[portName=/dev/ttyACM0]
15:19:10.570 [TRACE] [ling.ModbusSlaveConnectionFactoryImpl] - Passivating connection SerialConnection@66176eb7[portName=/dev/ttyACM0,port=<null>] for endpoint ModbusSerialSlaveEndpoint@22a6ff3d[portName=/dev/ttyACM0]...
15:19:10.570 [TRACE] [ling.ModbusSlaveConnectionFactoryImpl] - (passivate) Connection SerialConnection@66176eb7[portName=/dev/ttyACM0,port=<null>] (endpoint ModbusSerialSlaveEndpoint@22a6ff3d[portName=/dev/ttyACM0]) age (1554112150570ms) is below the reconnectAfterMillis (-1ms) limit and connection time (0) is after the "disconnectBeforeConnectedMillis"=-1. Keep the connection open.
15:19:10.570 [TRACE] [ling.ModbusSlaveConnectionFactoryImpl] - ...Passivated connection SerialConnection@66176eb7[portName=/dev/ttyACM0,port=<null>] for endpoint ModbusSerialSlaveEndpoint@22a6ff3d[portName=/dev/ttyACM0]
15:19:10.570 [TRACE] [ort.modbus.internal.ModbusManagerImpl] - invalidating connection for endpoint ModbusSerialSlaveEndpoint@22a6ff3d[portName=/dev/ttyACM0] took 41 ms
15:19:10.571 [TRACE] [ort.modbus.internal.ModbusManagerImpl] - Executing task BasicPollTaskImpl@5d411317[request=ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@607b1c96[slaveId=32,functionCode=READ_INPUT_REGISTERS,start=8,length=2,maxTries=3],endpoint=ModbusSerialSlaveEndpoint@22a6ff3d[portName=/dev/ttyACM0],callback=org.openhab.binding.modbus.internal.handler.ModbusPollerThingHandlerImpl$ReadCallbackDelegator@329aa566] (oneOff=false)! Waiting for connection. Idle connections for this endpoint: 0, and active 1 [operation ID f4fddf7d-7f7c-4a51-8c4f-b92a4cf5c76c]
15:19:11.508 [TRACE] [ling.ModbusSlaveConnectionFactoryImpl] - Waited 937ms (interConnectDelayMillis 1000ms, interTransactionDelayMillis 35ms) before connecting disconnected connection SerialConnection@66176eb7[portName=/dev/ttyACM0,port=<null>] for endpoint ModbusSerialSlaveEndpoint@27d60e81[portName=/dev/ttyACM0], to allow delay between connections re-connects
15:19:11.508 [TRACE] [net.wimpi.modbus.net.SerialConnection] - Got Port Identifier
15:19:11.514 [TRACE] [net.wimpi.modbus.net.SerialConnection] - Got Serial Port
15:19:11.514 [TRACE] [net.wimpi.modbus.net.SerialConnection] - i/o Streams prepared
15:19:11.515 [TRACE] [ling.ModbusSlaveConnectionFactoryImpl] - Waited 0ms (interTransactionDelayMillis 35ms) before giving returning connection SerialConnection@66176eb7[portName=/dev/ttyACM0,port=/dev/ttyACM0] for endpoint ModbusSerialSlaveEndpoint@27d60e81[portName=/dev/ttyACM0], to ensure delay between transactions.
15:19:11.515 [TRACE] [ort.modbus.internal.ModbusManagerImpl] - borrowing connection (got Optional[SerialConnection@66176eb7[portName=/dev/ttyACM0,port=/dev/ttyACM0]]) for endpoint ModbusSerialSlaveEndpoint@27d60e81[portName=/dev/ttyACM0] took 4034 ms
15:19:11.515 [TRACE] [ort.modbus.internal.ModbusManagerImpl] - Executing task BasicPollTaskImpl@405e49bd[request=ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@65e2d032[slaveId=16,functionCode=READ_MULTIPLE_REGISTERS,start=172,length=2,maxTries=3],endpoint=ModbusSerialSlaveEndpoint@27d60e81[portName=/dev/ttyACM0],callback=org.openhab.binding.modbus.internal.handler.ModbusPollerThingHandlerImpl$ReadCallbackDelegator@49307ecd] (oneOff=false)! Connection received in 4034 ms [operation ID 20790bb3-3d5b-47e3-bc6d-690f140bd0ba]
15:19:11.515 [TRACE] [ort.modbus.internal.ModbusManagerImpl] - Try 2 out of 3 [operation ID 20790bb3-3d5b-47e3-bc6d-690f140bd0ba]
15:19:11.516 [TRACE] [ort.modbus.internal.ModbusManagerImpl] - Ensuring that enough time passes before retrying again. Sleeping if necessary [operation ID 20790bb3-3d5b-47e3-bc6d-690f140bd0ba]
15:19:11.516 [TRACE] [ort.modbus.internal.ModbusManagerImpl] - Sleep ended, slept 0 [operation ID 20790bb3-3d5b-47e3-bc6d-690f140bd0ba]
15:19:11.516 [TRACE] [ort.modbus.internal.ModbusManagerImpl] - Going execute transaction with request request (FC=READ_MULTIPLE_REGISTERS): 00 00 00 00 00 06 10 03 00 ac 00 02  [operation ID 20790bb3-3d5b-47e3-bc6d-690f140bd0ba]
15:19:11.516 [DEBUG] [et.wimpi.modbus.io.ModbusRTUTransport] - Sent: 10 03 00 ac 00 02 07 6b 
15:19:13.018 [TRACE] [et.wimpi.modbus.io.ModbusRTUTransport] - Managed to read at least one byte
15:19:13.020 [ERROR] [et.wimpi.modbus.io.ModbusRTUTransport] - Last request: 10 03 00 ac 00 02 07 6b
15:19:13.021 [ERROR] [et.wimpi.modbus.io.ModbusRTUTransport] - failed to read: Error reading response (EOF)
15:19:13.022 [ERROR] [mpi.modbus.io.ModbusSerialTransaction] - execute try 1/1 error: I/O exception: IOException Error reading response (EOF). Request: net.wimpi.modbus.msg.ReadMultipleRegistersRequest@42789b96 (unit id 16 & transaction 7398). Serial parameters: SerialParameters@64dfe7f[portName=/dev/ttyACM0,baudRate=9600,flowControlIn=none,flowControlOut=none,databits=8,stopbits=1,parity=none,encoding=rtu,echo=false,receiveTimeoutMillis=1500]
15:19:13.024 [ERROR] [mpi.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@42789b96 (unit id 16 & transaction 7398). Serial parameters: SerialParameters@64dfe7f[portName=/dev/ttyACM0,baudRate=9600,flowControlIn=none,flowControlOut=none,databits=8,stopbits=1,parity=none,encoding=rtu,echo=false,receiveTimeoutMillis=1500]
15:19:13.024 [WARN ] [ort.modbus.internal.ModbusManagerImpl] - Try 2 out of 3 failed when executing request (ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@65e2d032[slaveId=16,functionCode=READ_MULTIPLE_REGISTERS,start=172,length=2,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 20790bb3-3d5b-47e3-bc6d-690f140bd0ba]
15:19:13.025 [TRACE] [ling.ModbusSlaveConnectionFactoryImpl] - destroyObject for connection SerialConnection@66176eb7[portName=/dev/ttyACM0,port=/dev/ttyACM0] and endpoint ModbusSerialSlaveEndpoint@27d60e81[portName=/dev/ttyACM0] -> closing the connection
15:19:13.121 [TRACE] [ling.ModbusSlaveConnectionFactoryImpl] - Created connection SerialConnection@3d76cd3a[portName=/dev/ttyACM0,port=<null>] for endpoint ModbusSerialSlaveEndpoint@27d60e81[portName=/dev/ttyACM0]
15:19:13.122 [TRACE] [ling.ModbusSlaveConnectionFactoryImpl] - Passivating connection SerialConnection@3d76cd3a[portName=/dev/ttyACM0,port=<null>] for endpoint ModbusSerialSlaveEndpoint@27d60e81[portName=/dev/ttyACM0]...
15:19:13.123 [TRACE] [ling.ModbusSlaveConnectionFactoryImpl] - (passivate) Connection SerialConnection@3d76cd3a[portName=/dev/ttyACM0,port=<null>] (endpoint ModbusSerialSlaveEndpoint@27d60e81[portName=/dev/ttyACM0]) age (1554112153123ms) is below the reconnectAfterMillis (-1ms) limit and connection time (0) is after the "disconnectBeforeConnectedMillis"=-1. Keep the connection open.
15:19:13.124 [TRACE] [ling.ModbusSlaveConnectionFactoryImpl] - ...Passivated connection SerialConnection@3d76cd3a[portName=/dev/ttyACM0,port=<null>] for endpoint ModbusSerialSlaveEndpoint@27d60e81[portName=/dev/ttyACM0]
15:19:13.124 [TRACE] [ort.modbus.internal.ModbusManagerImpl] - invalidating connection for endpoint ModbusSerialSlaveEndpoint@27d60e81[portName=/dev/ttyACM0] took 99 ms
15:19:13.125 [TRACE] [ort.modbus.internal.ModbusManagerImpl] - Executing task BasicPollTaskImpl@405e49bd[request=ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@65e2d032[slaveId=16,functionCode=READ_MULTIPLE_REGISTERS,start=172,length=2,maxTries=3],endpoint=ModbusSerialSlaveEndpoint@27d60e81[portName=/dev/ttyACM0],callback=org.openhab.binding.modbus.internal.handler.ModbusPollerThingHandlerImpl$ReadCallbackDelegator@49307ecd] (oneOff=false)! Waiting for connection. Idle connections for this endpoint: 0, and active 1 [operation ID 20790bb3-3d5b-47e3-bc6d-690f140bd0ba]
15:19:13.125 [TRACE] [net.wimpi.modbus.net.SerialConnection] - Got Port Identifier
15:19:13.134 [TRACE] [net.wimpi.modbus.net.SerialConnection] - Got Serial Port
15:19:13.135 [TRACE] [net.wimpi.modbus.net.SerialConnection] - i/o Streams prepared
15:19:13.159 [TRACE] [ling.ModbusSlaveConnectionFactoryImpl] - Waited 21ms (interTransactionDelayMillis 35ms) before giving returning connection SerialConnection@3d76cd3a[portName=/dev/ttyACM0,port=/dev/ttyACM0] for endpoint ModbusSerialSlaveEndpoint@501d49b1[portName=/dev/ttyACM0], to ensure delay between transactions.
15:19:13.160 [TRACE] [ort.modbus.internal.ModbusManagerImpl] - borrowing connection (got Optional[SerialConnection@3d76cd3a[portName=/dev/ttyACM0,port=/dev/ttyACM0]]) for endpoint ModbusSerialSlaveEndpoint@501d49b1[portName=/dev/ttyACM0] took 5580 ms
15:19:13.162 [TRACE] [ort.modbus.internal.ModbusManagerImpl] - Executing task BasicPollTaskImpl@3d3f7eaa[request=ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@69880c34[slaveId=128,functionCode=READ_INPUT_REGISTERS,start=8,length=2,maxTries=3],endpoint=ModbusSerialSlaveEndpoint@501d49b1[portName=/dev/ttyACM0],callback=org.openhab.binding.modbus.internal.handler.ModbusPollerThingHandlerImpl$ReadCallbackDelegator@329abbec] (oneOff=false)! Connection received in 5582 ms [operation ID 1b815eb9-58ff-4136-85f1-92488104ab99]
15:19:13.163 [TRACE] [ort.modbus.internal.ModbusManagerImpl] - Try 2 out of 3 [operation ID 1b815eb9-58ff-4136-85f1-92488104ab99]
15:19:13.168 [TRACE] [ort.modbus.internal.ModbusManagerImpl] - Ensuring that enough time passes before retrying again. Sleeping if necessary [operation ID 1b815eb9-58ff-4136-85f1-92488104ab99]
15:19:13.168 [TRACE] [ort.modbus.internal.ModbusManagerImpl] - Sleep ended, slept 0 [operation ID 1b815eb9-58ff-4136-85f1-92488104ab99]
15:19:13.169 [TRACE] [ort.modbus.internal.ModbusManagerImpl] - Going execute transaction with request request (FC=READ_INPUT_REGISTERS): 00 00 00 00 00 06 80 04 00 08 00 02  [operation ID 1b815eb9-58ff-4136-85f1-92488104ab99]
15:19:13.169 [DEBUG] [et.wimpi.modbus.io.ModbusRTUTransport] - Sent: 80 04 00 08 00 02 ee 18 
15:19:13.183 [TRACE] [et.wimpi.modbus.io.ModbusRTUTransport] - Managed to read at least one byte
15:19:13.187 [DEBUG] [et.wimpi.modbus.io.ModbusRTUTransport] - Response: 80 04 00 02 00 
15:19:13.188 [ERROR] [et.wimpi.modbus.io.ModbusRTUTransport] - Last request: 80 04 00 08 00 02 ee 18
15:19:13.188 [ERROR] [et.wimpi.modbus.io.ModbusRTUTransport] - failed to read: CRC Error in received frame: 3 bytes: 80 04 00 
15:19:13.189 [ERROR] [mpi.modbus.io.ModbusSerialTransaction] - execute try 1/1 error: I/O exception: IOException CRC Error in received frame: 3 bytes: 80 04 00 . Request: net.wimpi.modbus.msg.ReadInputRegistersRequest@3fe0ed76 (unit id 128 & transaction 7399). Serial parameters: SerialParameters@61fc8efc[portName=/dev/ttyACM0,baudRate=9600,flowControlIn=none,flowControlOut=none,databits=8,stopbits=1,parity=none,encoding=rtu,echo=false,receiveTimeoutMillis=1500]
15:19:13.189 [ERROR] [mpi.modbus.io.ModbusSerialTransaction] - execute reached max tries 1, throwing last error: I/O exception: IOException CRC Error in received frame: 3 bytes: 80 04 00 . Request: net.wimpi.modbus.msg.ReadInputRegistersRequest@3fe0ed76 (unit id 128 & transaction 7399). Serial parameters: SerialParameters@61fc8efc[portName=/dev/ttyACM0,baudRate=9600,flowControlIn=none,flowControlOut=none,databits=8,stopbits=1,parity=none,encoding=rtu,echo=false,receiveTimeoutMillis=1500]
15:19:13.190 [WARN ] [ort.modbus.internal.ModbusManagerImpl] - Try 2 out of 3 failed when executing request (ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@69880c34[slaveId=128,functionCode=READ_INPUT_REGISTERS,start=8,length=2,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 CRC Error in received frame: 3 bytes: 80 04 00  [operation ID 1b815eb9-58ff-4136-85f1-92488104ab99]
15:19:13.190 [TRACE] [ling.ModbusSlaveConnectionFactoryImpl] - destroyObject for connection SerialConnection@3d76cd3a[portName=/dev/ttyACM0,port=/dev/ttyACM0] and endpoint ModbusSerialSlaveEndpoint@501d49b1[portName=/dev/ttyACM0] -> closing the connection
15:19:13.224 [TRACE] [ling.ModbusSlaveConnectionFactoryImpl] - Created connection SerialConnection@3d75375e[portName=/dev/ttyACM0,port=<null>] for endpoint ModbusSerialSlaveEndpoint@501d49b1[portName=/dev/ttyACM0]
15:19:13.225 [TRACE] [ling.ModbusSlaveConnectionFactoryImpl] - Passivating connection SerialConnection@3d75375e[portName=/dev/ttyACM0,port=<null>] for endpoint ModbusSerialSlaveEndpoint@501d49b1[portName=/dev/ttyACM0]...
15:19:13.226 [TRACE] [ling.ModbusSlaveConnectionFactoryImpl] - (passivate) Connection SerialConnection@3d75375e[portName=/dev/ttyACM0,port=<null>] (endpoint ModbusSerialSlaveEndpoint@501d49b1[portName=/dev/ttyACM0]) age (1554112153226ms) is below the reconnectAfterMillis (-1ms) limit and connection time (0) is after the "disconnectBeforeConnectedMillis"=-1. Keep the connection open.
15:19:13.226 [TRACE] [ling.ModbusSlaveConnectionFactoryImpl] - ...Passivated connection SerialConnection@3d75375e[portName=/dev/ttyACM0,port=<null>] for endpoint ModbusSerialSlaveEndpoint@501d49b1[portName=/dev/ttyACM0]
15:19:13.226 [TRACE] [ort.modbus.internal.ModbusManagerImpl] - invalidating connection for endpoint ModbusSerialSlaveEndpoint@501d49b1[portName=/dev/ttyACM0] took 36 ms
15:19:13.227 [TRACE] [ort.modbus.internal.ModbusManagerImpl] - Executing task BasicPollTaskImpl@3d3f7eaa[request=ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@69880c34[slaveId=128,functionCode=READ_INPUT_REGISTERS,start=8,length=2,maxTries=3],endpoint=ModbusSerialSlaveEndpoint@501d49b1[portName=/dev/ttyACM0],callback=org.openhab.binding.modbus.internal.handler.ModbusPollerThingHandlerImpl$ReadCallbackDelegator@329abbec] (oneOff=false)! Waiting for connection. Idle connections for this endpoint: 0, and active 1 [operation ID 1b815eb9-58ff-4136-85f1-92488104ab99]
15:19:14.137 [TRACE] [ling.ModbusSlaveConnectionFactoryImpl] - Waited 910ms (interConnectDelayMillis 1000ms, interTransactionDelayMillis 35ms) before connecting disconnected connection SerialConnection@3d75375e[portName=/dev/ttyACM0,port=<null>] for endpoint ModbusSerialSlaveEndpoint@17072183[portName=/dev/ttyACM0], to allow delay between connections re-connects
15:19:14.138 [TRACE] [net.wimpi.modbus.net.SerialConnection] - Got Port Identifier
15:19:14.145 [TRACE] [net.wimpi.modbus.net.SerialConnection] - Got Serial Port
15:19:14.146 [TRACE] [net.wimpi.modbus.net.SerialConnection] - i/o Streams prepared
15:19:14.146 [TRACE] [ling.ModbusSlaveConnectionFactoryImpl] - Waited 0ms (interTransactionDelayMillis 35ms) before giving returning connection SerialConnection@3d75375e[portName=/dev/ttyACM0,port=/dev/ttyACM0] for endpoint ModbusSerialSlaveEndpoint@17072183[portName=/dev/ttyACM0], to ensure delay between transactions.
15:19:14.147 [TRACE] [ort.modbus.internal.ModbusManagerImpl] - borrowing connection (got Optional[SerialConnection@3d75375e[portName=/dev/ttyACM0,port=/dev/ttyACM0]]) for endpoint ModbusSerialSlaveEndpoint@17072183[portName=/dev/ttyACM0] took 5590 ms
15:19:14.148 [TRACE] [ort.modbus.internal.ModbusManagerImpl] - Executing task BasicPollTaskImpl@6f9a43ba[request=ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@c19d0d4[slaveId=64,functionCode=READ_INPUT_REGISTERS,start=8,length=2,maxTries=3],endpoint=ModbusSerialSlaveEndpoint@17072183[portName=/dev/ttyACM0],callback=org.openhab.binding.modbus.internal.handler.ModbusPollerThingHandlerImpl$ReadCallbackDelegator@329aace8] (oneOff=false)! Connection received in 5591 ms [operation ID 452bab5e-5eff-49aa-872e-7add789af404]
15:19:14.148 [TRACE] [ort.modbus.internal.ModbusManagerImpl] - Try 3 out of 3 [operation ID 452bab5e-5eff-49aa-872e-7add789af404]
15:19:14.148 [TRACE] [ort.modbus.internal.ModbusManagerImpl] - Ensuring that enough time passes before retrying again. Sleeping if necessary [operation ID 452bab5e-5eff-49aa-872e-7add789af404]
15:19:14.149 [TRACE] [ort.modbus.internal.ModbusManagerImpl] - Sleep ended, slept 0 [operation ID 452bab5e-5eff-49aa-872e-7add789af404]
15:19:14.153 [TRACE] [ort.modbus.internal.ModbusManagerImpl] - Going execute transaction with request request (FC=READ_INPUT_REGISTERS): 00 00 00 00 00 06 40 04 00 08 00 02  [operation ID 452bab5e-5eff-49aa-872e-7add789af404]
15:19:14.154 [DEBUG] [et.wimpi.modbus.io.ModbusRTUTransport] - Sent: 40 04 00 08 00 02 ff 18 
15:19:14.173 [TRACE] [et.wimpi.modbus.io.ModbusRTUTransport] - Managed to read at least one byte
15:19:14.178 [DEBUG] [et.wimpi.modbus.io.ModbusRTUTransport] - Response: 40 04 00 02 00 
15:19:14.180 [ERROR] [et.wimpi.modbus.io.ModbusRTUTransport] - Last request: 40 04 00 08 00 02 ff 18
15:19:14.182 [ERROR] [et.wimpi.modbus.io.ModbusRTUTransport] - failed to read: CRC Error in received frame: 3 bytes: 40 04 00 
15:19:14.184 [ERROR] [mpi.modbus.io.ModbusSerialTransaction] - execute try 1/1 error: I/O exception: IOException CRC Error in received frame: 3 bytes: 40 04 00 . Request: net.wimpi.modbus.msg.ReadInputRegistersRequest@cdc247e (unit id 64 & transaction 7400). Serial parameters: SerialParameters@22ec164a[portName=/dev/ttyACM0,baudRate=9600,flowControlIn=none,flowControlOut=none,databits=8,stopbits=1,parity=none,encoding=rtu,echo=false,receiveTimeoutMillis=1500]
15:19:14.185 [ERROR] [mpi.modbus.io.ModbusSerialTransaction] - execute reached max tries 1, throwing last error: I/O exception: IOException CRC Error in received frame: 3 bytes: 40 04 00 . Request: net.wimpi.modbus.msg.ReadInputRegistersRequest@cdc247e (unit id 64 & transaction 7400). Serial parameters: SerialParameters@22ec164a[portName=/dev/ttyACM0,baudRate=9600,flowControlIn=none,flowControlOut=none,databits=8,stopbits=1,parity=none,encoding=rtu,echo=false,receiveTimeoutMillis=1500]
15:19:14.185 [ERROR] [ort.modbus.internal.ModbusManagerImpl] - Last try 3 failed when executing request (ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@c19d0d4[slaveId=64,functionCode=READ_INPUT_REGISTERS,start=8,length=2,maxTries=3]). Aborting. Error was I/O error, so reseting the connection. Error details: net.wimpi.modbus.ModbusIOException I/O exception: IOException CRC Error in received frame: 3 bytes: 40 04 00  [operation ID 452bab5e-5eff-49aa-872e-7add789af404]
15:19:14.185 [TRACE] [ling.ModbusSlaveConnectionFactoryImpl] - destroyObject for connection SerialConnection@3d75375e[portName=/dev/ttyACM0,port=/dev/ttyACM0] and endpoint ModbusSerialSlaveEndpoint@17072183[portName=/dev/ttyACM0] -> closing the connection
15:19:14.215 [TRACE] [ling.ModbusSlaveConnectionFactoryImpl] - Created connection SerialConnection@18e7b414[portName=/dev/ttyACM0,port=<null>] for endpoint ModbusSerialSlaveEndpoint@17072183[portName=/dev/ttyACM0]
15:19:14.217 [TRACE] [ling.ModbusSlaveConnectionFactoryImpl] - Passivating connection SerialConnection@18e7b414[portName=/dev/ttyACM0,port=<null>] for endpoint ModbusSerialSlaveEndpoint@17072183[portName=/dev/ttyACM0]...
15:19:14.218 [TRACE] [ling.ModbusSlaveConnectionFactoryImpl] - (passivate) Connection SerialConnection@18e7b414[portName=/dev/ttyACM0,port=<null>] (endpoint ModbusSerialSlaveEndpoint@17072183[portName=/dev/ttyACM0]) age (1554112154218ms) is below the reconnectAfterMillis (-1ms) limit and connection time (0) is after the "disconnectBeforeConnectedMillis"=-1. Keep the connection open.
15:19:14.220 [TRACE] [ling.ModbusSlaveConnectionFactoryImpl] - ...Passivated connection SerialConnection@18e7b414[portName=/dev/ttyACM0,port=<null>] for endpoint ModbusSerialSlaveEndpoint@17072183[portName=/dev/ttyACM0]
15:19:14.221 [TRACE] [ort.modbus.internal.ModbusManagerImpl] - invalidating connection for endpoint ModbusSerialSlaveEndpoint@17072183[portName=/dev/ttyACM0] took 36 ms
15:19:14.221 [TRACE] [ort.modbus.internal.ModbusManagerImpl] - Calling write response callback org.openhab.binding.modbus.internal.handler.ModbusPollerThingHandlerImpl$ReadCallbackDelegator@329aace8 for request ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@c19d0d4[slaveId=64,functionCode=READ_INPUT_REGISTERS,start=8,length=2,maxTries=3]. Error was org.openhab.io.transport.modbus.internal.ModbusSlaveIOExceptionImpl Modbus IO Error with cause=ModbusIOException, EOF=false, message='I/O exception: IOException CRC Error in received frame: 3 bytes: 40 04 00 ', cause2=null
15:19:14.222 [TRACE] [ort.modbus.internal.ModbusManagerImpl] - Called write response callback org.openhab.binding.modbus.internal.handler.ModbusPollerThingHandlerImpl$ReadCallbackDelegator@329aace8 for request ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@c19d0d4[slaveId=64,functionCode=READ_INPUT_REGISTERS,start=8,length=2,maxTries=3]. Error was org.openhab.io.transport.modbus.internal.ModbusSlaveIOExceptionImpl Modbus IO Error with cause=ModbusIOException, EOF=false, message='I/O exception: IOException CRC Error in received frame: 3 bytes: 40 04 00 ', cause2=null
15:19:14.222 [TRACE] [ort.modbus.internal.ModbusManagerImpl] - returning connection for endpoint ModbusSerialSlaveEndpoint@17072183[portName=/dev/ttyACM0] took 0 ms
15:19:14.222 [TRACE] [ort.modbus.internal.ModbusManagerImpl] - Connection was returned to the pool, ending operation [operation ID 452bab5e-5eff-49aa-872e-7add789af404]
15:19:14.223 [DEBUG] [ort.modbus.internal.ModbusManagerImpl] - Modbus operation ended, timing info: {total: 16929 ms, connection: 16844, transaction=74, callback=1} [operation ID 452bab5e-5eff-49aa-872e-7add789af404]
15:19:14.223 [DEBUG] [ort.modbus.internal.ModbusManagerImpl] - Execution of scheduled (1000ms) poll task BasicPollTaskImpl@6f9a43ba[request=ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@c19d0d4[slaveId=64,functionCode=READ_INPUT_REGISTERS,start=8,length=2,maxTries=3],endpoint=ModbusSerialSlaveEndpoint@17072183[portName=/dev/ttyACM0],callback=org.openhab.binding.modbus.internal.handler.ModbusPollerThingHandlerImpl$ReadCallbackDelegator@329aace8] finished at 1554112154223. Was started at millis: 1554112137294 (=duration of 16929 millis)
15:19:14.223 [DEBUG] [ort.modbus.internal.ModbusManagerImpl] - Executing scheduled (1000ms) poll task BasicPollTaskImpl@7b24be69[request=ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@399ec2a9[slaveId=1,functionCode=READ_INPUT_REGISTERS,start=8,length=2,maxTries=3],endpoint=ModbusSerialSlaveEndpoint@38c4b77[portName=/dev/ttyACM0],callback=org.openhab.binding.modbus.internal.handler.ModbusPollerThingHandlerImpl$ReadCallbackDelegator@329a9e03]. Current millis: 1554112154223
15:19:14.223 [INFO ] [smarthome.event.ThingStatusInfoEvent ] - 'modbus:data:slave0x40:smokeDetector:smokeDetector02' updated: OFFLINE (COMMUNICATION_ERROR): Error (ModbusSlaveIOExceptionImpl) with read. Request: ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@c19d0d4[slaveId=64,functionCode=READ_INPUT_REGISTERS,start=8,length=2,maxTries=3]. Description: ModbusSlaveIOException(cause=ModbusIOException, EOF=false, message='I/O exception: IOException CRC Error in received frame: 3 bytes: 40 04 00 ', cause2=null). Message: Modbus IO Error with cause=ModbusIOException, EOF=false, message='I/O exception: IOException CRC Error in received frame: 3 bytes: 40 04 00 ', cause2=null
15:19:14.224 [TRACE] [nternal.ModbusManagerImpl.PollMonitor] - <POLL MONITOR>
15:19:14.224 [INFO ] [smarthome.event.ThingStatusInfoEvent ] - 'modbus:poller:slave0x40:smokeDetector' updated: OFFLINE (COMMUNICATION_ERROR): Error with read: org.openhab.io.transport.modbus.internal.ModbusSlaveIOExceptionImpl: Modbus IO Error with cause=ModbusIOException, EOF=false, message='I/O exception: IOException CRC Error in received frame: 3 bytes: 40 04 00 ', cause2=null
15:19:14.224 [TRACE] [nternal.ModbusManagerImpl.PollMonitor] - POLL MONITOR: scheduled poll task. FC: READ_INPUT_REGISTERS, start 8, length 2, done: false, canceled: false, delay: -14933. Full task BasicPollTaskImpl@5d411317[request=ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@607b1c96[slaveId=32,functionCode=READ_INPUT_REGISTERS,start=8,length=2,maxTries=3],endpoint=ModbusSerialSlaveEndpoint@22a6ff3d[portName=/dev/ttyACM0],callback=org.openhab.binding.modbus.internal.handler.ModbusPollerThingHandlerImpl$ReadCallbackDelegator@329aa566]
15:19:14.226 [TRACE] [nternal.ModbusManagerImpl.PollMonitor] - POLL MONITOR: scheduled poll task. FC: READ_INPUT_REGISTERS, start 8, length 2, done: false, canceled: false, delay: 997. Full task BasicPollTaskImpl@6f9a43ba[request=ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@c19d0d4[slaveId=64,functionCode=READ_INPUT_REGISTERS,start=8,length=2,maxTries=3],endpoint=ModbusSerialSlaveEndpoint@17072183[portName=/dev/ttyACM0],callback=org.openhab.binding.modbus.internal.handler.ModbusPollerThingHandlerImpl$ReadCallbackDelegator@329aace8]
15:19:14.227 [TRACE] [nternal.ModbusManagerImpl.PollMonitor] - POLL MONITOR: scheduled poll task. FC: READ_MULTIPLE_REGISTERS, start 172, length 2, done: false, canceled: false, delay: -12388. Full task BasicPollTaskImpl@405e49bd[request=ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@65e2d032[slaveId=16,functionCode=READ_MULTIPLE_REGISTERS,start=172,length=2,maxTries=3],endpoint=ModbusSerialSlaveEndpoint@27d60e81[portName=/dev/ttyACM0],callback=org.openhab.binding.modbus.internal.handler.ModbusPollerThingHandlerImpl$ReadCallbackDelegator@49307ecd]
15:19:14.227 [TRACE] [nternal.ModbusManagerImpl.PollMonitor] - POLL MONITOR: scheduled poll task. FC: READ_INPUT_REGISTERS, start 8, length 2, done: false, canceled: false, delay: -16633. Full task BasicPollTaskImpl@3a515949[request=ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@3e6ecadb[slaveId=4,functionCode=READ_INPUT_REGISTERS,start=8,length=2,maxTries=3],endpoint=ModbusSerialSlaveEndpoint@7b6c5372[portName=/dev/ttyACM0],callback=org.openhab.binding.modbus.internal.handler.ModbusPollerThingHandlerImpl$ReadCallbackDelegator@818e012]
15:19:14.227 [TRACE] [nternal.ModbusManagerImpl.PollMonitor] - POLL MONITOR: scheduled poll task. FC: READ_INPUT_REGISTERS, start 8, length 2, done: false, canceled: false, delay: -12293. Full task BasicPollTaskImpl@3d3f7eaa[request=ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@69880c34[slaveId=128,functionCode=READ_INPUT_REGISTERS,start=8,length=2,maxTries=3],endpoint=ModbusSerialSlaveEndpoint@501d49b1[portName=/dev/ttyACM0],callback=org.openhab.binding.modbus.internal.handler.ModbusPollerThingHandlerImpl$ReadCallbackDelegator@329abbec]
15:19:14.228 [TRACE] [nternal.ModbusManagerImpl.PollMonitor] - POLL MONITOR: scheduled poll task. FC: READ_INPUT_REGISTERS, start 8, length 2, done: false, canceled: false, delay: -11315. Full task BasicPollTaskImpl@7b24be69[request=ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@399ec2a9[slaveId=1,functionCode=READ_INPUT_REGISTERS,start=8,length=2,maxTries=3],endpoint=ModbusSerialSlaveEndpoint@38c4b77[portName=/dev/ttyACM0],callback=org.openhab.binding.modbus.internal.handler.ModbusPollerThingHandlerImpl$ReadCallbackDelegator@329a9e03]
15:19:14.228 [TRACE] [nternal.ModbusManagerImpl.PollMonitor] - POLL MONITOR: scheduledThreadPoolExecutor queue size: 2, remaining space 2147483647. Active threads 5
15:19:14.228 [TRACE] [nternal.ModbusManagerImpl.PollMonitor] - </POLL MONITOR>
15:19:14.228 [TRACE] [ort.modbus.internal.ModbusManagerImpl] - Starting new operation with task BasicPollTaskImpl@7b24be69[request=ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@399ec2a9[slaveId=1,functionCode=READ_INPUT_REGISTERS,start=8,length=2,maxTries=3],endpoint=ModbusSerialSlaveEndpoint@38c4b77[portName=/dev/ttyACM0],callback=org.openhab.binding.modbus.internal.handler.ModbusPollerThingHandlerImpl$ReadCallbackDelegator@329a9e03]. Trying to get connection [operation ID 91d4a4d1-395c-4fdf-a562-0dda8554227c]
15:19:14.228 [TRACE] [ort.modbus.internal.ModbusManagerImpl] - Executing task BasicPollTaskImpl@7b24be69[request=ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@399ec2a9[slaveId=1,functionCode=READ_INPUT_REGISTERS,start=8,length=2,maxTries=3],endpoint=ModbusSerialSlaveEndpoint@38c4b77[portName=/dev/ttyACM0],callback=org.openhab.binding.modbus.internal.handler.ModbusPollerThingHandlerImpl$ReadCallbackDelegator@329a9e03] (oneOff=false)! Waiting for connection. Idle connections for this endpoint: 0, and active 1 [operation ID 91d4a4d1-395c-4fdf-a562-0dda8554227c]
15:19:15.146 [TRACE] [ling.ModbusSlaveConnectionFactoryImpl] - Waited 925ms (interConnectDelayMillis 1000ms, interTransactionDelayMillis 35ms) before connecting disconnected connection SerialConnection@18e7b414[portName=/dev/ttyACM0,port=<null>] for endpoint ModbusSerialSlaveEndpoint@7b6c5372[portName=/dev/ttyACM0], to allow delay between connections re-connects
15:19:15.147 [TRACE] [net.wimpi.modbus.net.SerialConnection] - Got Port Identifier
15:19:15.155 [TRACE] [net.wimpi.modbus.net.SerialConnection] - Got Serial Port
15:19:15.156 [TRACE] [net.wimpi.modbus.net.SerialConnection] - i/o Streams prepared
15:19:15.156 [TRACE] [ling.ModbusSlaveConnectionFactoryImpl] - Waited 0ms (interTransactionDelayMillis 35ms) before giving returning connection SerialConnection@18e7b414[portName=/dev/ttyACM0,port=/dev/ttyACM0] for endpoint ModbusSerialSlaveEndpoint@7b6c5372[portName=/dev/ttyACM0], to ensure delay between transactions.
15:19:15.157 [TRACE] [ort.modbus.internal.ModbusManagerImpl] - borrowing connection (got Optional[SerialConnection@18e7b414[portName=/dev/ttyACM0,port=/dev/ttyACM0]]) for endpoint ModbusSerialSlaveEndpoint@7b6c5372[portName=/dev/ttyACM0] took 5595 ms
15:19:15.157 [TRACE] [ort.modbus.internal.ModbusManagerImpl] - Executing task BasicPollTaskImpl@3a515949[request=ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@3e6ecadb[slaveId=4,functionCode=READ_INPUT_REGISTERS,start=8,length=2,maxTries=3],endpoint=ModbusSerialSlaveEndpoint@7b6c5372[portName=/dev/ttyACM0],callback=org.openhab.binding.modbus.internal.handler.ModbusPollerThingHandlerImpl$ReadCallbackDelegator@818e012] (oneOff=false)! Connection received in 5595 ms [operation ID 71bd894e-f23c-47c1-a2ea-da1dcfb9ca5b]
15:19:15.158 [TRACE] [ort.modbus.internal.ModbusManagerImpl] - Try 3 out of 3 [operation ID 71bd894e-f23c-47c1-a2ea-da1dcfb9ca5b]
15:19:15.158 [TRACE] [ort.modbus.internal.ModbusManagerImpl] - Ensuring that enough time passes before retrying again. Sleeping if necessary [operation ID 71bd894e-f23c-47c1-a2ea-da1dcfb9ca5b]
15:19:15.159 [TRACE] [ort.modbus.internal.ModbusManagerImpl] - Sleep ended, slept 0 [operation ID 71bd894e-f23c-47c1-a2ea-da1dcfb9ca5b]
15:19:15.161 [TRACE] [ort.modbus.internal.ModbusManagerImpl] - Going execute transaction with request request (FC=READ_INPUT_REGISTERS): 00 00 00 00 00 06 04 04 00 08 00 02  [operation ID 71bd894e-f23c-47c1-a2ea-da1dcfb9ca5b]
15:19:15.162 [DEBUG] [et.wimpi.modbus.io.ModbusRTUTransport] - Sent: 04 04 00 08 00 02 f0 5c 
15:19:15.173 [TRACE] [et.wimpi.modbus.io.ModbusRTUTransport] - Managed to read at least one byte
15:19:15.177 [DEBUG] [et.wimpi.modbus.io.ModbusRTUTransport] - Response: 04 04 00 01 00 
15:19:15.178 [ERROR] [et.wimpi.modbus.io.ModbusRTUTransport] - Last request: 04 04 00 08 00 02 f0 5c
15:19:15.178 [ERROR] [et.wimpi.modbus.io.ModbusRTUTransport] - failed to read: CRC Error in received frame: 3 bytes: 04 04 00 
15:19:15.179 [ERROR] [mpi.modbus.io.ModbusSerialTransaction] - execute try 1/1 error: I/O exception: IOException CRC Error in received frame: 3 bytes: 04 04 00 . Request: net.wimpi.modbus.msg.ReadInputRegistersRequest@2164008b (unit id 4 & transaction 7401). Serial parameters: SerialParameters@29f6f91c[portName=/dev/ttyACM0,baudRate=9600,flowControlIn=none,flowControlOut=none,databits=8,stopbits=1,parity=none,encoding=rtu,echo=false,receiveTimeoutMillis=1500]
15:19:15.179 [ERROR] [mpi.modbus.io.ModbusSerialTransaction] - execute reached max tries 1, throwing last error: I/O exception: IOException CRC Error in received frame: 3 bytes: 04 04 00 . Request: net.wimpi.modbus.msg.ReadInputRegistersRequest@2164008b (unit id 4 & transaction 7401). Serial parameters: SerialParameters@29f6f91c[portName=/dev/ttyACM0,baudRate=9600,flowControlIn=none,flowControlOut=none,databits=8,stopbits=1,parity=none,encoding=rtu,echo=false,receiveTimeoutMillis=1500]
15:19:15.180 [ERROR] [ort.modbus.internal.ModbusManagerImpl] - Last try 3 failed when executing request (ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@3e6ecadb[slaveId=4,functionCode=READ_INPUT_REGISTERS,start=8,length=2,maxTries=3]). Aborting. Error was I/O error, so reseting the connection. Error details: net.wimpi.modbus.ModbusIOException I/O exception: IOException CRC Error in received frame: 3 bytes: 04 04 00  [operation ID 71bd894e-f23c-47c1-a2ea-da1dcfb9ca5b]
15:19:15.180 [TRACE] [ling.ModbusSlaveConnectionFactoryImpl] - destroyObject for connection SerialConnection@18e7b414[portName=/dev/ttyACM0,port=/dev/ttyACM0] and endpoint ModbusSerialSlaveEndpoint@7b6c5372[portName=/dev/ttyACM0] -> closing the connection



Please help me to solve the issue…

Events.log

2019-04-01 16:28:08.906 [event.ThingStatusInfoEvent] - 'modbus:data:slave0x80:smokeDetector:smokeDetector01' updated: OFFLINE (COMMUNICATION_ERROR): Error (ModbusSlaveIOExceptionImpl) with read. Request: ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@69880c34[slaveId=128,functionCode=READ_INPUT_REGISTERS,start=8,length=2,maxTries=3]. Description: ModbusSlaveIOException(cause=ModbusIOException, EOF=false, message='I/O exception: IOException CRC Error in received frame: 3 bytes: 80 04 00 ', cause2=null). Message: Modbus IO Error with cause=ModbusIOException, EOF=false, message='I/O exception: IOException CRC Error in received frame: 3 bytes: 80 04 00 ', cause2=null
2019-04-01 16:28:08.906 [event.ThingStatusInfoEvent] - 'modbus:poller:slave0x80:smokeDetector' updated: OFFLINE (COMMUNICATION_ERROR): Error with read: org.openhab.io.transport.modbus.internal.ModbusSlaveIOExceptionImpl: Modbus IO Error with cause=ModbusIOException, EOF=false, message='I/O exception: IOException CRC Error in received frame: 3 bytes: 80 04 00 ', cause2=null
2019-04-01 16:28:09.869 [event.ThingStatusInfoEvent] - 'modbus:data:slave0x01:smokeDetector:smokeDetector03' updated: OFFLINE (COMMUNICATION_ERROR): Error (ModbusSlaveIOExceptionImpl) with read. Request: ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@399ec2a9[slaveId=1,functionCode=READ_INPUT_REGISTERS,start=8,length=2,maxTries=3]. Description: ModbusSlaveIOException(cause=ModbusIOException, EOF=false, message='I/O exception: IOException CRC Error in received frame: 3 bytes: 01 04 00 ', cause2=null). Message: Modbus IO Error with cause=ModbusIOException, EOF=false, message='I/O exception: IOException CRC Error in received frame: 3 bytes: 01 04 00 ', cause2=null
2019-04-01 16:28:09.869 [event.ThingStatusInfoEvent] - 'modbus:poller:slave0x01:smokeDetector' updated: OFFLINE (COMMUNICATION_ERROR): Error with read: org.openhab.io.transport.modbus.internal.ModbusSlaveIOExceptionImpl: Modbus IO Error with cause=ModbusIOException, EOF=false, message='I/O exception: IOException CRC Error in received frame: 3 bytes: 01 04 00 ', cause2=null
2019-04-01 16:28:10.884 [event.ThingStatusInfoEvent] - 'modbus:data:slave0x40:smokeDetector:smokeDetector02' updated: OFFLINE (COMMUNICATION_ERROR): Error (ModbusSlaveIOExceptionImpl) with read. Request: ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@c19d0d4[slaveId=64,functionCode=READ_INPUT_REGISTERS,start=8,length=2,maxTries=3]. Description: ModbusSlaveIOException(cause=ModbusIOException, EOF=false, message='I/O exception: IOException CRC Error in received frame: 3 bytes: 40 04 00 ', cause2=null). Message: Modbus IO Error with cause=ModbusIOException, EOF=false, message='I/O exception: IOException CRC Error in received frame: 3 bytes: 40 04 00 ', cause2=null
2019-04-01 16:28:10.884 [event.ThingStatusInfoEvent] - 'modbus:poller:slave0x40:smokeDetector' updated: OFFLINE (COMMUNICATION_ERROR): Error with read: org.openhab.io.transport.modbus.internal.ModbusSlaveIOExceptionImpl: Modbus IO Error with cause=ModbusIOException, EOF=false, message='I/O exception: IOException CRC Error in received frame: 3 bytes: 40 04 00 ', cause2=null
2019-04-01 16:28:11.894 [event.ThingStatusInfoEvent] - 'modbus:data:slave04:inputControlModule:input1' updated: OFFLINE (COMMUNICATION_ERROR): Error (ModbusSlaveIOExceptionImpl) with read. Request: ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@3e6ecadb[slaveId=4,functionCode=READ_INPUT_REGISTERS,start=8,length=2,maxTries=3]. Description: ModbusSlaveIOException(cause=ModbusIOException, EOF=false, message='I/O exception: IOException CRC Error in received frame: 3 bytes: 04 04 00 ', cause2=null). Message: Modbus IO Error with cause=ModbusIOException, EOF=false, message='I/O exception: IOException CRC Error in received frame: 3 bytes: 04 04 00 ', cause2=null
2019-04-01 16:28:11.894 [event.ThingStatusInfoEvent] - 'modbus:poller:slave04:inputControlModule' updated: OFFLINE (COMMUNICATION_ERROR): Error with read: org.openhab.io.transport.modbus.internal.ModbusSlaveIOExceptionImpl: Modbus IO Error with cause=ModbusIOException, EOF=false, message='I/O exception: IOException CRC Error in received frame: 3 bytes: 04 04 00 ', cause2=null
2019-04-01 16:28:24.164 [event.ThingStatusInfoEvent] - 'modbus:data:slave0x20:smokeDetector:smokeDetector04' updated: OFFLINE (COMMUNICATION_ERROR): Error (ModbusSlaveIOExceptionImpl) with read. Request: ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@607b1c96[slaveId=32,functionCode=READ_INPUT_REGISTERS,start=8,length=2,maxTries=3]. Description: ModbusSlaveIOException(cause=ModbusIOException, EOF=false, message='I/O exception: IOException CRC Error in received frame: 3 bytes: 20 04 00 ', cause2=null). Message: Modbus IO Error with cause=ModbusIOException, EOF=false, message='I/O exception: IOException CRC Error in received frame: 3 bytes: 20 04 00 ', cause2=null
2019-04-01 16:28:24.164 [event.ThingStatusInfoEvent] - 'modbus:poller:slave0x20:smokeDetector' updated: OFFLINE (COMMUNICATION_ERROR): Error with read: org.openhab.io.transport.modbus.internal.ModbusSlaveIOExceptionImpl: Modbus IO Error with cause=ModbusIOException, EOF=false, message='I/O exception: IOException CRC Error in received frame: 3 bytes: 20 04 00 ', cause2=null
2019-04-01 16:28:26.710 [event.ThingStatusInfoEvent] - 'modbus:data:slave0x10:fireAlram:fireAlram1' updated: OFFLINE (COMMUNICATION_ERROR): Error (ModbusSlaveIOExceptionImpl) with read. Request: ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@65e2d032[slaveId=16,functionCode=READ_MULTIPLE_REGISTERS,start=172,length=2,maxTries=3]. Description: ModbusSlaveIOException(cause=ModbusIOException, EOF=false, message='I/O exception: IOException Error reading response (EOF)', cause2=null). Message: Modbus IO Error with cause=ModbusIOException, EOF=false, message='I/O exception: IOException Error reading response (EOF)', cause2=null
2019-04-01 16:28:26.711 [event.ThingStatusInfoEvent] - 'modbus:poller:slave0x10:fireAlram' updated: OFFLINE (COMMUNICATION_ERROR): Error with read: org.openhab.io.transport.modbus.internal.ModbusSlaveIOExceptionImpl: Modbus IO Error with cause=ModbusIOException, EOF=false, message='I/O exception: IOException Error reading response (EOF)', cause2=null
2019-04-01 16:28:26.803 [event.ThingStatusInfoEvent] - 'modbus:data:slave0x80:smokeDetector:smokeDetector01' updated: OFFLINE (COMMUNICATION_ERROR): Error (ModbusSlaveIOExceptionImpl) with read. Request: ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@69880c3

CRC errors are almost always due to poor serial connection hardware.
Use twisted pair cable, see that your serial bus is properly terminated and has biasing.
Don’t allow more than one master on a bus.
Don’t try to use reserved slave IDs (0, 255)
Ensure all devicrs use same baud/bits/parity.

Thank for the info

Please view my things file, Please correct me, if i did any mistake

Bridge modbus:serial:slave04 [port="/dev/ttyACM0",baud=9600,id=4,stopBits="1.0",parity="none",dataBits=8,encoding="rtu"]
{
    // InputControlModule is Manual call point
    // Analog Input Register , 30001 + 0x08
    Bridge poller inputControlModule[start=8, length=2, refresh=300, type="input"]
    {
            Thing data input1[readStart="8",readValueType="int32",readTransform="JS(conversion.js)"]    
    }    
}

//slave 0x80 = 128 - First Smoke Detector
Bridge modbus:serial:slave0x80 [port="/dev/ttyACM0",baud=9600,id=128,stopBits="1.0",parity="none",dataBits=8,encoding="rtu"]
{  

    //Holding Register = 40001 + 8 = 40009
    Bridge poller smokeDetector [start=8, length=2, refresh=1000,type="input"]
    {
        Thing data smokeDetector01[readStart="8",readValueType="int32",readTransform="JS(conversion.js)"]  //Working one         
    }
    
    //Reset the SmokeDetector at register 0xAD
    Bridge poller resetSmokeDetector [ start=173, length=2, refresh=0,type="coil"]
    {
        Thing data resetSmokeDetector01[writeTransform="01",writeStart="173",writeValueType="bit",writeType="coil"]
    }

}

//slave 0x40 = 64 - Second Smoke Detector
Bridge modbus:serial:slave0x40 [port="/dev/ttyACM0",baud=9600,id=64,stopBits="1.0",parity="none",dataBits=8,encoding="rtu"]
{  

    //Holding Register = 40001 + 8 = 40009
    Bridge poller smokeDetector [start=8, length=2, refresh=1000,type="input"]
    {
        Thing data smokeDetector02[readStart="8",readValueType="int32",readTransform="JS(conversion.js)"]  //Working one         
    }
    
    //Reset the SmokeDetector at register 0xAD
    Bridge poller resetSmokeDetector [ start=173, length=2, refresh=0,type="coil"]
    {
        Thing data resetSmokeDetector02[writeTransform="01",writeStart="173",writeValueType="bit",writeType="coil"]
    }

}


//slave 0x01 - Third Smoke Detector
Bridge modbus:serial:slave0x01 [port="/dev/ttyACM0",baud=9600,id=01,stopBits="1.0",parity="none",dataBits=8,encoding="rtu"]
{  

    //Holding Register = 40001 + 8 = 40009
    Bridge poller smokeDetector [start=8, length=2, refresh=1000,type="input"]
    {
        Thing data smokeDetector03[readStart="8",readValueType="int32",readTransform="JS(conversion.js)"]  //Working one         
    }
    
    //Reset the SmokeDetector at register 0xAD
    Bridge poller resetSmokeDetector [ start=173, length=2, refresh=0,type="coil"]
    {
        Thing data resetSmokeDetector04[writeTransform="01",writeStart="173",writeValueType="bit",writeType="coil"]
    }
 
}



//slave 0x20 = 32 - Fourth Smoke Detector
Bridge modbus:serial:slave0x20 [port="/dev/ttyACM0",baud=9600,id=32,stopBits="1.0",parity="none",dataBits=8,encoding="rtu"]
{  

    //Holding Register = 40001 + 8 = 40009
    Bridge poller smokeDetector [start=8, length=2, refresh=1000,type="input"]
    {
        Thing data smokeDetector04[readStart="8",readValueType="int32",readTransform="JS(conversion.js)"]  //Working one         
    }
    
    //Reset the SmokeDetector at register 0xAD
    Bridge poller resetSmokeDetector [ start=173, length=2, refresh=0,type="coil"]
    {
        Thing data resetSmokeDetector04[writeTransform="01",writeStart="173",writeValueType="bit",writeType="coil"]
    }

}


// Fire Alram
//slave 0x10 = 16
Bridge modbus:serial:slave0x10 [port="/dev/ttyACM0",baud=9600,id=16,stopBits="1.0",parity="none",dataBits=8,encoding="rtu"]{
    // OutputControlModule is fire alarm or Hooter
    // Discrete output Coils
    // Discrete register = 0xAC
    // 0xAC = 172d
    Bridge poller fireAlram [start=172,length=2,refresh=1000,type="holding"]
    {
        Thing data fireAlram1[readStart="172",readValueType="int32",writeStart="172",writeValueType="int32",writeType="holding"]
    }
}

.items


I have no idea what hardware you have, so could not say if your things are correct.

Errors in things files do not cause CRC errors.

You have several slave devices it seems. Simplify to one slave and one cable run, with termination; only add more when that works.

You must daisy chain wiring, do not star connect.

Hi Rossko,

I found the cause for CRC Error that while requesting data from Modbus, I have mentioned zero for no.of byte to read.

Now, I am facing other issue. I have crated thing and items for Fire Alarm and I have configured it . At first , I got EOF error and solved that. When I turn on Fire Alarm, Sound is not coming from Alarm.

I have added switch for Alarm in sitemap. In the log, I am not seeing any writing values for Alarm register.

.things.

Bridge modbus:serial:slave0x10 [port="/dev/ttyACM0",baud=9600,id=16,stopBits="1.0",parity="none",dataBits=8,encoding="rtu"]{
    // OutputControlModule is fire alarm or Hooter
    // Discrete output Coils
    // Discrete register = 0xAC
    // 0xAC = 172d
    Bridge poller fireAlram [start=172,length=2,refresh=0,type="holding"]
    {
            Thing data fireAlram1[,writeStart="172",writeValueType="int32",writeType="holding",writeMultipleEvenWithSingleRegisterOrCoil="true",writeTransform="JS(firealram.js)"]
    }
}

.items

Number FireAlarm "FireAlarm_Value [%x]" <fire> {channel="modbus:data:serial:slave0x10:fireAlram:fireAlram1:number"}
Switch FireAlarm_Switch "FireAlarm_Switch"  {channel="modbus:data:serial:slave0x10:fireAlram:fireAlram1:switch"}

firealram_write.js

(function(inputData){
    var out = 0
    if ((inputData == 0x1) || (inputData == 'ON'))
    {
        out = 0xFFFF
    }
    else
    {
       out = 0x00
    }
    return out
})(input)

When turn ON fire Alarm switch, I am not hearing any sound. I am observing error in log,

2019-04-02 20:01:15.612 [ome.event.ItemCommandEvent] - Item 'FireAlarm_Switch' received command ON
2019-04-02 20:01:15.620 [nt.ItemStatePredictedEvent] - FireAlarm_Switch predicted to become ON
2019-04-02 20:01:15.620 [thome.event.ItemStateEvent] - Received event of type 'ItemStateEvent' under the topic 'smarthome/items/FireAlarm_Switch/state' with payload: '{"type":"OnOff","value":"ON"}'
2019-04-02 20:01:15.620 [thome.event.ItemStateEvent] - FireAlarm_Switch updated to ON
2019-04-02 20:01:15.624 [vent.ItemStateChangedEvent] - FireAlarm_Switch changed from NULL to ON
2019-04-02 20:01:21.533 [event.ThingStatusInfoEvent] - 'modbus:data:slave0x01:smokeDetector:smokeDetector03' updated: ONLINE
2019-04-02 20:01:27.992 [event.ThingStatusInfoEvent] - 'modbus:data:slave0x20:smokeDetector:smokeDetector04' updated: ONLINE
2019-04-02 20:01:29.636 [event.ThingStatusInfoEvent] - 'modbus:data:slave0x10:fireAlram:fireAlram1' updated: OFFLINE (COMMUNICATION_ERROR): Error (ModbusSlaveIOExceptionImpl) with write. Request: BasicModbusWriteRegisterRequestBlueprint@7a3689f2[slaveId=16,reference=172,functionCode=WRITE_MULTIPLE_REGISTERS,registers=ModbusRegisterArrayImpl(00 01),maxTries=3]. Description: ModbusSlaveIOException(cause=ModbusIOException, EOF=false, message='I/O exception: IOException Error reading response (EOF)', cause2=null). Message: Modbus IO Error with cause=ModbusIOException, EOF=false, message='I/O exception: IOException Error reading response (EOF)', cause2=null
2019-04-02 20:01:29.636 [hingStatusInfoChangedEvent] - 'modbus:data:slave0x10:fireAlram:fireAlram1' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Error (ModbusSlaveIOExceptionImpl) with write. Request: BasicModbusWriteRegisterRequestBlueprint@7a3689f2[slaveId=16,reference=172,functionCode=WRITE_MULTIPLE_REGISTERS,registers=ModbusRegisterArrayImpl(00 01),maxTries=3]. Description: ModbusSlaveIOException(cause=ModbusIOException, EOF=false, message='I/O exception: IOException Error reading response (EOF)', cause2=null). Message: Modbus IO Error with cause=ModbusIOException, EOF=false, message='I/O exception: IOException Error reading response (EOF)', cause2=null
2019-04-02 20:01:31.243 [event.ThingStatusInfoEvent] - 'modbus:data:slave0x40:smokeDetector:smokeDetector02' updated: OFFLINE (COMMUNICATION_ERROR): Error (ModbusSlaveIOExceptionImpl) with read. Request: ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@553adb6b[slaveId=64,functionCode=READ_INPUT_REGISTERS,start=8,length=2,maxTries=3]. Description: ModbusSlaveIOException(cause=ModbusIOException, EOF=false, message='I/O exception: IOException Error reading response (EOF)', cause2=null). Message: Modbus IO Error with cause=ModbusIOException, EOF=false, message='I/O exception: IOException Error reading response (EOF)', cause2=null
2019-04-02 20:01:31.244 [hingStatusInfoChangedEvent] - 'modbus:data:slave0x40:smokeDetector:smokeDetector02' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Error (ModbusSlaveIOExceptionImpl) with read. Request: ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@553adb6b[slaveId=64,functionCode=READ_INPUT_REGISTERS,start=8,length=2,maxTries=3]. Description: ModbusSlaveIOException(cause=ModbusIOException, EOF=false, message='I/O exception: IOException Error reading response (EOF)', cause2=null). Message: Modbus IO Error with cause=ModbusIOException, EOF=false, message='I/O exception: IOException Error reading response (EOF)', cause2=null
2019-04-02 20:01:31.244 [event.ThingStatusInfoEvent] - 'modbus:poller:slave0x40:smokeDetector' updated: OFFLINE (COMMUNICATION_ERROR): Error with read: org.openhab.io.transport.modbus.internal.ModbusSlaveIOExceptionImpl: Modbus IO Error with cause=ModbusIOException, EOF=false, message='I/O exception: IOException Error reading response (EOF)', cause2=null
2019-04-02 20:01:31.244 [hingStatusInfoChangedEvent] - 'modbus:poller:slave0x40:smokeDetector' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Error with read: org.openhab.io.transport.modbus.internal.ModbusSlaveIOExceptionImpl: Modbus IO Error with cause=ModbusIOException, EOF=false, message='I/O exception: IOException Error reading response (EOF)', cause2=null
2019-04-02 20:01:31.245 [event.ThingStatusInfoEvent] - 'modbus:data:slave0x40:smokeDetector:smokeDetector02' updated: ONLINE
2019-04-02 20:01:31.245 [hingStatusInfoChangedEvent] - 'modbus:data:slave0x40:smokeDetector:smokeDetector02' changed from OFFLINE (COMMUNICATION_ERROR): Error (ModbusSlaveIOExceptionImpl) with read. Request: ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@553adb6b[slaveId=64,functionCode=READ_INPUT_REGISTERS,start=8,length=2,maxTries=3]. Description: ModbusSlaveIOException(cause=ModbusIOException, EOF=false, message='I/O exception: IOException Error reading response (EOF)', cause2=null). Message: Modbus IO Error with cause=ModbusIOException, EOF=false, message='I/O exception: IOException Error reading response (EOF)', cause2=null to ONLINE

Please help me to make it work.

I am waiting for Input. Can any one please help me on this ?.

Well that is odd. No sign of that in your logs or things.

Review your poller thing type parameter.

I would not use that leading comma.
Review your writeValueType.
Review your writeType.

Can you explain why you want to use a transform to write a coil? The transform you have shown will not work for a coil.

Hi,

It is working… I have modified like this,

// Fire Alram
//slave 0x10 = 16
Bridge modbus:serial:slave0x10 [port="/dev/ttyACM0",baud=9600,id=16,stopBits="1.0",parity="none",dataBits=8,encoding="rtu"]{
    // OutputControlModule is fire alarm or Hooter
    // Discrete output Coils
    // Discrete register = 0xAC
    // 0xAC = 172d
    Bridge poller fireAlram [start=172,length=2,refresh=0,type="coil"]
    {
        //Thing data fireAlram1[readStart="172",readValueType="int32",writeStart="172",writeValueType="int32",writeType="holding"]
        Thing data fireAlram1[writeStart="172",writeValueType="bit",writeType="coil",writeTransform="JS(firealram.js)"]
    }
}

.tranformation

(function(inputData){
    var out = 0
    if ((inputData == 0x1) || (inputData == 'ON'))
    {
        out = 0xFF
    }
    else
    {
       out = 0x00
    }
    return out
})(input)

If anything wrong in my coding, Please correct me

I don’t think your transform does anything useful, and you can simply do away with it.

Standard Modbus coil FC05 writes xFF00 for ON and x0000 for OFF
http://www.simplymodbus.ca/FC05.htm

Thanks for the info. I will do this
I am enabling other components in Modbus.
If any help, I will ping here

Hi Rossko,

I am working on to enable smokeDetector. I have added smoke Detector icon in SVG floor plan.
When ever smoke is detected, SmokeDetector icon should glow in Red otherwise Green.
Once Smoke is detected, when I click on “SmokeDetector” icon, it should send 0x00 to reset the Reset Register (0xAD).

If Smoke is Detected, Device will have 0x20001 and Reset Register (0xAD) will have 0xFF value. I should write 0x00 to Reset Register to reset the device

If Smoke is not Detected, Device will have 0x20002 .

Based on this, I have implemented transformation readTransform="JS(sd_conversion.js)" function for ON and State.

I am facing following issue,

  1. If use transformation function in things declaration, reset function is not working in sitemap.
  2. If I am not using transformation function in things declaration, RED and GREEN changes not occurring in SVG.
  3. When I click on SmokeDetector Icon, Only 0xFF values are written to Reset Register, respective of ON and OFF command.

I can’t provide two events for Single SVG Icon ?>

.things,

//slave 0x01 - Third Smoke Detector
Bridge modbus:serial:slave0x01 [port="/dev/ttyACM0",baud=9600,id=01,stopBits="1.0",parity="none",dataBits=8,encoding="rtu"]
{  

    //Holding Register = 40001 + 8 = 40009
    Bridge poller smokeDetector [start=8, length=2, refresh=500,type="input"]
    {
        Thing data smokeDetector03[readStart="8",readValueType="int32"]//,readTransform="JS(sd_conversion.js)"]  //Working one         
    }
    
    //Reset the SmokeDetector at register 0xAD
    Bridge poller resetSmokeDetector [ start=173, length=2, refresh=0,type="coil"]
    {
        //Thing data resetSmokeDetector03[writeTransform="01",writeStart="173",writeValueType="bit",writeType="coil"]
        Thing data resetSmokeDetector03[writeStart="173",writeValueType="bit",writeType="coil"]

    }
 
}

.items

//Third Smoke Detector
Number SmokeDetector03    "SmokeDetector03_Value [%x]"  <smoke>  { channel="modbus:data:serial:slave0x01:smokeDetector:smokeDetector03:number" }
Switch SmokeDetector03_Switch    "SmokeDetector03_Switch "  <smoke>  { channel="modbus:data:serial:slave0x01:smokeDetector:smokeDetector03:switch" }
Switch ResetSmokeDetector03 "Reseting_SmokeDetector03 "    { channel="modbus:data:serial:slave0x01:resetSmokeDetector:resetSmokeDetector03:switch" }

.transformation.

(function(inputData){
    
    if ((inputData == 0x20001) || ((inputData == 131073)))
    {
        return 'ON'
    }
    else if ((inputData == 0x20002) || (inputData == 131074))
    {
        return 'OFF'
    }
    
})(input)

SVG coding,


My objective: When Smoke is Detected, ICON should change to RED colour from Green. When Click same icon, it should reset the smoke detector device.

Please help me to solve this issue.
Thanks,
Dhanasekasr

If I use separate icons for smoke detect event and reset event, I can able to achieve my objective.

Rossoko, I am waiting for your input.

What about? You said that you acheived your objective.

It’s not my fault if you are on a deadline with your work.

Ok… Sorry for miscommunication. I am having other issue…

I am working in rules implementation,

  1. If Smoke detected, I should turn ON fire Alarm. For this, I have installed “Running rules” binding and created rules using Paper UI,
    image
    image

  2. If Smoke detected event and Alarm event has occured, I have sent a reset command every 1 minute.

rule "Reseting Smoke Detector Rules"
when
    Time cron  "0 0/1 * 1/1 * ? *"
then
    //var flag 
    logDebug("Reseting Smoke Detector Rules", "Inside reseting SmokeDetector")
    sendCommand(ResetSmokeDetector03, OFF)
    sendCommand(FireAlarm_Switch, ON)
end

I cannot able to create Timer event in Paper UI using Rules. So I have create myrules.rules under /etc/openhab2/rules/

In future, I will create more rules for other devices.
Which method is good for implementing and debugging?.

Thanks,
Dhanasekar

Okay, i don’t know anything about PaperUI rules.

OpenHAB has two different native rules systems.

Rules DSL in text xxx.rules files

New Generation Rules Engine, NGRE, with a grahical interface in PaperUI. It’s under development and so missing some features and documentation.

Now you work out which suits you best, for something important like a fire alarm.

Thanks for the info. I wish to continue in xxxx.rules file.
I can create different rules for different event in same rules file ?.

With NGRE Paper UI, I am observing issue. I am trying to create a trigger and reverted back, but I am seeing two rules with same.

Yes you can trigger more than one rule from the same event in one or more .rules files.

I know nothing about PaperUI rules,but you had better find out how to delete unwanted ones.

Thanks,