Hello OH Community,
i have connected the Waveshare 2-CH RS485 HAT and installed it correctly like in the Description of the Manual. It is installed over SPI and u have two more Serial Ports /dev/ttySC0 and /dev/ttySC1
sudo nano /boot/config.txt
Add the line below to the file, the int_pin should be set according to the actual welding:
dtoverlay=sc16is752-spi1,int_pin=24
Then restart Raspberry Pi
sudo reboot
The Testfile to check the Channels was successful.
Now i tried to install the Modbus Binding OH.2.5.8 without success.
in my file: /etc/default/openhab2
i added:
EXTRA_JAVA_OPTS=“-Dgnu.io.rxtx.SerialPorts=/dev/ttySC0:/dev/ttySC1:/dev/ttyAMA0:/dev/ttyS0”
user rights seems to bee okay too:
[17:21:55] openhabian@openhab:~$ ls -l /dev/ttySC*
crw-rw---- 1 root dialout 240, 0 Dec 31 16:49 /dev/ttySC0
crw-rw---- 1 root dialout 240, 1 Dec 31 16:49 /dev/ttySC1
I got the following error message in the openhab log.
2020-12-31 17:17:06.826 [ERROR] [ing.ModbusSlaveConnectionFactoryImpl] - connect try 1/1 error: Could not get port identifier, maybe insufficient permissions. null. Connection SerialConnection@70fc3d[portName=/dev/ttySC1,port=]. Endpoint ModbusSerialSlaveEndpoint@a08605[portName=/dev/ttySC1]
2020-12-31 17:17:06.828 [ERROR] [ing.ModbusSlaveConnectionFactoryImpl] - re-connect reached max tries 1, throwing last error: Could not get port identifier, maybe insufficient permissions. null. Connection SerialConnection@70fc3d[portName=/dev/ttySC1,port=]. Endpoint ModbusSerialSlaveEndpoint@a08605[portName=/dev/ttySC1]
2020-12-31 17:17:06.830 [ERROR] [ing.ModbusSlaveConnectionFactoryImpl] - Error connecting connection SerialConnection@70fc3d[portName=/dev/ttySC1,port=] for endpoint ModbusSerialSlaveEndpoint@a08605[portName=/dev/ttySC1]: Could not get port identifier, maybe insufficient permissions. null
Any Idea?