Drexel & Weiss device integration via USB - Modbus

Hello Everyone

I have a Drexel&Weiss Aerosilent Stratos comfort airing device and I try to connect it to Openhab via the Modbus binding.

The device has 2 Modbus connection possibilities. First the official RS232 interface and second a USB service interface which connects to the Modbus as well.

This second USB connection works also for the Smarthome.py project. They created a plugin for integration of various Drexel&Weiss devices:
https://github.com/Bernator/smarthome/tree/develop/plugins/drexelundweiss

I also connected my RaspberryPi USB port directly to this USB service interface to avoid any additional converter.

An “lsusb” on the linux command line shows, that in fact Drexel&Weiss has USB – Serial Converter built in the device:

Bus 001 Device 006: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC

So summarized, the setup is:
Raspberry PI USB Port < -> Drexel & Weiss device USB-Port <-> Built in FT232 USB/RS232 Converter Chip <-> Modbus

Unfortunately, I get the following errors (even after reboot of RaspberryPI). Any idea what could be wrong?

2019-02-22 18:19:04.164 [ERROR] [t.wimpi.modbus.io.ModbusRTUTransport] - Last request: 82 04 04 a0 00 02 6f 2a
2019-02-22 18:19:04.166 [ERROR] [t.wimpi.modbus.io.ModbusRTUTransport] - failed to read: Error reading response (EOF)
2019-02-22 18:19:04.168 [ERROR] [pi.modbus.io.ModbusSerialTransaction] - execute try 1/1 error: I/O exception: IOException Error reading response (EOF). Request: net.wimpi.modbus.msg.ReadInputRegistersRequest@1c1e0d3 (unit id 130 & transaction 2). Serial parameters: SerialParameters@3c91de[portName=/dev/ttyUSB0,baudRate=115200,flowControlIn=none,flowControlOut=none,databits=8,stopbits=1,parity=none,encoding=rtu,echo=false,receiveTimeoutMillis=1500]
2019-02-22 18:19:04.171 [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.ReadInputRegistersRequest@1c1e0d3 (unit id 130 & transaction 2). Serial parameters: SerialParameters@3c91de[portName=/dev/ttyUSB0,baudRate=115200,flowControlIn=none,flowControlOut=none,databits=8,stopbits=1,parity=none,encoding=rtu,echo=false,receiveTimeoutMillis=1500]
2019-02-22 18:19:04.173 [WARN ] [rt.modbus.internal.ModbusManagerImpl] - Try 1 out of 3 failed when executing request (ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@111ca0a[slaveId=130,functionCode=READ_INPUT_REGISTERS,start=1184,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 801ecdc4-f258-4b91-8cb0-5cc8c4525338]

2019-02-22 18:20:18.808 [ERROR] [t.wimpi.modbus.io.ModbusRTUTransport] - Last request: 82 04 04 a0 00 02 6f 2a
2019-02-22 18:20:18.810 [ERROR] [t.wimpi.modbus.io.ModbusRTUTransport] - failed to read: CRC Error in received frame: 0 bytes: 
2019-02-22 18:20:18.815 [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@df9d5 (unit id 130 & transaction 29). Serial parameters: SerialParameters@3c91de[portName=/dev/ttyUSB0,baudRate=115200,flowControlIn=none,flowControlOut=none,databits=8,stopbits=1,parity=none,encoding=rtu,echo=false,receiveTimeoutMillis=1500]
2019-02-22 18:20:18.818 [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@df9d5 (unit id 130 & transaction 29). Serial parameters: SerialParameters@3c91de[portName=/dev/ttyUSB0,baudRate=115200,flowControlIn=none,flowControlOut=none,databits=8,stopbits=1,parity=none,encoding=rtu,echo=false,receiveTimeoutMillis=1500]
2019-02-22 18:20:18.822 [WARN ] [rt.modbus.internal.ModbusManagerImpl] - Try 2 out of 3 failed when executing request (ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@111ca0a[slaveId=130,functionCode=READ_INPUT_REGISTERS,start=1184,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: 0 bytes:  [operation ID 9cffabff-843b-48fc-b8e8-849f40e17bd1]

The things file:

Bridge modbus:serial:slave1 [ port="/dev/ttyUSB0" ,id=130 , baud=115200, stopBits="1", parity="none", dataBits=8, encoding="rtu" ]{
   Bridge poller inputRegisters1 [ start=1184, length=2, refresh=10000, type="input" ] {
      Thing data RotationIncomingAir [ readStart="1184", readValueType="uint32" ]
      }
}

I have only 1 USB device connected, so this must always be ttyUSB0.
ID I set according Drexel&Weiss documentation (page 5) to 130, as this is the default for airing devices (130-Basisplatine Lüftung (LU)).
[http://gasserenergy.ch/wp-content/uploads/2015/09/900.6660_01_TI_Modbus_RTU_DE.pdf](Modbus RTU Doc)
Furthermore it corresponds to the value used in the Smarthome.Py pluging.
Baud, stopBits etc is for me a miracle why this must be set for USB. But I did it as in other community posts with USB – Modbus it is also used.

I am reading the register address 1184 as it is nicely described in the Modbus Doc on page 10. I am reading 2 Registers (=4 Bytes) as it is required under “Hinweis”.
Gerät=device (ID), Funktion=Function (FC4), Anzahl Register=Amount of register, Wert=value

ModbusDoc

Because, as you described it yourself, it’s a USB to serial converter. Just built into the D&W box, instead of being a dongle. It still converts to serial and so needs serial parameters.

I’m a bit worried about this USB port you have found.
What makes you think it connects to the Modbus, rather than some internal diagnostic interface? It’s not mentioned in Modbus doc.

If it does connect to Modbus, what makes you think it will run at 115200 baud? The Modbus doc you provided says 2400/9600/19200 only are supported.

Look at the diagrams on page 7. That suggests to me that the address 130 and so on is associated with a “private” DuW-bus network and is unrelated to the external Modbus address and bus. I suspect that you are trying to break into the proprietary D&W network, instead of using the public Modbus they provide. Every mention of Modbus ID in the doc seems to be of the “1” or “2” kind of values.

Note; I can’t read German so there is a lot of guess and translate at work here.

USB/RS232 adaptors are a few euros on eBay. I recommend getting one and using the Modbus interface D&W provide.

Thanks for the feedback so far.

This approach over the USB must work, because it is the favoured approach also in other SmartHome projects like SmartHomeNG

There is also an interesting Perl Script accessing D&W device over USB service interface.
It confirms the used baudrate and the ID=130.

What surprises me tough is the following:
# In order to read a reg first a write through the serial bus should be done.
# The ID and the Reg number incremented with 1 should be written.
# eg: “130 201\n” will instantiate the read of register 200
# D&W will respond with a string which contains the value of the reguster
# eg: “130 201 21235” This means register 200 contains the value 21235

  1. Why to send 201 when you want to read Reg 200?
    -> I tried that out anyways and sent readStart=“1185” (incremented by 1 from my example above), but same errors.

  2. “130 201\n” will instantiate the read of register 200. Surprising as Modbus expects much more ID, Function, Register, Register Amounts, CRC?

Did they implement their own Modbus Light version over the USB Service Interface???

It makes sense if you read that the D&W service bus is not Modbus. It’s their own proprietary protocol.

You could write an openHAB binding to use that proprietary protocol.

I connected my PC and opened a Putty USB connection. 130 201\n means effectively reading the register. It answers then with 130 201 21235 whereas this is in this example the inside Temp 21.235°C.

It seems that Reg+1 is to read the register, whereas Reg is to write the register. To be proofed.

I assume the serial binding can help here for some next steps. Tried it, not yet successful. Or alternatively to write an own binding as you suggest.

The ‘official’ 1.x serial binding is I think a bit rusty at the moment, although it ought to work for the simple protocol described.
You may have to deal with ‘eavesdropped’ traffic from internal D&W comms and/or collision avoidance, but no doubt the existing scripts will have that if needed, for guidance.

I’d give thought to using the “real” Modbus port. That could even be over WiFi with an RS232 gateway.

I finally went done the path with hardware and the standard Modbus binding. Here the solution: Drexel & Weiss Device Integration