This is an example sketch which uses an ESP8266. Once you get this working and want to have a go at doing more with the data, have a look at my setup for inspiration!
The libraries this project uses are:
- https://github.com/4-20ma/ModbusMaster
- https://github.com/bblanchon/ArduinoJson
- https://github.com/knolleary/pubsubclient (MQTT Example)
- 1 x ESP8266 Module
- 1 x RS232 transceiver module. Ex: MAX3232 Module
- 1 x 6P6C Straight Cable (Double check wire colors against 6P6C-Connector.jpg)