I’m trying to use Electron to monitor an energy meter using Modbus. I’m using the MODBUSMASTER library. At first, the data from the meter seemed to be corrupted and after analyzing the traffic using a RS485 USB adapter, I noticed that the Electron was sending a request for another holding register. It looked like the library added 1 to my requested address, so I had to substract 1 from the requested address in order to work.
After fixing this, I only get a few minutes of reliable communication with the energy meter, then all the requests fail. It starts working again after I restart the Electron.
I’m using the MAX485 transceiver on a breadboard.
Has anybody tried the ModbusMaster library on the Electron ? Did it work properly ? Do you have any advice for troubleshooting this ? In my case it looks like the library has several bugs.