Symptoms:
I have approx 10 arduinos in house on modbus serial (rs485) to a RaspberryPi4
When installing OH3 + modbus-binding, only 1 Arduino works (id=11) … the rest CRCerrors and OEF ???
And everything works in OH2.5.9
Details:
(Wirescheme is not optimal (star-connection) so i get some errors approx 10% … but it’s OK. It is just for tempereture sensores, i read every minute so i dont mind.
SW:
- I installed OH3 image: Release openHABian v1.6.4 · openhab/openhabian · GitHub
- (also tried upgrade to 3.1 milestones M2 + M3)
- and modbusbinding - nothing else.
- Things (for simplicity i only list 2 Arduinos):
Bridge modbus:serial:Arduino6 [port="/dev/ttyUSBarduino",baud=9600,id=6,dataBits=8,parity="none",stopBits="1.0",encoding="rtu",echo=false,receiveTimeoutMillis=5000, connectMaxTries=3, timeBetweenTransactionsMillis=100] {
Bridge poller ArdId6 [ start=0, length=29, refresh=60006, maxTries=5, type="holding"] {
Thing data ArdId6Pin5Temp [ readStart="5", readValueType="int16", readTransform="JS(divide10.js)" ]
Thing data ArdId6Pin5Hum [ readStart="17", readValueType="int16", readTransform="JS(divide10.js)" ]
//etc...
}
}
Bridge modbus:serial:Arduino1 [port="/dev/ttyUSBarduino",baud=9600,id=11,dataBits=8,parity="none",stopBits="1.0",encoding="rtu",echo=false,receiveTimeoutMillis=5000, connectMaxTries=3, timeBetweenTransactionsMillis=100] {
Bridge poller ArdWC01 [ start=0, length=29, refresh=25011, maxTries=5, type="holding"] {
Thing data ArdId11Pin5Temp [ readStart="5", readValueType="int16", readTransform="JS(divide10.js)" ]
Thing data ArdId11Pin5Hum [ readStart="17", readValueType="int16", readTransform="JS(divide10.js)" ]
//etc...
}
}
In OH3 the Things get errors 100% (except id=11):
2021-04-05 12:48:15.704 [WARN ] [rt.modbus.internal.ModbusManagerImpl] - Try 2 out of 5 failed when executing request (ModbusReadRequestBlueprint [slaveId=6, functionCode=READ_MULTIPLE_REGISTERS, start=0, length=29, maxTries=5]). 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: 33 bytes: 06 03 3a 00 06 00 1c d8 e4 d8 e5 d8 ec c5 01 03 d8 f0 d8 e4 d8 e5 d8 00 31 d8 e2 d8 e2 d8 e2 75 22 [operation ID e47020e4-e64a-4a16-96cd-149bb57e5f14]
2021-04-05 12:48:31.983 [WARN ] [rt.modbus.internal.ModbusManagerImpl] - Try 4 out of 5 failed when executing request (ModbusReadRequestBlueprint [slaveId=6, functionCode=READ_MULTIPLE_REGISTERS, start=0, length=29, maxTries=5]). 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 e47020e4-e64a-4a16-96cd-149bb57e5f14]
2021-04-05 12:48:41.087 [INFO ] [openhab.event.ThingStatusInfoEvent ] - Thing 'modbus:poller:Arduino6:ArdId6' updated: OFFLINE (COMMUNICATION_ERROR): Error with read: org.openhab.core.io.transport.modbus.internal.ModbusSlaveIOExceptionImpl: Modbus IO Error with cause=ModbusIOException, EOF=false, message='I/O exception: IOException CRC Error in received frame: 33 bytes: 06 03 3a 00 06 00 1c d8 e4 d8 e5 d8 ec c4 01 03 d8 f0 d8 e4 d8 e5 d8 00 31 d8 e2 d8 e2 d8 e2 a6 4d ', cause2=null
Usual suspect for CRCerror is Hardware wire - but everything works ok in OH2.5.10 so it MUST be software.
I tried the normal solutions/checks:
- symbolic link
(sudo nano /etc/udev/rules.d/99-com.rules )
SUBSYSTEM=="tty", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="7523", SYMLINK+="ttyUSBwavin"
SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{serial}=="A65HRBTV", SYMLINK+="ttyUSBcomfoair"
SUBSYSTEM=="tty", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", SYMLINK+="ttyUSBarduino"
sudo nano /etc/default/openhab
EXTRA_JAVA_OPTS="-Xms250m -Xmx350m -Dgnu.io.rxtx.SerialPorts=/dev/ttyUSBcomfoair:/dev/ttyUSBwavin:/dev/ttyUSBarduino"
-
Permissions (same in OH2 and OH3)
ls -l /dev/ttyUSBarduino
==> lrwxrwxrwx 1 root root 7 Mar 22 21:42 /dev/ttyUSBarduino → ttyUSB0
ls -l /dev/ttyUSB0
==> crw-rw---- 1 root dialout 188, 0 Apr 4 18:45 /dev/ttyUSB0 -
java network permissions
openHAB on Linux | openHAB
Can anyone help?