diy solar

diy solar

Raw RS485/Modbus logs from SofarSolar and Growatt meters in Zero Export context?

I have these adapters:

There is a smaller and cheaper version without the RS-232 port you don't need:

The nice thing about these interfaces is they are isolated, which protects equipment at both ends against unfortunate circumstances like lightning, and it is also much more robust against noise. There is another cheaper one on the same page, but it is not isolated.

They are also available from aliexpress, amazon, etc.
 
Ok, I have made a common ground using two resistors. and I have checked the baud rate.
This is the result.

30 sec with only the inverter on
30 sec with the smart meter started without load
30 sec with 50-51W LED lamp
30 sec with no load
 

Attachments

  • test3.txt
    302.6 KB · Views: 16
The inverter connects fine with the meter, but I can't find anywhere to see the meter info in the shinephone app, when I power off the meter the inverter goes into fault mode.
 
Same procedure, but another output format.
 

Attachments

  • test4.txt
    3.1 MB · Views: 12
last one, two other types of log :D
 

Attachments

  • test5-2.txt
    1.2 MB · Views: 7
  • test5-1.txt
    202.9 KB · Views: 6
Here are the reads from your log. Columns are:
- Register address
- Value
- Register name from SDM630 datasheet

Code:
    0  230.008759       'phase_1_line_to_neutral_volts'
    2  230.043762       'phase_2_line_to_neutral_volts'
    4  227.713760       'phase_3_line_to_neutral_volts'
    6  0.000000         'phase_1_current'              
    8  0.000000         'phase_2_current'              
   10  0.229646         'phase_3_current'              
   12  0.000000         'phase_1_power'                
   14  0.000000         'phase_2_power'                
   16  51.771564        'phase_3_power'                
   18  0.000000         'phase_1_volt_amps'            
   20  0.000000         'phase_2_volt_amps'            
   22  52.379429        'phase_3_volt_amps'            
   24  0.000000         'phase_1_reactive_power'        
   26  0.000000         'phase_2_reactive_power'        
   28  -7.029959        'phase_3_reactive_power'        
   30  1.000000         'phase_1_power_factor'          
   32  1.000000         'phase_2_power_factor'          
   34  0.990953         'phase_3_power_factor'          


   52  51.792999        'total_power'      
   54  0.000000            
   56  53.269367        'total_volt_amps'      
   58  0.000000            
   60 -7.801102         'total_var'        
   62  0.989728         'total_power_factor'  


   70  49.971806        'frequency'            
   72  0.034000         'total_import_kwh'  
   74  0.000000         'total_export_kwh'  
   76  0.000000         'total_import_kvarh'
   78  0.000000         'total_export_kvarh'
   80  0.034000         'total_kvah'        
   
  200  398.413330       'line_1_to_line_2_volts'        
  202  396.458252       'line_2_to_line_3_volts'        
  204  396.623444       'line_3_to_line_1_volts'    

  342  0.034000         'total_kwh'      
  344  0.000000         'total_kvarh'

Everything corresponds to a standard SDM630, so there seems to be nothing special about this meter.
 
I have a genuine (non-growatt) SDM630 v2.
After changing the address it has been working fine for 4 months with my growatt SPH Inverter!
From my previous research nothing special about the growatt edition, besides the default modbus address.
 
Yes I have a standard SDM630 too, I'm using it with the Solis inverter. That's why I had the register map...

You think they just change the modbus address and double the price? That would be hilarious...
 
Great! Thank you guys, really nice to have those recordings, and also the analysis already done. :)

Indeed it looks very weird that Growatt spends the resources/logistics to just repack the genuine version. Too weird. One last risk I see is that they have a kind of periodic check that will popup only after hours of working. We'll see.

With this, my "optip" software can be quickly adapted to also support the "spy" mode for the Eastron ASAP. For now it supports it only as the master in the master-slave communication. Next step was to make this "spy" mode so that optip can just look at what is passing by, with no interference with the inverter which must be the only master on the line.

Finally, I will continue my other software, with first priority on reading from a Shelly 3EM and writing as an Eastron SDM630. => This work will take more time, but I will try to focus on this ASAP!
I will post back here when available.

Thanks a lot for your valuable help!
 
Great! Thank you guys, really nice to have those recordings, and also the analysis already done. :)

Indeed it looks very weird that Growatt spends the resources/logistics to just repack the genuine version. Too weird. One last risk I see is that they have a kind of periodic check that will popup only after hours of working. We'll see.

With this, my "optip" software can be quickly adapted to also support the "spy" mode for the Eastron ASAP. For now it supports it only as the master in the master-slave communication. Next step was to make this "spy" mode so that optip can just look at what is passing by, with no interference with the inverter which must be the only master on the line.

Finally, I will continue my other software, with first priority on reading from a Shelly 3EM and writing as an Eastron SDM630. => This work will take more time, but I will try to focus on this ASAP!
I will post back here when available.

Thanks a lot for your valuable help!
You are welcome, I'm really looking forward to the Shelly 3EM as an Eastron SDM630 part.
I'll try to learn Modbus and play around with it.
I think one of the differences between the original sdm630 and the Growatt version, is the extra RS485 output the Growatt version has.
None of the other versions I have seen has two rs485 outputs. I was looking for a MCT version with two RS485 outputs, but Eastron don't make that. :)
 
For posterity, and those who would need valid samples to check their own soft, here are the processed samples from test3.txt (confirming the conclusions of @peufeu)

Thanks a lot for the help, now I have enough for the Growatt side. I still need the Sofar one, I hope I'll find one some day.

=> Now I focus on the development of the gateway. I reworked my agenda to speed up the Shelly->Growatt combination. I hope to come back ASAP with a first version.
 

Attachments

  • Growatt meter exchanges.txt
    87 KB · Views: 17
  • Growatt meter requests.txt
    250 bytes · Views: 15
It's doing like the Solis, querying the important registers (Power) frequently for its export control loop, and querying the other registers less frequently.
I noticed the Solis queries Acrel meters every second, and Eastron meters every 2 seconds. No idea why it does that. So I switched the emulation to Acrel, it makes the control loop 2x faster.
 
It's doing like the Solis, querying the important registers (Power) frequently for its export control loop, and querying the other registers less frequently.
I noticed the Solis queries Acrel meters every second, and Eastron meters every 2 seconds. No idea why it does that. So I switched the emulation to Acrel, it makes the control loop 2x faster.
On my genuine Eastron Modbus v2, during my explorations I noticed that the Eastron does not like to be polled too often, some frames were not complete. Maybe they realized this too at Solis...
=> Good to know, thanks.
 
Weird, my Pi polls the SDM630 10 times per second and it never raises an error.
 
Thanks for posting the meter modbus data, it was the missing link in a project I started designed to emulate an Easron meter using an ESP32


I recently moved house and haven't had a chance to re-build my array, but with the data above it should hopefully be easy to finish this project and have full export control of the inverter.
 
Thanks for posting the meter modbus data, it was the missing link in a project I started designed to emulate an Easron meter using an ESP32


I recently moved house and haven't had a chance to re-build my array, but with the data above it should hopefully be easy to finish this project and have full export control of the inverter.
That sounds GREAT!, that should be VERY easy to fit into my home assistant, I already have that hardware laying around, please keep us updated! And you're welcome with the logs :)
 
That sounds GREAT!, that should be VERY easy to fit into my home assistant, I already have that hardware laying around, please keep us updated! And you're welcome with the logs :)

Did you see the recent ESPhome update that allows it to act as a modbus master AKA fake power meter?


I'm actually considering scrapping my project and re-coding the whole thing using this instead - the example they show in the linked page has all of the functionality that I've coded but with the benefit of being able to trivially integrate all of the ESPhome functionality too! Perfect for Home Assistant integration.
 
Weird, my Pi polls the SDM630 10 times per second and it never raises an error.
It could be related to the speed: I believe that there is a minimal delay in between frames, but the length of the frames
Thanks for posting the meter modbus data, it was the missing link in a project I started designed to emulate an Easron meter using an ESP32


I recently moved house and haven't had a chance to re-build my array, but with the data above it should hopefully be easy to finish this project and have full export control of the inverter.
We're all on close projects... Brands have to move on and open their mind! :)

To optimize the use of available power in Zero Export context, I made this one: https://gitlab.com/francois.gerin/optip/ => When in Zero Export, it tries periodically. It is not the most efficient way like a PWM, but keeps safe/simple while not disturbing the sine wave.
Maybe some elements could be of interest for you.

Also I'm going to disclose soon a second tool, a "meter gateway", allowing to fake a meter with another brand/make/model. I'll update here when it gets online. It will also allow some interesting uses... like 3P to 1P conversion to boost self-consumption at low cost :)
I consider also a possibility to apply an offset, that itself could be driven dynamically from other software... More on all this soon. ;-)
 
Here are the reads from your log. Columns are:
- Register address
- Value
- Register name from SDM630 datasheet

Code:
    0  230.008759       'phase_1_line_to_neutral_volts'
    2  230.043762       'phase_2_line_to_neutral_volts'
    4  227.713760       'phase_3_line_to_neutral_volts'
    6  0.000000         'phase_1_current'          
    8  0.000000         'phase_2_current'          
   10  0.229646         'phase_3_current'          
   12  0.000000         'phase_1_power'            
   14  0.000000         'phase_2_power'            
   16  51.771564        'phase_3_power'            
   18  0.000000         'phase_1_volt_amps'        
   20  0.000000         'phase_2_volt_amps'        
   22  52.379429        'phase_3_volt_amps'        
   24  0.000000         'phase_1_reactive_power'    
   26  0.000000         'phase_2_reactive_power'    
   28  -7.029959        'phase_3_reactive_power'    
   30  1.000000         'phase_1_power_factor'      
   32  1.000000         'phase_2_power_factor'      
   34  0.990953         'phase_3_power_factor'      


   52  51.792999        'total_power'  
   54  0.000000        
   56  53.269367        'total_volt_amps'  
   58  0.000000        
   60 -7.801102         'total_var'    
   62  0.989728         'total_power_factor'


   70  49.971806        'frequency'        
   72  0.034000         'total_import_kwh'
   74  0.000000         'total_export_kwh'
   76  0.000000         'total_import_kvarh'
   78  0.000000         'total_export_kvarh'
   80  0.034000         'total_kvah'    
 
  200  398.413330       'line_1_to_line_2_volts'    
  202  396.458252       'line_2_to_line_3_volts'    
  204  396.623444       'line_3_to_line_1_volts'

  342  0.034000         'total_kwh'  
  344  0.000000         'total_kvarh'

Everything corresponds to a standard SDM630, so there seems to be nothing special about this meter.
How can an address be 0? Shouldn't all these addresses be like 30001, 30002 etcetera.?

Is there a website where I can enter like:
02 04 24 43 65 C3 A2 43 66 2F 1B 43 63 52 78 00 00 00 00 00 00 00 00 3E 67 71 5D 00 00 00 00 00 00 00 00 42 4B FC 43 18 CC
And it shows me all the data? I'm struggling with learning Modbus.
I know that 02 is the address of the slave and 04 is the read function, but other than that I'm a little confused :D
 
Last edited:
Back
Top