Solar Inverter communication with max 232 not work properly for all inverter

Hi, I am working on a small project depending on Arduino, max 232, and solar inverter.
I do the wiring and upload the code, the problem is I have two brands of solar inverters, one of them a commercial blue sun inverter,
the second one is the Falcon inverter.
So, I could send a message and get a response from the Falcon inverter, but the blue sun inverter did not respond to all messages.
I check the Voltage of TX, and RX of the Rs232 cable of the blue sun inverter and it seems correct as -13V for TX and 0V for RX same as the Falcon inverter.
I went to my friend and got the same problem with his solar inverter, is the problem with the wiring, or does each solar inverter brand has a unique commutation protocol?

Welcome to the Arduino forum. Good question and the only way for you to actually find the answer is to find the documentation for each of the inverters. There is NO LAW that requires every inverter manufacturer to use the same protocol nor the same baud rate.

I spent the whole week trying to communicate with Bluesun company on WhatsApp and email but no response, I have the catalog and some paper that came with the BlueSun inverter, but nothing about communication, they mentioned the rs232 only.

Today, I went to another friend who works in an electronics store, he give me permission to try on different brands of inverters,
The inverter that works default protocol is SAKO, FALCON, and PowerLand, RENOVO, but the inverters that not works are MUST, BlueSun.
NOTE: all the above brands that I mentioned work with this type of protocol :slight_smile:
https://www.photovoltaikforum.com/core/attachment/122537-rs232-communication-protocol-pdf/

Thank you, my friend.
Today, I went to another friend who works in an electronics store, he give me permission to try on different brands of inverters,
The inverter that works default protocol is SAKO, FALCON, and PowerLand, RENOVO, but the inverters that not works are MUST, BlueSun.
Note :
all brands that I mentioned before work with default rs232 commands like QPIGS

Do you know the model number / name of the bluesun inverter?

If it's a slightly older model, then you may get lucky on the wayback machine archive.

I would imagine that somebody somewhere has figured it out. The trick is trying to find them with just the right search terms in the search engine.

Thank you for replying.
Yes, I have the model number of the BlueSun inverter, I will stick it here tomorrow morning because I went to my friend in a different city so tomorrow I will come back home and stick it here.
but I know it's a 5.5KW inverter with Usb cable and rs232 Cable.
I am sure the inverter works properly.

is there a way to know the protocol from the communication card of the inverter or the microprocessor of the inverter?

Update :
The model number of Bluesun inverter is BSM5500LV-48

Hi, @majdali
Welcome to the forum.

Did you try different baud rates?

Did you try just listening with a terminal program and changing baud rates?

Can you please post the code you are using to try and communicate with the inverters.

Thanks.. Tom.. :smiley: :+1: :coffee: :australia:

I had a look around the bluesunpv.com website but they don't seem to want to share out any details on the inverter. I couldn't even see a user manual to download.

You might get lucky with a call to their tech support department.

I'd assume you're using a level shifter. Can you provide full details please. Board, code, converter, a wiring diagram, etc. Do you have the 0v commons tied together?

Hello Tom, thank you for replying.
The first time I tried the 2400 baud rate, So I thought the problem was the baud rate.
Then I tried to choose baud rates such as 1200, or 4800, While this not working, I wrote The Arduino code to change BaudRate automatically and stop changing the baud rate when The Arduino get a reply from the inverter, unfortunately, this doesn't work.
I tried to listen to the COM with the serial program and changed the baud rate but nothing appeared.
The Code I will post it here as a reply because I can't upload anything in forum because I am New here.
Thank you Tom.

#include <LiquidCrystal.h>
String  data[17] ;
const int rs = 2, en = 3, d4 = 4, d5 = 5, d6 = 6, d7 = 7;
LiquidCrystal LCD(rs, en, d4, d5, d6, d7);
#include <SoftwareSerial.h>
//4B37 -- B7A9
SoftwareSerial Serial4 (11,12);
String QPIGS = "\x51\x50\x49\x47\x53\xB7\xA9\x0D";
String stringOne ; 
String stringReset ; 
float gridVoltage ;
float gridFrequency ; 
float batteryVoltage ;
float battaryChargingCurrent ;
float battaryDischargingCurrent ;


uint32_t lcd_Time  = 0;
uint32_t lcd_Time_Toggle  = 0;
uint32_t readParemeter_Time  = 0;
uint32_t resetParemeter_Time  = 0;
int lcdShowState = 0; 
bool StateOfFunction = false ; 



void setup() {
  LCD.begin(16,2); 
  Serial.begin(115200);
  Serial4.begin(2400);
  Serial4.setTimeout(1);
  pinMode(13,OUTPUT);     
}


void loop() {
       readParameters();
       disp();
       relay_State();
       data[0]="";
       data[1]="";
       data[8]="";
       data[9]="";
       data[15]="";
}
String  Lastdata[17] ;
void Seprate(String Reading){
  //int len = Reading.length() ; 
  int counter =0 ; 
 for (int i= 1 ; i<Reading.length() ; i++){
  if (Reading[i]==' ')
  {
    counter++;
    continue ; 
    }
    data[counter]+=Reading[i];
  }
  }
  
  void disp (){
    if (millis() - lcd_Time_Toggle > 500) {
     LCD.clear();
     LCD.setCursor(0,0);
     LCD.print("Batt Volt:");
     LCD.print(batteryVoltage); 
    if (millis() - lcd_Time > 1000) {
      if(lcdShowState==0){
        ScreenOne();
        lcdShowState=1;
        }
      else if (lcdShowState==1){
        ScreenTwo();
        lcdShowState=0;
        }
     lcd_Time = millis();
    }
    
     lcd_Time_Toggle = millis();
    }
    }

    
   void readParameters(){
    if (millis() - readParemeter_Time  > 1000) {
    Serial4.print(QPIGS);
    if (Serial4.available()>0){
    stringOne = Serial4.readString();//readStringUntil('\r');
    }
    if (stringOne!=""){
    Serial.println();
    Serial.println(stringOne);
    }
    Seprate(stringOne);
    stringOne = "";
    gridVoltage = data[0].toFloat();
    gridFrequency = data[1].toFloat();
    batteryVoltage = data[8].toFloat();
    battaryChargingCurrent = data[9].toFloat();
    battaryDischargingCurrent = data[15].toFloat();
    readParemeter_Time = millis();
    }
    }
    void relay_State(){
        if (batteryVoltage<13 &&batteryVoltage > 10){
        //Serial.println ("Here relay ");
        digitalWrite(13,HIGH);
        }
        else if (batteryVoltage>13){
        digitalWrite(13,LOW);
        }
      }

     void ScreenOne ()
     {
     LCD.setCursor(0,1);
     LCD.print("GV:");
     LCD.print(gridVoltage);
     LCD.print(",BDC:");
     LCD.print(battaryDischargingCurrent);

      }
     void ScreenTwo()
     {
     LCD.setCursor(0,1);
     LCD.print("GF:");
     LCD.print(gridFrequency);
     LCD.print(",BCC:");
     LCD.print(battaryChargingCurrent);

      }

I am sorry I think my code is not user-friendly.

Thank you my friend for replying.
Yes, you are right, I am using a level shifter.
The Board: Arduino Uno
Code :

#include <LiquidCrystal.h>
String  data[17] ;
const int rs = 2, en = 3, d4 = 4, d5 = 5, d6 = 6, d7 = 7;
LiquidCrystal LCD(rs, en, d4, d5, d6, d7);
#include <SoftwareSerial.h>
//4B37 -- B7A9
SoftwareSerial Serial4 (11,12);
String QPIGS = "\x51\x50\x49\x47\x53\xB7\xA9\x0D";
String stringOne ; 
String stringReset ; 
float gridVoltage ;
float gridFrequency ; 
float batteryVoltage ;
float battaryChargingCurrent ;
float battaryDischargingCurrent ;


uint32_t lcd_Time  = 0;
uint32_t lcd_Time_Toggle  = 0;
uint32_t readParemeter_Time  = 0;
uint32_t resetParemeter_Time  = 0;
int lcdShowState = 0; 
bool StateOfFunction = false ; 



void setup() {
  LCD.begin(16,2); 
  Serial.begin(115200);
  Serial4.begin(2400);
  Serial4.setTimeout(1);
  pinMode(13,OUTPUT);     
}


void loop() {
       readParameters();
       disp();
       relay_State();
       data[0]="";
       data[1]="";
       data[8]="";
       data[9]="";
       data[15]="";
}
String  Lastdata[17] ;
void Seprate(String Reading){
  //int len = Reading.length() ; 
  int counter =0 ; 
 for (int i= 1 ; i<Reading.length() ; i++){
  if (Reading[i]==' ')
  {
    counter++;
    continue ; 
    }
    data[counter]+=Reading[i];
  }
  }
  
  void disp (){
    if (millis() - lcd_Time_Toggle > 500) {
     LCD.clear();
     LCD.setCursor(0,0);
     LCD.print("Batt Volt:");
     LCD.print(batteryVoltage); 
    if (millis() - lcd_Time > 1000) {
      if(lcdShowState==0){
        ScreenOne();
        lcdShowState=1;
        }
      else if (lcdShowState==1){
        ScreenTwo();
        lcdShowState=0;
        }
     lcd_Time = millis();
    }
    
     lcd_Time_Toggle = millis();
    }
    }

    
   void readParameters(){
    if (millis() - readParemeter_Time  > 1000) {
    Serial4.print(QPIGS);
    if (Serial4.available()>0){
    stringOne = Serial4.readString();//readStringUntil('\r');
    }
    if (stringOne!=""){
    Serial.println();
    Serial.println(stringOne);
    }
    Seprate(stringOne);
    stringOne = "";
    gridVoltage = data[0].toFloat();
    gridFrequency = data[1].toFloat();
    batteryVoltage = data[8].toFloat();
    battaryChargingCurrent = data[9].toFloat();
    battaryDischargingCurrent = data[15].toFloat();
    readParemeter_Time = millis();
    }
    }
    void relay_State(){
        if (batteryVoltage<13 &&batteryVoltage > 10){
        //Serial.println ("Here relay ");
        digitalWrite(13,HIGH);
        }
        else if (batteryVoltage>13){
        digitalWrite(13,LOW);
        }
      }

     void ScreenOne ()
     {
     LCD.setCursor(0,1);
     LCD.print("GV:");
     LCD.print(gridVoltage);
     LCD.print(",BDC:");
     LCD.print(battaryDischargingCurrent);

      }
     void ScreenTwo()
     {
     LCD.setCursor(0,1);
     LCD.print("GF:");
     LCD.print(gridFrequency);
     LCD.print(",BCC:");
     LCD.print(battaryChargingCurrent);

      }

Converter: Max232
Wiring diagram:


About the common ground, yes of course I have.

Thank you, my friend.
I tried to call them but no response on email or whatsApp.

Is it null modem style and Tx Rx need to be swapped?

I found the manual PDF for that device using Google, in no time at all. You need to use a PC to communicate and set it up properly. There is a MODBUS option if that card is installed in the machine. Another option takes a different card. So, looking at the connectors you see, there is NOTHING behind them!

Thank you very much
Can you send the pdf manual link, please?
I google it but I can't find it

I am not sure if it is a null modem style but I tried to swap hundred times, but in the code I am using Xmodem CRC for commands.