diy solar

diy solar

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

Thanks a lot for sharing + checking already. :)

I just had a look and, indeed, it looks like searching for the meter. Note the slave address that is increasing from 01 to 04... With no surprise they scan for the different meters they support at specific addresses.
That's already good to know they seem to support more setups that I was aware of. And they also expect a specific address, since they don't try each address for a same request/attempt.

Each sequence expects a specific reply (what I'm looking for), it would stop on the first "good reply" and we would not see the other requests if a supported meter was found (=valid reply appears). But if a meter gets found, then a dedicated sequence of other exchanges would occur, for sure, reading the different values at specific registers depending on the meter flavor.


On my side, I'm confident my neighbor will soon be desperate not to see his friend coming for the installation of his meter. I guess he will eventually accept I install it with him... Then I will be in position to spy deeply on the full sequences for that model. Let's hope it wont last too much anymore.
 
I can try to get a full set of data this coming week, ill try to get hold of a Growatt smart meter, but RS485 is new to me, so I might need som guidance but well see ;)
 
I can try to get a full set of data this coming week, ill try to get hold of a Growatt smart meter, but RS485 is new to me, so I might need som guidance but well see ;)
Modbus allows only one master, that's the inverter, so make sure your data logger isn't transmitting anything, only listening. The meter will respond to requests from the inverter, so your logger shouldn't also respond to the same requests otherwise it'll talk over the meter and it will make a mess.

In case the inverter authenticates the meter it could be interesting to capture the first frames when they first make contact (when you connect the wires).
 
Ok, I'll set up the logger first, and then connect the smart meter. I'll connect a Lamp so we know the draw. And later change it to something else, so we get different values.
 
Yes it's best to do the test with say two resistive loads like one lamp and a space heater or something like that. Also note V/A/W or take a pic so we can find the actual registers in the recorded data.
When you get it can you post identification info on the meter?
 
Ok here we go, this is what I did:
30 sec with only the inverter on
30 sec with the smart meter started without load
30 sec with ca 720W load its a heat gun, so it jumps a little.
30 sec with no load
30 sec with ca 1271w load, same gun as above but with higher settings
30 sec with no load.

its the SDM630-Modbus V3 version of the EASTRON P/N MR00 0008300

Please check the attached log, is it useful? If not please direct me to some useful logging sw :)
 

Attachments

  • Test1.txt
    8.9 KB · Views: 29
Last edited:
Another logging program:
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

  • test2.txt
    1.7 MB · Views: 7
This looks pretty weird, what tool did you use to generate test1.txt?

For example, first line:

02 04 00 00 00 12 70 34 20 D2 0D 69 E9 67 2C 11 00 6B FF

"02 04 00 00 00 12 70 34" is:
Address 2
function code 4 Read Input Registers
start register 0x0000
number of registers 0x0012
7034 correct CRC

Then comes:
20 D2 0D 69 E9 67 2C 11 00 6B FF

This makes no sense because it should reply with 02 04 followed with the number of bytes in the reply, then the actual bytes, and... there's none of that, even the length is wrong. I suspect your tool is eating some of the bytes and they're not recorded.
 
Last edited:
Thanks a lot, italready brings a few more infos !
Indeed the content looks weird, but that could be "normal" if Growatt implemented a custom protocol.
However, the most probable for now is that the setup is wrong somewhere.
=> Please make sure both ends are configured with the same speed, preferably 9600 or 19200bps. (By default, it could be much higher, like 115200bps.)

The fact the requests are now only on slave address 02 can be interpreted in two different ways:
1) The inverter understands the reply, because it is the Growatt proprietary shit.
2) The inverter sees a reply, and retries in loop even if it does not understand it, just because it gets something back.

Aside this, the logger also introduces some issues, because it cannot guess where are the frame limits. Lowering the speed may help here, but it is not an issue anyway.
However, the most probable is either a speed mismatch or a bad RS485 reference. An oscilloscope could help to see if the signal is ok, but often the simplest is to lower speed and ensure a same common reference.
=> The logger must share the same reference as the line ends. If your RS485 adapter has only 2 wires, then it is floating and the reference oscillates between good and bad... It is important to ensure the reference is common to the three devices: inverter + meter + RS485 spy/logger, all three must be connected to a same wire. If your USB RS485 adapter has only two wires (A/B alias D+/D-), then it's a little more tricky.

PS: The "v3" of the SDM630-Modbus probably denotes the genuine V2, modified to get the Growatt firmware. Maybe, it could make sense.

Sorry for replying so much latency, beyond the timezone gap I'm also very busy with a critical professional project at the moment... :-(
 
There are some correct checksums and it looks like modbus with chunks missing so I believe the baud rate is OK.

Last time I did some modbus spying I just cat the serial port to a file, didn't use any special tool, so can't recommend any tool...
 
The inverter and the smart meter only have 2 wires and no ground. My RS485 to USB also only has 2 wires, so I dont think that is an issue.
I set the pc to 9600 baud, I'll check up later if that is wrong.
I try again later, when I get home from work :)
 
Sorry for replying so much latency, beyond the timezone gap I'm also very busy with a critical professional project at the moment... :-(
We are at the same timezone :) And no biggy, I just hope my help can solve the riddle, so I can use the home assistant and esphome to generate the "smart meter" data for the inverter.
 
Regarding the speed, indeed the probability to have n issue there is low, but the check is quick/easy. And yes, in some conditions (that could be met here) the meter could send something anyway.
Here the inverter and the logger are on the same speed, it's clear since, indeed, the frames + checksum from this side are ok.

But with only two wires, then the usual issue of bad/floating reference is clearly to point at. I would:
1. Ensure the inverter gets valid information from the meter. (= correct behaviour, correct indication at the LCD or monitoring web page)
2. If yes, then both the inverter and the meter have correct electronics to balance the RS485 line. Only the USB/RS485 adapter is the problem.
3. Since the USB/RS485 has only two wires, then its reference is necessarily floating, except if some external precautions were set up.

=> You will probably need to create an artificial reference for the adapter. One technique is to use a resistor "bridge": two resistors of the same value (100..500Ohms), placed in series between the two communication wires. The artificial reference is then in between the two resistors. This point has to be connected to the reference of the USB/RS485 adapter. If no location is available on the PCB, then often it is okay to use the metal reference of the USB connector.

Example of such a common bad RS485 adapter (working on a single computer, but not working as soon as you inter-connect different devices having different references): https://www.befr.ebay.be/itm/133547979502?hash=item1f181472ee:g:x0UAAOSwmQxfiJ5a&amdata=enc:AQAHAAAA4NnxPaliedUyQBtJEtJg5DEq7PEQL+Qmc/h05o3xo0YnHfNjOntMUypbbnjOehVmjuN68A2Y6AuDJjWKcY0oiL5YuL5tdjfGsIWli6uuFvGk9Icc+gT8sv6ZkNiF+PfcCh11GGNa+tJugofWfdigkUA7xROjLjztSg0TguPXEo6pRgGqQF75HDQlvQpdTru2uyjDyOZ+IVA1j+cBwVJWfrkJD6zwnhdMYOoaZvGO05jwUBsDnk2ATZCPuOjGp9eGild3CN5luZXwhs8eoGcLdG1C+bvfF2tLtyK9NuX7TuXs|tkp:BFBMhMKt_ORh

=> When acting on different devices, if the RS485 line does not include a reference, then the reference has to be made externally.
 
Yes that is exactly the version of USB-rs485 I got.

Ok, my job for the day:
- I'll check the baud rate
- I'll check the inverter to see if it receives the info, the Meter shows in the display
- I'll try to make a serial bridge with two resistors.
- Make new logging.

If that's not enough I'll buy this:

I will also try this SW: https://freeserialanalyzer.com/ it's recommended in some forums.
 
For the software, I can't help a lot since I'm exclusively on linux, no more contact with Micro$oft for decades! ;-)
On linux I use the usual minicom, but also the convenient cutecom, which is claimed to be based on the Windows software https://sites.google.com/site/terminalbpp/ => Maybe good, maybe bad. :-/

If you have to buy a new RS485 adapter, the criteria #1 is the presence of this reference on the connector. But also check that it is a half-duplex version: only 2 data wires, not 4. (Yes, RS485 may be used as full-duplex, using 4 wires. This is less common but exists. It is not compatible with the usual 2-wires / half-duplex!)

I bought a sample looking like the one you target, it never worked. But it was probably due to the suspect low-cost Chinese source via ebay. Maybe it is good if sourced from a more reliable seller.
The flavour I prefer, because I use it from Raspberry boards, looks like this one: https://www.befr.ebay.be/itm/293624...nJsCkEWcYWVyhMuPm0fxIHuw==|tkp:Bk9SR5DX6P3kYQ

And for high reliability applications via USB, I pay the price for the FTDI ones (cable/adapter or PCB).
 
For the software, I can't help a lot since I'm exclusively on linux, no more contact with Micro$oft for decades! ;-)
On linux I use the usual minicom, but also the convenient cutecom, which is claimed to be based on the Windows software https://sites.google.com/site/terminalbpp/ => Maybe good, maybe bad. :-/
I'll try that sw too, it's quick to do.
I have one of those but it's not for USB, but maybe I have a USB uart converter, and that should work. :)

I'll try all kinds of stuff later :D
 
Back
Top