This is an example sketch which connects to a single charge controller so you can get started easily. 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 ESP32 DevKit Module
- 1 x RS232 transceiver module. Ex: MAX3232 Module
- 1 x 6P6C Straight Cable (Double check wire colors against 6P6C-Connector.jpg)
Additional perspectives in the other pictures in this directory.
I designed a PCB which uses an ESP32 and can handle up to 6 charge controllers at once. Have a look at it here.