22:02:52.693 [ERROR] [net.wimpi.modbus.net.SerialConnection] - Could not get port identifier, maybe insufficient permissions. null
22:02:52.694 [ERROR] [ling.ModbusSlaveConnectionFactoryImpl] - connect try 1/3 error: Could not get port identifier, maybe insufficient permissions. null. Connection SerialConnection@76322f4c[portName=192.168.0.105,port=<null>]. Endpoint ModbusSerialSlaveEndpoint@3570a6aa[portName=192.168.0.105]
The problem is, on the slave1, it’s always read as serial connection. I’ve tried to change it to slave2 and slave3. But it still try connect to the slave1 even I’m not using it anymore. Can anyone help me with this ? Or should I use the previous version of openHAB instead of openHAB2 ?
The other problem, for the holding type. Why is it not responding to any input that I make to the PLC ? Is there anything that I need to configure before connecting it to the PLC ?
The problem is, if I put in port configuration in modbus.cfg, openHAB will read it as baud rate not as port configuration. And for the other slave except slave1, there is no problem in reading the port configuration.
Maybe there is another advice for the configuration ?
The first, check connection from OS to PLC. You can use ModbusTools software to check it. ( the same as image below )
The second, can you give some information about your PLC modbus setting ( ex : port, ip address, … )
P/S : With Modbus RTU over TCP
Some devices uses modbus RTU over TCP. This is usually Modbus RTU encapsulation in an ethernet packet. So, those devices does not work with Modbus TCP binding since it is Modbus with a special header. Also Modbus RTU over TCP is not supported by Openhab Modbus Binding. But there is a workaround: you can use a Virtual Serial Port Server, to emulate a COM Port and Bind it with OpenHab unsing Modbus Serial.
And it works. And after trying using so much slave id, I find out that for my laptop, slave1 is reserved for serial connection. And the other slave can be tcp or serial. I’ve test it using slave2 - slave15 and slave255 and it works using tcp connection. It’s only slave1 that using serial connection “only”. I think using any other slave is fine as long it works for me.
I have another question for modbus binding communication. I’m using Poll Modbus from my handphone to test the read/write action on the PLC. And there is 1 little problem. If I change any coil or holding register state from openHAB, Poll Modbus read it so fast, but otherwise, if I change it from Poll Modbus, openHAB not read it that fast. Sometimes it has delay for about 10-30 seconds. Is it normal for openHAB to having any delay like that ? Btw, I’m only using local connection, not using internet connection yet. I want to make sure openHAB can communicate with PLC first.
I’ve found out that openHAB on my laptop already reserved slave1 as serial connection “only”. I’ve tried using another slave and it works well using tcp connection. I don’t know what is wrong with my openHAB, but as long as openHAB can communicate with PLC using any other slave, it’s fine by me.
I’ll try to use modpoll to do the polling in the background on the next test.
There is something that I found from today test using both local connection and internet connection using openHAB cloud. OpenHAB not always slow when reading input from Poll Modbus. Sometimes it only take a few seconds to read input from it. But when openHAB try to connect to slave1, it’s slow to read. Maybe I should consider to remove slave1 from openHAB if possible ?