I need to set up a Modbus RTU MASTER communication network and also SLAVE RTU with ESP8266 12E (or F, whatever), but I couldn't find a good Modbus RTU library. It has several pages / blogs / videos referring to the things of the PDA Control or the Trialcommand (which are the same library), but I could not make it work fine. The only one I could keep comunication was the PDA Control, but there were a lot of writing and reading errors, a lot of timeouts, etc., even setting the serial to work at 9600 instead of higher speeds.
Does anyone know of any library that works well for ESP8266? ...or some Modbus RTU routine that works (written in any language) and which I can use to "translate" to the C language used in Arduino?
I use the GitHub - smarmengol/Modbus-Master-Slave-for-Arduino: Modbus Master-Slave library for Arduino library (slightly modified) for my own projects and it works great. It's used in master and slave mode, although the master mode wasn't as complete as expected. As there are no special registers of the AVR platform used but you might have to remove some ifdefs if used on the ESP platform.
Solved! I've implemented a simplified routine of the Modbus RTU protocol, with only my needed functions. Following, there are two files of the protocol implementation code and an example file with Arduino (it works on ESP8266).
I didn't study that anymore. The implementation of the protocol is valid for any processor. As I mentioned before, in my case I implemented only what I needed, following the standard of the protocol documentation.