I have the Renogy Wanderer 30amp solar charge controller, which has an RS232 port.
I'm trying to read the battery voltage and other data via it's RS232 port from an ESP32 or an Arduino. I haven't found any projects that do that, but I did find one that uses a Pi and NodeJS:
It describes how to build the RS232 cable, which has a somewhat non-standard pinout:
That's the same pinout as this project, which also interfaces the Renology to a Pi but doesn't give much documentation:
I'm using this RS232 to TTL Serial converter. On the TTL side I have ground connected to an ESP32 ground, VCC to ESP32 3.3v, the adaptor's RXD to ESP32 pin TX2, the adaptor's TXD to ESP32 pin RX2.
I'm currently using this sketch:
#define RXD2 16
#define TXD2 17
String incoming;
void setup() {
Serial.begin(115200);
Serial.println("Started!");
Serial2.begin(9600, SERIAL_8N1, RXD2, TXD2);
}
void loop() {
while (Serial2.available() >= 1) {
//Serial.println("checking...");
Serial.print(char(Serial2.read()));
//incoming = Serial2.readStringUntil('\n');
//Serial.println(incoming);
}
}
No data reaches the console other than boot data, but I think that's because I'm not checking the charge controller's registers. Here are the registers are described at that NodeJS project:
The below is a list of supported registers for device information:
|0x00A|Controller voltage rating|Volts|
|0x00A|Controller current rating|Amps|
|0x00B|Controller discharge current rating|Amps|
|0x00B|Controller type||
|0x00C - 0x013|Controller model name||
|0x014 - 0x015|Controller software version||
|0x016 - 0x017|Controller hardware version||
|0x018 - 0x019|Controller serial number||
|0x01A|Controller MODBUS address|
The below is a list of supported registers for state data:
|0x100|Battery Capacity|Percent|
|0x101|Battery Voltage|Volts|
|0x102|Battery Charge Current|Amps|
|0x103|Battery Temperature|Celcius|
|0x103|Controller Temperature|Celcius|
|0x104|Load Voltage|Volts|
|0x105|Load Current|Amps|
|0x106|Load Power|Watts|
|0x107|Solar Panel (PV) Voltage|Volts|
|0x108|Solar Panel (PV) Current|Amps|
|0x109|Solar Panel (PV) Power|Watts|
|0x10B|Min Battery Voltage Today|Volts|
|0x10C|Min Battery Voltage Today|Volts|
|0x10D|Max Charge Current Today|Amps|
|0x10E|Max Discharge Current Today|Amps|
|0x10F|Max Charge Power Today|Watts|
|0x110|Max Discharge Power Today|Watts|
|0x111|Charge Amp/Hrs Today|Amp Hours|
|0x112|Discharge Amp/Hrs Today|Amp Hours|
|0x113|Charge Watt/Hrs Today|Watt Hours|
|0x114|Discharge Watt/Hrs Today|Watt Hours|
|0x115|Controller Uptime|Days|
|0x116|Total Battery Over-charges|Count|
|0x117|Total Battery Full Charges|Count|
Any guidance on how I would check one of those registers? I think it uses modbus to do so.
Thanks for any help.