Mpp Solar Inverter ESP32 RS232

Table of Contents

### THIS SITE IS NOT FINISHED ###

Starter-Code

				
					//    _  ___          __   _     _
//   | || \ \        / /  | |   (_)
//   | || |\ \  /\  / /__ | |__  _
//   |__   _\ \/  \/ / _ \| '_ \| |
//      | |  \  /\  / (_) | |_) | |
//      |_|   \/  \/ \___/|_.__/|_|.com
//
//  Project:        RS232 Reader
//  Hardware used:  ESP32 DevKitc_V4
//

#define RXD2 16
#define TXD2 17

char c;
String readString;

void setup() {
  // Note the format for setting a serial port is as follows: Serial2.begin(baud-rate, protocol, RX pin, TX pin);
  Serial.begin(115200);
  Serial2.begin(2400, SERIAL_8N1, RXD2, TXD2);
  
  delay(100);
  Serial.println(F("__________________________________________"));
  Serial.println(F(""));
  Serial.println(F("  _  _ __   v0.1   __     _      _ "));
  Serial.println(F(" | || |\\ \\        / /    | |    (_)"));
  Serial.println(F(" | || |_\\ \\  /\\  / /___  | |__   _ "));
  Serial.println(F(" |__   _|\\ \\/  \\/ // _ \\ | '_ \\ | |"));
  Serial.println(F("    | |   \\  /\\  /| (_) || |_) || |"));
  Serial.println(F("    |_|    \\/  \\/  \\___/ |_.__/ |_|"));
  Serial.println(F(""));
  Serial.println(F("__________________________________________"));
  Serial.println(F(""));
  Serial.println(F("RS232 Reader/2400buad - Initialized"));
  Serial.println(F("__________________________________________"));
  Serial.println(F(""));
  Serial.println("Serial Txd is on pin: " + String(TX));
  Serial.println("Serial Rxd is on pin: " + String(RX));
  Serial.println(F("__________________________________________"));
  
  Serial2.println("2400buad Serial2-Test");
  
}

void loop() {
  while (Serial2.available()) {
    c = Serial2.read();
    readString += c;
  }
  if (readString.length() > 0) {
    Serial.print(readString);
    Serial2.print(readString);
    readString = "";
  }
}
				
			

Now you can read out you RS232 Port with a ESP32

Messages to the inverter follow this format:

<command string><CRC1><CRC2><CR>
 
 

I will change from RS232 to USB. Because the RS232 in my Inverter can’t provide VCC / 5V! OR maybe I change my Inverter is the idea atm to a deye Hybrid Inverter 8kW US version. 

Please Check out the Links at the top if you want more info about RS232 Mpp Inveters.

Leave a Comment