Problem with Modbus1 or corrupt file?

Hello,

I went to the Home Assistant side for a bit but have come back to OpenHAB. :slight_smile:

Running openHABianPi 2.2.0-1 on a Raspberry Pi 3.

I got the Modbus1 working nicely using a serial connection by configuring /etc/openhab2/services/modbus.cfg

and configuring serial.slavex.connection and so on. It was reading and controlling my Salda HVAC nicely (even using a zwave humidity sensor).

So I got a little “bold” and decided to try to connect to my Fronius Inverter using modbus TCP.

I edited the file and made the mistake of saving with the same “tcp.slave1” as I had used in “serial.slave1”.

Recognising the error, I changed it to an unused slave name “slave4” but keep getting this error:

2018-04-01 16:55:09.892 [ERROR] [inding.modbus.internal.ModbusBinding] - Exception when parsing configuration parameter tcp.slave1.connection = 192.168.1.231:502:60:0:0:3:100  --  java.lang.IllegalArgumentException invalid baud rate: 502



2018-04-01 16:55:09.900 [ERROR] [org.apache.felix.configadmin        ] - [org.osgi.service.cm.ManagedService, org.osgi.service.event.EventHandler, id=334, bundle=217/mvn:org.openhab.binding/org.openhab.binding.modbus/1.11.0]: Updating property tcp.slave1.connection of configuration org.openhab.modbus caused a problem: Exception when parsing configuration parameter tcp.slave1.connection = 192.168.1.231:502:60:0:0:3:100  --  java.lang.IllegalArgumentException invalid baud rate: 502

I have edited this line away (commented then eventually deleted) but it keeps giving this error when starting the modbus1 binding. Further, it no longer polls my modbus1 serial devices due to this error. Oddly enough, it still seems able to set values on the modbus.

Suggestions please?

I may have answered my own question - this file seems to have the offending lines:

[17:55:53] openhabian@openHABianPi:~$ sudo cat /var/lib/openhab2/config/org/openhab/modbus.config
poll="2000"
serial.slave1.connection="/dev/ttyUSB0:19200:8:even:1:rtu:35:1500:none:none"
serial.slave1.id="1"
serial.slave1.length="16"
serial.slave1.type="input"
serial.slave1.valuetype="int16"
serial.slave2.connection="/dev/ttyUSB0:19200:8:even:1:rtu:35:1500:none:none"
serial.slave2.id="1"
serial.slave2.length="2"
serial.slave2.type="holding"
serial.slave2.valuetype="int16"
serial.slave3.connection="/dev/ttyUSB0:19200:8:even:1:rtu:35:1500:none:none"
serial.slave3.id="1"
serial.slave3.length="15"
serial.slave3.type="coil"
service.pid="org.openhab.modbus"
tc.slave4.connection="192.168.1.231"
tcp.slave1.connection="192.168.1.231:502:60:0:0:3:100"
tcp.slave1.type="holding"
tcp.slave4.connection="192.168.10.79:502"
tcp.slave4.length="4"
tcp.slave4.start="92"
tcp.slave4.type="holding"
tcp.slave4.valuetype="float32"```