Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need help reading RS232 with ARDUINO
#1
Hi All,
I need Arduino help.
I want to use extra power from my inverter to "drive" the water heater resistor.
My inverter can be controled from RS232 serial com.
If I send a request to inverter, it will send back a feedback (a string of 145 number)
eg : I send with RS232 : "QPIGS"
       response from inverter : "(11111 22222 33333 44444 55555 66666 77777 ....... and so..."
 I am "new" with Arduino, and I made this small program to test the communication with inverter:
***********************
char retour[140];
void setup()
{

}

void loop() {
  Serial.begin(2400);
  delay(500);
  Serial.flush();
  Serial.println("QPIGS");

  Serial.readBytes(retour,140);
 
  delay(100);
    
  Serial.println(retour);
  delay(500);
  Serial.flush();
  Serial.end();
}
*****************

it's working , and I can receive a feedback.

I need now to extract from the "string" a few number. But, I don't know how to do !

Many years ago, I use to code with Visual Basic, but arduio is not the same

I hope somebody will be able to help me.
Many thanks.


Attached Files Thumbnail(s)
   
Hydroélectric 800W PELTON Générator - 6 x 270W solar Panel
Oct 2017 : 850 cells collected : Test in progress
Reply
#2
First of all the protocol of the PIP require CRC to be processed. With that said a first start could be to look at https://github.com/scottwday/InverterOfThings or one of the other available systems out there. Personally im running solar-sis on Rasp but will in near future adopt ESP8266 on all my devices instead so each one of the devices have its own controller.
But that will take some more time before its done Smile
The Ultimate DIY Solar and build place
YouTube / Forum system setup / My webpage  Diy Tech & Repairs

Current: 10kW Mpp Hybrid | 4kW PIP4048 | 2x PCM60x | 83kWh LiFePo4 | 10kWh 14s 18650 |  66*260W Poly
Upcoming: 14S 18650~30kWh | Automatic trip breakers, and alot more
Reply
#3
daromer pid='48964' dateline='1556113944']First of all the protocol of the PIP require CRC to be processed. With that said a first start could be to look at https://github.com/scottwday/InverterOfThings or one of the other available systems out there. Personally im running solar-sis on Rasp but will in near future adopt ESP8266 on all my devices instead so each one of the devices have its own controller.
But that will take some more time before its done Smile[/quote]

Hi Daniel,
The RS232 protocol for MPP SOLAR MPI inverter do not need "CRC"
   
Hydroélectric 800W PELTON Générator - 6 x 270W solar Panel
Oct 2017 : 850 cells collected : Test in progress
Reply
#4
Ahh No the mpi doesnt. As Said i have done my fair share of programming towards mpp stuff Wink

Look at My code for solar-sis as example on how i decode it. Could give some hints. I can add some more later when i have My computer
The Ultimate DIY Solar and build place
YouTube / Forum system setup / My webpage  Diy Tech & Repairs

Current: 10kW Mpp Hybrid | 4kW PIP4048 | 2x PCM60x | 83kWh LiFePo4 | 10kWh 14s 18650 |  66*260W Poly
Upcoming: 14S 18650~30kWh | Automatic trip breakers, and alot more
Reply
#5
(04-24-2019, 04:53 PM)daromer Wrote: Ahh No the mpi doesnt. As Said i have done my fair share of programming towards mpp stuff Wink

Look at My code for solar-sis as example on how i decode it.  Could give some hints. I can add some more later when i have My computer

Very strange, maybe the MPI 5,5Kw is not same as MPI 10Kw, But for sure, I dont need CRC.
my MPI5,5kw is exacly the same as Infinysolar 5,5kw (I have both of them)
I can send QPIGS command and receive the feedback, and it's working !
Hydroélectric 800W PELTON Générator - 6 x 270W solar Panel
Oct 2017 : 850 cells collected : Test in progress
Reply
#6
You missed what i wrote.... Wink
The Ultimate DIY Solar and build place
YouTube / Forum system setup / My webpage  Diy Tech & Repairs

Current: 10kW Mpp Hybrid | 4kW PIP4048 | 2x PCM60x | 83kWh LiFePo4 | 10kWh 14s 18650 |  66*260W Poly
Upcoming: 14S 18650~30kWh | Automatic trip breakers, and alot more
Reply


Who read this thread?
22 User(s) read this thread:
daromer, Sean, Korishan, wim, watts-on, Stefaan De Ridder, Geek, cristof, Ste Collister, Charly144, kanchana, Ibiza, SilverNodashi, w0067814, Beholder, Wolf, camthecam, DomingoRP, tccack, Overmind, noddle, schmo

Forum Jump:


Users browsing this thread: 1 Guest(s)