Serial Modbus RTU - Help needed

Hi community,

I am new to modbus so the problem i deal with is possibly not that hard. Just an fundamental misunderstanding on how modbus works :slight_smile:

I am running openhab 2.4 beta version on Ubuntu with the newest Modbus binding to be released in the next update.

I am trying to read some temperature readings out of my central floor heating system - Wavin AHC9000
But i keep getting errors

I have some documentation on the system here
Wavin’s Modbus Specification

First of all i am trying to read the green line from this address sheet

My things file looks like this

Bridge modbus:serial:wavin [ port="/dev/ttyUSB0", baud=38400, stopBits="1.0", parity="none", dataBits=8, encoding="rtu" ] { 

        Bridge poller input [ start=16403, length=1, refresh=600, type="input" ] { 
                
                Thing data ARC1 [ readStart="16403", readValueType="uint16" ] 
        
        }
         
}

And my items file…

Number  warc1 	"[%f]"	{channel="modbus:data:wavin:input:ARC1:number"}

And the sitemap

Frame label="Test" {
    Default item=warc1 label="Bad Stue [%.1f °C]"
}

And lastly the log file

2018-10-03 19:15:58.106 [TRACE] [et.wimpi.modbus.net.SerialConnection] - Got Port Identifier
2018-10-03 19:15:58.120 [TRACE] [et.wimpi.modbus.net.SerialConnection] - Got Serial Port
2018-10-03 19:15:58.123 [TRACE] [et.wimpi.modbus.net.SerialConnection] - i/o Streams prepared
2018-10-03 19:15:58.128 [DEBUG] [t.wimpi.modbus.io.ModbusRTUTransport] - Sent: 01 04 40 13 00 01 d5 cf
2018-10-03 19:15:58.145 [TRACE] [t.wimpi.modbus.io.ModbusRTUTransport] - Managed to read at least one byte
2018-10-03 19:15:58.146 [DEBUG] [t.wimpi.modbus.io.ModbusRTUTransport] - Response: 01 84
2018-10-03 19:15:58.146 [ERROR] [t.wimpi.modbus.io.ModbusRTUTransport] - Last request: 01 04 40 13 00 01 d5 cf
2018-10-03 19:15:58.147 [ERROR] [t.wimpi.modbus.io.ModbusRTUTransport] - failed to read: CRC Error in received frame: 0 bytes:
2018-10-03 19:15:58.148 [ERROR] [pi.modbus.io.ModbusSerialTransaction] - execute try 1/1 error: I/O exception: IOException CRC Error in received frame: 0 bytes: . Request: net.wimpi.modbus.msg.ReadInputRegistersRequest@f8e055 (unit id 1 & transaction 605). Serial parameters: SerialParameters@1e85831[portName=/dev/ttyUSB0,baudRate=38400,flowControlIn=none,flowControlOut=none,databits=8,stopbits=1,parity=none,encoding=rtu,echo=false,receiveTimeoutMillis=1500]
2018-10-03 19:15:58.149 [ERROR] [pi.modbus.io.ModbusSerialTransaction] - execute reached max tries 1, throwing last error: I/O exception: IOException CRC Error in received frame: 0 bytes: . Request: net.wimpi.modbus.msg.ReadInputRegistersRequest@f8e055 (unit id 1 & transaction 605). Serial parameters: SerialParameters@1e85831[portName=/dev/ttyUSB0,baudRate=38400,flowControlIn=none,flowControlOut=none,databits=8,stopbits=1,parity=none,encoding=rtu,echo=false,receiveTimeoutMillis=1500]
2018-10-03 19:15:58.149 [WARN ] [rt.modbus.internal.ModbusManagerImpl] - Try 2 out of 3 failed when executing request (ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@1d612bb[slaveId=1,functionCode=READ_INPUT_REGISTERS,start=16403,length=1,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: 0 bytes:  [operation ID 77ed1fec-a994-4a06-9460-6d7a5d60ddd6]

I hope any of you can spread some light on how i get this working :wink:

Best regards
Henrik Petersen

From the error message it looks like you serial setting are incorrect and the binding is unable to read data

Hi @vzorglub,
Thank you for takeing you time to look into my issue.
Regarding the serial connection i don’t think that’s the issue.
I have it successfully talking via an python script with the same settings.
If i should check/change the connection where/what should i change.

I only suggested that because the binding reads the first Byte and I have these kind of errors with wrong baud rates. But that was playing with arduinos and the like

Your serial Thing parameters don’t give a device ID - confident the default will work for your device? I’d specify it anyway.

The stopBits parameter value “1.0” isn’t in the list of allowed values. Might be fine, but I’d change it to “1”