Hello !
I have a problem that could not resolve even after few deys of googling. The root of the problem in modbus service. I have custom sensors module based on arduino and it is works well with my custom python scripts and with different testing software. Few days ago ive decided to try openHAB and it
s ModBus service but no success.
At first, here is some technical data:
root@raspberrypi:/opt/openhab/conf# java -version
java version "1.8.0_65"
Java(TM) SE Runtime Environment (build 1.8.0_65-b17)
Java HotSpot(TM) Client VM (build 25.65-b01, mixed mode)
I`ve added these lines to {OHROOT}/conf/services/modbus.cfg :
serial.slave1.connection=/dev/ttyAMA0:9600:8:none:1:rtu:35:1500:none:none
serial.slave1.id=5
serial.slave1.start=7
serial.slave1.length=1
serial.slave1.type=input
Here is permissions on serial port:
root@raspberrypi:/opt/openhab/userdata/logs# ls -lhS /dev/ttyAMA0
crw-rw---- 1 root dialout 204, 64 Jan 29 06:25 /dev/ttyAMA0
I have RPi 3 with Bluetooth disabled and full hardware serial (ttyAMA0) directed to header pins. It works well with all of my test scripts. But when i trying to use this port in openHAB 2.0 i see folowing errors in log file:
2017-01-29 06:38:12.863 [ERROR] [ing.ModbusSlaveConnectionFactoryImpl] - connect try 1/3 error: Could not get port identifier, maybe insufficient permissions. null. Connection SerialConnection@bd680f[portName=/dev/ttyAMA0,port=<null>]. Endpoint ModbusSerialSlaveEndpoint@2f18d0[portName=/dev/ttyAMA0]
2017-01-29 06:38:12.904 [ERROR] [et.wimpi.modbus.net.SerialConnection] - Could not get port identifier, maybe insufficient permissions. null
2017-01-29 06:38:12.906 [ERROR] [ing.ModbusSlaveConnectionFactoryImpl] - connect try 2/3 error: Could not get port identifier, maybe insufficient permissions. null. Connection SerialConnection@bd680f[portName=/dev/ttyAMA0,port=<null>]. Endpoint ModbusSerialSlaveEndpoint@2f18d0[portName=/dev/ttyAMA0]
2017-01-29 06:38:12.947 [ERROR] [et.wimpi.modbus.net.SerialConnection] - Could not get port identifier, maybe insufficient permissions. null
2017-01-29 06:38:12.948 [ERROR] [ing.ModbusSlaveConnectionFactoryImpl] - connect try 3/3 error: Could not get port identifier, maybe insufficient permissions. null. Connection SerialConnection@bd680f[portName=/dev/ttyAMA0,port=<null>]. Endpoint ModbusSerialSlaveEndpoint@2f18d0[portName=/dev/ttyAMA0]
2017-01-29 06:38:12.949 [ERROR] [ing.ModbusSlaveConnectionFactoryImpl] - re-connect reached max tries 3, throwing last error: Could not get port identifier, maybe insufficient permissions. null. Connection SerialConnection@bd680f[portName=/dev/ttyAMA0,port=<null>]. Endpoint ModbusSerialSlaveEndpoint@2f18d0[portName=/dev/ttyAMA0]
2017-01-29 06:38:12.950 [ERROR] [ing.ModbusSlaveConnectionFactoryImpl] - Error connecting connection SerialConnection@bd680f[portName=/dev/ttyAMA0,port=<null>] for endpoint ModbusSerialSlaveEndpoint@2f18d0[portName=/dev/ttyAMA0]: Could not get port identifier, maybe insufficient permissions. null
2017-01-29 06:38:12.951 [WARN ] [.binding.modbus.internal.ModbusSlave] - ModbusSlave (PlantsBox): Error getting a new connection for endpoint ModbusSerialSlaveEndpoint@2f18d0[portName=/dev/ttyAMA0]. Error was: Unable to validate object
2017-01-29 06:38:12.952 [WARN ] [.binding.modbus.internal.ModbusSlave] - ModbusSlave (PlantsBox) not connected -- aborting read request net.wimpi.modbus.msg.ReadInputRegistersRequest@110e070. Endpoint ModbusSerialSlaveEndpoint@2f18d0[portName=/dev/ttyAMA0]
2017-01-29 06:38:12.958 [ERROR] [et.wimpi.modbus.net.SerialConnection] - Could not get port identifier, maybe insufficient permissions. null
I`ve tried ti run openHAB with dedicated user ‘openhab’ that has been added to dialout group, tried to set 777 permissions to device, tried run openHAB as root but all of my tries gives same result.
Please help me to fix that issue! I could provide any additional info or ssh access if it is neccessary.
Thanks !