I have two solar inverters connected to Telegraf through the Modbus plugin. The configuration works fine the first time I run it but shortly afterwards, the service indicates “Permission denied” and “Serial device timed out” on the one serial device.
I think it might be important to note that the one unit that is working fine has a CP210x serial chip. The problematic unit has a XR21V1410 serial chip. I took quite a bit of time to get the driver installed and the default driver (cdc-acm) disabled.
I managed to get this working but what I mission… I ended up using a Banana Pi -M4 I had, running Ubuntu 16 server with kernel version 4.9. I had to compile the driver for the XR21V1410 but that was relatively easy following their website instructions and FAQ. Key note though, RS485 is not enabled by default on this driver, I had to enable it under the flow control function before compiling it. I also had to blacklist the cdc-acm driver and then had to bind the port to the right driver.
Oddly enough, it was not necessary for me to compile a driver for CP210x as it was working immediately upon connection on this kernel.
I then followed all the steps to install Telegraf on the Banana Pi and on a small home server I hosted Influxdb. It is all working fine now. I suspect the kernel version change had something to do with the drivers challenges but I am not sure.
Just as reference, see link below for the Modbus registers and “manual”. It leaves much to be desired but I managed to pick up the correct registers by scanning the range with a Modbus tool from my laptop. Unfortunately no additional hardware information on the comms that I could get my hands on (Inverter model SPF5000ES).