Need some serious help here.
I just added a new USB device to my Rpi, and then my Nilan modbus communication doesn´t work anymore… It looks like adding this new USB device made some changed for the RS486 InCircet dongle. I suspect it no longer is connected to tty/USB0…
[23:10:55] openhabian@openHABianPi:~$ sudo dmesg | grep ttyUSB
[sudo] password for openhabian:
[ 7.046689] usb 1-1.4: cp210x converter now attached to ttyUSB0
[ 7.050816] usb 1-1.3.2: FTDI USB Serial Device converter now attached to ttyUSB1
[23:11:03] openhabian@openHABianPi:~$ wget https://raw.githubusercontent.com/nickma82/nilan_communication_bringup/master/src/nilan. py
--2018-11-04 23:12:47-- https://raw.githubusercontent.com/nickma82/nilan_communication_bringup/master/src/nilan.py
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.36.133
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.36.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2065 (2.0K) [text/plain]
Saving to: ‘nilan.py.2’
nilan.py.2 100%[===========================================================>] 2.02K --.-KB/s in 0s
2018-11-04 23:12:47 (9.14 MB/s) - ‘nilan.py.2’ saved [2065/2065]
[23:12:47] openhabian@openHABianPi:~$ chmod u+x ./nilan.py
[23:12:47] openhabian@openHABianPi:~$ ./nilan.py
TESTING Nilan Connection
__main__.Nilan<id=0x76897d28, address=30, mode=rtu, close_port_after_each_call=False, precalculate_read_size=True, debug=True, seri al=Serial<id=0x768bb470, open=True>(port='/dev/ttyUSB0', baudrate=19200, bytesize=8, parity='E', stopbits=1, timeout=1.0, xonxoff=F alse, rtscts=False, dsrdtr=False)>
MinimalModbus debug mode. Writing to instrument (expecting 7 bytes back): '\x1e\x03\x03\xeb\x00\x01\xf6\x15' (1E 03 03 EB 00 01 F6 15)
MinimalModbus debug mode. No sleep required before write. Time since previous read: 1541369578750.3 ms, minimum silent period: 2.01 ms.
MinimalModbus debug mode. Response from instrument: '' () (0 bytes), roundtrip time: 1001.3 ms. Timeout setting: 1000.0 ms.
Traceback (most recent call last):
File "./nilan.py", line 60, in <module>
old_userVent_value = n.get_userVent()
File "./nilan.py", line 38, in get_userVent
return self.read_register(1003, numberOfDecimals=0, signed=False, functioncode=3)
File "/usr/local/lib/python2.7/dist-packages/minimalmodbus.py", line 258, in read_register
return self._genericCommand(functioncode, registeraddress, numberOfDecimals=numberOfDecimals, signed=signed)
File "/usr/local/lib/python2.7/dist-packages/minimalmodbus.py", line 697, in _genericCommand
payloadFromSlave = self._performCommand(functioncode, payloadToSlave)
File "/usr/local/lib/python2.7/dist-packages/minimalmodbus.py", line 795, in _performCommand
response = self._communicate(request, number_of_bytes_to_read)
File "/usr/local/lib/python2.7/dist-packages/minimalmodbus.py", line 930, in _communicate
raise IOError('No communication with the instrument (no answer)')
IOError: No communication with the instrument (no answer)
I modified the:
/ etc/opehba2/services/modbus.cfg file to tty/USB1 as well as the /var/lib/openhab2/config/org/openhab/modbus.cfg to USB1
I cleared cache and tmp…
But I end up with tons of errors like this:
2018-11-04 23:26:49.166 [ERROR] [et.wimpi.modbus.net.SerialConnection] - Could not get port identifier, maybe insufficient permissions. null
2018-11-04 23:26:49.169 [ERROR] [ing.ModbusSlaveConnectionFactoryImpl] - connect try 3/3 error: Could not get port identifier, maybe insufficient permissions. null. Connection SerialConnection@163e252[portName=/dev/ttyUSB1,port=<null>]. Endpoint ModbusSerialSlaveEndpoint@a5ddf9[portName=/dev/ttyUSB1]
2018-11-04 23:26:49.171 [ERROR] [ing.ModbusSlaveConnectionFactoryImpl] - re-connect reached max tries 3, throwing last error: Could not get port identifier, maybe insufficient permissions. null. Connection SerialConnection@163e252[portName=/dev/ttyUSB1,port=<null>]. Endpoint ModbusSerialSlaveEndpoint@a5ddf9[portName=/dev/ttyUSB1]
2018-11-04 23:26:49.174 [ERROR] [ing.ModbusSlaveConnectionFactoryImpl] - Error connecting connection SerialConnection@163e252[portName=/dev/ttyUSB1,port=<null>] for endpoint ModbusSerialSlaveEndpoint@a5ddf9[portName=/dev/ttyUSB1]: Could not get port identifier, maybe insufficient permissions. null
2018-11-04 23:26:49.177 [WARN ] [.binding.modbus.internal.ModbusSlave] - ModbusSlave (nilan_holding_user2functions): Error getting a new connection for endpoint ModbusSerialSlaveEndpoint@a5ddf9[portName=/dev/ttyUSB1]. Error was: Unable to validate object
2018-11-04 23:26:49.179 [WARN ] [.binding.modbus.internal.ModbusSlave] - ModbusSlave (nilan_holding_user2functions) not connected -- aborting read request net.wimpi.modbus.msg.ReadMultipleRegistersRequest@858a77. Endpoint ModbusSerialSlaveEndpoint@a5ddf9[portName=/dev/ttyUSB1]
2018-11-04 23:26:49.191 [ERROR] [et.wimpi.modbus.net.SerialConnection] - Could not get port identifier, maybe insufficient permissions. null
2018-11-04 23:26:49.193 [ERROR] [ing.ModbusSlaveConnectionFactoryImpl] - connect try 1/3 error: Could not get port identifier, maybe insufficient permissions. null. Connection SerialConnection@1195458[portName=/dev/ttyUSB1,port=<null>]. Endpoint ModbusSerialSlaveEndpoint@1d2a223[portName=/dev/ttyUSB1]
2018-11-04 23:26:49.235 [ERROR] [et.wimpi.modbus.net.SerialConnection] - Could not get port identifier, maybe insufficient permissions. null
2018-11-04 23:26:49.238 [ERROR] [ing.ModbusSlaveConnectionFactoryImpl] - connect try 2/3 error: Could not get port identifier, maybe insufficient permissions. null. Connection SerialConnection@1195458[portName=/dev/ttyUSB1,port=<null>]. Endpoint ModbusSerialSlaveEndpoint@1d2a223[portName=/dev/ttyUSB1]
2018-11-04 23:26:49.280 [ERROR] [et.wimpi.modbus.net.SerialConnection] - Could not get port identifier, maybe insufficient permissions. null
2018-11-04 23:26:49.283 [ERROR] [ing.ModbusSlaveConnectionFactoryImpl] - connect try 3/3 error: Could not get port identifier, maybe insufficient permissions. null. Connection SerialConnection@1195458[portName=/dev/ttyUSB1,port=<null>]. Endpoint ModbusSerialSlaveEndpoint@1d2a223[portName=/dev/ttyUSB1]
2018-11-04 23:26:49.286 [ERROR] [ing.ModbusSlaveConnectionFactoryImpl] - re-connect reached max tries 3, throwing last error: Could not get port identifier, maybe insufficient permissions. null. Connection SerialConnection@1195458[portName=/dev/ttyUSB1,port=<null>]. Endpoint ModbusSerialSlaveEndpoint@1d2a223[portName=/dev/ttyUSB1]
2018-11-04 23:26:49.289 [ERROR] [ing.ModbusSlaveConnectionFactoryImpl] - Error connecting connection SerialConnection@1195458[portName=/dev/ttyUSB1,port=<null>] for endpoint ModbusSerialSlaveEndpoint@1d2a223[portName=/dev/ttyUSB1]: Could not get port identifier, maybe insufficient permissions. null
2018-11-04 23:26:49.293 [WARN ] [.binding.modbus.internal.ModbusSlave] - ModbusSlave (nilan_holding_user1functions) not connected -- aborting read request net.wimpi.modbus.msg.ReadMultipleRegistersRequest@1d25f5c. Endpoint ModbusSerialSlaveEndpoint@1d2a223[portName=/dev/ttyUSB1]
2018-11-04 23:26:49.301 [ERROR] [et.wimpi.modbus.net.SerialConnection] - Could not get port identifier, maybe insufficient permissions. null
2018-11-04 23:26:49.303 [ERROR] [ing.ModbusSlaveConnectionFactoryImpl] - connect try 1/3 error: Could not get port identifier, maybe insufficient permissions. null. Connection SerialConnection@1b55d46[portName=/dev/ttyUSB1,port=<null>]. Endpoint ModbusSerialSlaveEndpoint@5466b8[portName=/dev/ttyUSB1]
Can someone help here??