Modbus RTU via USB not working with RCT POWER DC8 – any ideas?

Hi there,

I’m having trouble getting Modbus RTU over USB to work with my RCT POWER DC8 system.

I’m using openHAB version 4.3.4 and the following USB/RS485 converter:
USB RS485 Converter from BerryBase

Here’s my current Modbus configuration in things file:

Bridge modbus:serial:rct_usb "RCT DC8.0" @ "Modbus"[
    port="/dev/serial/by-id/usb-1a86_USB_Serial-if00-port0",
    id=80,
    baud=9600,
    dataBits=8,
    stopBits="1.0",
    parity="none",
    encoding="rtu",
    timeBetweenTransactionsMillis=60,
    connectMaxTries=3,
    echo=false
] {
    // Poller: Register 40032 to 40091
    Bridge poller inverterBlock1 [ start=40032, length=60, refresh=10000, type="holding" ] {
        Thing data lineFrequency "RCT Line Frequency" [ readStart="40043", readValueType="uint16", transform="JS(divide1000.js)", unit="Hz" ]
    }
}

However, I’m getting the following error:

Status:
OFFLINE
COMMUNICATION_ERROR
Error with read: org.openhab.core.io.transport.modbus.exception.ModbusConnectionException: Error connecting to endpoint ModbusSerialSlaveEndpoint [getPortName()=/dev/serial/by-id/usb-1a86_USB_Serial-if00-port0]

According to the supplier documentation, the RS485 port settings are as follows:

    Baud rate: 9600

    Coding system: 8-bit binary

    Data format: 1 start bit, 8 data bits (LSB first), no parity, 1 stop bit

    CRC: Polynomial 0xA001, initial value 0xFFFF

Register 40043 (Line Frequency) is of type uint16 and has a scaling factor of 0.001 Hz (read-only).

Any ideas on what could be causing the connection issue?
Could it be a driver issue, wrong device ID, wiring, or something else?

Thanks in advance!

Greetings,
Julian

The first thing I did when starting to work with Modbus is follow the following guides

After that I used qmodmaster, to make sure I could communicate with the slave.

I really don’t know enough to be able to tell what if anything might be your specific problem.

I do remember that in my case using the serial by id name for the usb to rs485 adapter did not work I had to use /dev/ttyUSB0 or /dev/ttyUSB1 or the symlink created fllowing one of the guides above

Hi there,

tried it with only one USB device connected. still same issue.

Best regards Julian

Can you connect to the slave device using some other software such as qmodmaster?

I am no expert on Modbus, I am just going by my limited personal experience.

I tried RMMS.exe and it was working

If you can communicate with the slave via RMMS using the same parameters as you are using in Openhab, then to me the only explanation as to why Openhab does not work is the communication with the adapter.

Apart from following the guides I already posted, I don’t have any other ideas.

Sorry and good luck