Hello to all
I have the following problem:
I have to communicate Openhab 2.5 installed on pi3 with an ABB aurora solar inverter. The connection to the inverter is in RS485 but due to the distance I have inserted a Wi-Fi gateway Rs485. According to my documentation, the inverter communicates via the Modbus RTU serial protocol. Since Openhab does not have the TCP RTU protocol, I configured everything as follows and I used the socat command, my configuration below:
First of all thanks for your answer
actually I use a Rs485 Wifi converter which is more than mysterious it is stupid, it has no protocols inserted. I use this converter because the inverter is in the garage and is difficult to reach with a cable.
I also use this converter to connect to the inverter with its software (aurora communicator) installed on a PC.
Here is the link of the converter: Wifi to Rs485 converter
If you need it, I can attach the manual of the converter and the inverter.
I’m afraid you chose the wrong one really. Some of these USR gateways have built-in Modbus features, some don’t. This one doesn’t.
I use USR gateways myself (wired models) and chose the Modbus types - these work great, you just set up openHAB for Modbus-TCP and the gateway converts to Modbus-RTU for multiple slave devices.
USR-W610 would be the current WiFi model you want for that feature.
There are other very similar manufacturer’s products.
I can’t help much if you are stuck with what you already have.
As a Wndows user, I’d need to use a manufacturer supplied driver to create a virtual COM port on my system, and then setup openHAB to talk Modbus-RTU to the virtual COM port - the driver taking care of delivering that to the gateway in a way the gateway can use.
I don’t know how you do that on a *nix type system - I see you are trying to use socat but I do not know if this gateway will ever understand socat messages.
You have to be careful about permissions when attempting any serial port connections, real or virtual, with openHAB. Make sure you look in openhab.log for connection messages.
The Modbus binding will not try to send something until/unless you have configured a poller Thing.
I did some tests.
1- I created the ttyS0 port, OpenHab recognizes it but does not communicate because it is obviously not connected to the device via wifi.
2- I did the command sudo socat pty, link = / dev / ttyS0, raw tcp: 126.96.36.199: 8899 & to connect the serial to the wifi converter Rs485
3- Note that the ttyS0 port is in use
4- OpenHab no longer sees the ttyS0 serial port so it does not communicate with the inverter.