RS232 read data from MPP-Solar inverter

Hey @arthersaleem , thanks for the zip file, I also found it on github and tried to modify the library to compile on my Arduino Mega 2560, it compiles but something is wrong, as it doesn't even show the Serial.print lines in Serial Monitor, I have no errors, it compiles, it uploads correctly, but it doesn't print anything, with the board connected to the inverter, or without.

have you made any progress in using WatchPower library on an arduino board, instead of a phantom board ?

@sherzaad I just seen the code you posted, tonight when I'll be home, I will try your code too , to see if I get any response from my MPP Solar 8048 MAX inverter.

Here is the "modified" library, just commented out the inlude Particle.h line
WatchPower.h (7.2 KB)

And here is the test code, which compiles, but doesn't run the loop when uploaded, there is nothing printed on SerialMonitor

// Example usage for WatchPower library by Hassan Nadeem.

#include "WatchPower.h"

// Attach Serial2 to WatchPower
WatchPower watchPower(Serial2);

void setup(){
    Serial.begin(9600);

    /* One time initialization */
    //watchPower.setOutputSourcePriority(WatchPower::OutputSourcePriorities::SolarFirst);
    //watchPower.setChargePriority(WatchPower::ChargePriorities::SolarFirst);
}

void loop(){
    /* Refresh the stats */
    watchPower.refreshData();

    /* Print stats from the inverter to the serial console */
    Serial.print("Solar Current: ");
    Serial.println(watchPower.solarCurrent.str);

    Serial.print("Solar Voltage: ");
    Serial.println(watchPower.solarVoltage.str);

    delay(2*1000);
}