Hi guys,
Here in France we found how to read the strings properly from mpp solar and other clones of these kind inverters using Arduino and MAX3232 module.
Code example for Arduino Uno working perfect:
#include <SoftwareSerial.h>
SoftwareSerial Serial4(7, 6); // RX, TX
String QPIGS = "\x51\x50\x49\x47\x53\xB7\xA9\x0D";
String stringOne;
void setup() {
Serial.begin(115200);
Serial4.begin(2400);
Serial4.setTimeout(10);
}
void loop() {
establishContact();
stringOne = Serial4.readString();
Serial.println (stringOne);
stringOne = "";
}
void establishContact() {
while (Serial4.available() <= 0) {
Serial4.print(QPIGS); // send an initial string RESQUEST
delay(50);
}
}
More about protocol and crcs :
There are few protocols, so with different request commands regarding the type and generation of the inverter. But the string reading code remains the same for any of them.
To know what crcs to put at the end of request commands, the best solution i found is first using a serial port monitor software as Eltima Software Serial Port Monitor for exemple.
Do these steps :
-Install Eltima Software Serial Port Monitor first. Do not launch it
-Plug your inverter on your PC as usual and launch your inverter software that could be watchpower, solarpower or watchmppt. Let it begin to talk with the inverter.
-Launch Eltima Software Serial Port Monitor. Click on Session, then New session.
Select the right virtual serial com port and make sure the Dumper view and Terminal view are selected.
Make sure Start monitoring now, Create/Close, Read/write, Device Control are selected.
Then you can see watchpower and the inverter talking to each other.
The Dump view window is where you can find the requests in full Hex strings with the right crcs.
Regarding a request is always the same "word", the endind crc is always the same for the given request. I hope you follow.
Crcs are changing only with the inverter responses, because crc are used by watchpower to be sure that datas are new datas and they are coherents. I hope you still follow.
Ok guys, do not hesitate to ask for help if you have troubles
From France.
Your buddy.