diy solar

diy solar

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

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:
I've built an ESPhome SDM230 emulator but I don't have an inverter to test it on right now. It's working in so much as I can use a laptop to poll it with the requests from an inverter and it replies with ~valid results.

If anyone wants to give it a try and offer feedback I'd be grateful.

 
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
I've been using this to decode the packets

 
OK I'm pleased that your mentioned the issue of too many writes to the EEPROM as I was planning to use this approach! I will try this anyway for a short time, just to see if it works.

I now have access to the inverter RS485 modbus using this project, I flashed a D1-Mini with the sketch, plugged it into the inverter's USB port and can read/write the registers successfully via MQTT, it works perfectly.

I will build a modbus interface for the export controller inputs and dump the registers, they may be very simple. Or did you do this already?

I have one other question. In the screenshot above it looks like you could enable register 122 option 3 "Enable CT clamp export limit" and directly attached a CT clamp to pins 5 and 6 to get realtime export control. But I'm not sure what the Growatt CT clamp specs are?

CT clamps can output voltage or ampage of different ranges. I wonder If we can directly control the input voltage to these pins and gain control over the export control by emulating the CT clamp.


View attachment 109025

If I'm not mistaken you could just set the register 02 to the value 0 (default) and settings of registers 3,4,5 would't save to flash/eeprom. ?


1684082659127.png
 
Hi guys, I might have solved the issue :) have a look here:
An SDM230 meter emulator with an ESP8266 that communicates with a Growatt inverter via RS-485 enabling power export limitation functions
Hi,

So, I want to try this with an sofar inverter - as this seems to send messages back regardless of IDs or ModBus protocol, will it work as is also with sofar?
Any risks involved (I only have superficial knowledge about rs485/modbus...)?

Thx!
 
Hi,

So, I want to try this with an sofar inverter - as this seems to send messages back regardless of IDs or ModBus protocol, will it work as is also with sofar?
Any risks involved (I only have superficial knowledge about rs485/modbus...)?

Thx!
Did you try this ? I assume that you have a single phase Sofar as the Eastron 230 is a single phase meter only ?

Craig
 
Hi!

I am looking into a possibility to limit the power output of a second inverter when power is not needed because I am not allowed to feed into the Grid.
Previously the option to control the power production via DRM was discussed.
Are DRM settings written on to the eeprom or can I update DRM settings as often as I wish without wearing out the inverter's memory?

John
 

diy solar

diy solar
Back
Top