-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
S100 map #1
Comments
Right, the map is what I need because I haven't got any S100. If I had the map, I could simulate a S100 using a PLC with a 485 interface and later a Raspberry Pi with a 485. I also could read these values from a Shelly EM using a RBPi and send them back to the inverter. |
By the way, I'm using diagslave (https://www.modbusdriver.com/diagslave.html) on my RBPi and no success, it seems that the inverter is not requesting for slave 32: ./diagslave -a 32 -b 9600 -p none /dev/ttyUSB0 Protocol configuration: Modbus RTU, frame tolerance = 0ms Server started up successfully. But if I change the slave number ... What is happening here? Protocol configuration: Modbus RTU, frame tolerance = 0ms Server started up successfully. |
Yea ok some differences there. SG5D is my inverter, Its ID is 1 and my S100 is definitely 32, There are some different models of smart meter, maybe thats why you are seeing a different ID? I have checked the registers of my S100 that you are seeing and there is nothing there, All of my values are in 0-12. |
Hi. Is there any trick to make diagslave to get the inverter messages? Im trying to see which address my inverter is looking for the meter but i get no response... |
Yes, you can use ./diagslave -a 254 -b 9600 -p none /dev/ttyUSB0 to get the messages from the inverter. If you need more detailed information, please use cheater.sh instead, it displays the entire request. I'm still using Sungrow-Meter-cheater to send the power consumption to my SunGrow SG5.0RS :-), so that I obtain the right graph of production vs consumption. |
what i meant is, have you turned off the inverter and turn on to make it query the meter? or with the inverter already on, just by plugging it, makes the inverter detect the meter? |
The inverter is always sending requests, just connect the Cheater (or meter) and will be recognized by the inverter. |
I am having issues on detecting the inverter requests. I am not sure if i am connecting the pins correctly or if inverter is not sending the requests at all. Do you know who requests the meter information? Is it the inverter or the dongle? |
My inverter is a SG5.0RS, you should check the documentation of your
inverter to check if the procedure is different:
"Do you know who requests the meter information? Is it the inverter or the
dongle?" --> The inverter, of course, it's a MODBUS master
https://github.com/Linux-RISC/Sungrow-Meter-cheater
- Connect two wires from COM2 terminals (A2,B2) to 485 adapter terminals
(D+,D-). Read the documentation of you inverter, I have used the page 20 of
this manual:
https://aus.sungrowpower.com/upload/file/20210707/SG2.0-6.0RS-UEN-Ver11-202106.pdf
- If you run cheater.sh, you should obtain something like this:
answer=FE0310000000D80000000000000000000000D8E0DA (216 W)
answering to fe03016400081020
answer=FE0310000000D80000000000000000000000D8E0DA (216 W)
answering to fe03016400081020
answer=FE0310000000D80000000000000000000000D8E0DA (216 W)
answering to fe03016400081020
answer=FE0310000000D80000000000000000000000D8E0DA (216 W)
unknown request fffe030164000810
answering to fe03016400081020
answer=FE0310000000DA0000000000000000000000DA6659 (218 W)
answering to fe03016400081020
answer=FE0310000000DB0000000000000000000000DBA518 (219 W)
unknown request fffe030164000810
answering to fe03016400081020
answer=FE0310000000DB0000000000000000000000DBA518 (219 W)
answering to fe03016400081020
...
- You could use another MODBUS client to get similar results
El dom, 15 ene 2023 a las 23:04, lexleite ***@***.***>)
escribió:
… I am having issues on detecting the inverter requests. I am not sure if i
am connecting the pins correctly or if inverter is not sending the requests
at all. Do you know who requests the meter information? Is it the inverter
or the dongle?
—
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFBZRZG4AV3ZLJ2KRIBUSVLWSRX5NANCNFSM6AAAAAARAHKN7Y>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Have you been able to to further on other register ? Now I'm trying to understand registrers :
Did you have any insight to help me to decypher thoses register ? For the record, the code I have made in Golang inspired from your bash one : var powerB = make([]byte, 4)
binary.BigEndian.PutUint32(powerB, uint32(gridPower))
// Copy in first position
data[1] = powerB[0]
data[2] = powerB[1]
data[3] = powerB[2]
data[4] = powerB[3]
// Copy in 4th position
data[13] = powerB[0]
data[14] = powerB[1]
data[15] = powerB[2]
data[16] = powerB[3] |
@Nicknack1234 could you make a new screenshot of your registers please ? it will help me to understand how the index are increasing. |
I suppose you have checked out the file cheater.sh As you can see, Power is a cumulated value, the script should integrate in time the instant power and send it back to the inverter using registers 356-363. At this moment, the script just sends back the instant power. I'm sorry but I still don't know the meaning of the rest of registers. Please, let me know if you find out the meaning of these registers :-) |
Some findings but I don't know how to reset index of power in the cloud app, so i'm stuck on that and cannot test deeper... |
Once I found register 10 was the instantaneous power consumption I stopped looking at the other values. I use the S100 Single phase and this is my code to get my house power consumption. The value shows live my house power consumption.
Here is the data graphed, Yellow is my S100 register 10 value. Best way to figure out what each value does is just send them all to grafana and graph them all. Green is my sungrow inverter output and blue is my victron battery. |
@Nicknack1234 thanks for the feedback, it means my assumption for the register 10 to 21 is wrong... |
I have been able to identify all register and make a cheater wich fully work with the mobile app. Just some information : the energy are not in Wh directly, but in Wh divided by 10. Now the fun part : it appear that if this register has a too high value, it mess the mobile app. So we have to buffer overflow it to go back to a value near to 0. In order to do that we need to put 0 in the register 10/11, then a high value, then 0, then a high value, ... until you reach the buffer overflow by monitoring the register 5098/5099 from the inverter Once done, you have to remove the inverter from the app for 10 minutes (to remove all bad data), then readd it |
Hi octera. Which meter are you using?? |
I'm from France, so here is my setup : |
For people that may be interested, here is my Golang code to have a fully functinal cheater taking data from MQTT : |
@Nicknack1234 can you indicate what your data acquisition rate is in your data graph posted on Feb 8 ? I'm about to get a SG5.0RS-ADA with S100 installed and am trying to get some idea of the measurement delay time and the measured data refresh rate that can be obtained, compared to actual instantaneous grid export/import power levels. That will help with the control of my domestic airconditioner. |
@trobbinsfromoz yea the quickest it can run is 6 second intervals. Any faster than that and the s100 returns nothing. The values don't seem to have any delay above the 6 second polling limit. I have my victron battery system polling the s100 every 6 seconds and I can turn on a kettle and have it output the difference in grid imports. |
Superb info - thanks so much for that insight - exactly what I was after :-) I can then use that data to log the delay and ramp rate of my Daikon aircon power consumption to changes in its control parameter changes/settings, as a first effort in working out a likely control strategy to keeping the grid power in export when there is PV and to use the house as a thermal storage battery (as I'll wait for EV battery integration into home energy storage to mature, given it will likely still take another 2 or so years). |
After updating my SG5.0RS to the firmware version SUNSTONE-S_B000.V001.P029-20231019.zip the inverter is lo longer requesting the address 356+8 registers (164H, Active power of phase A,B,C and Total active power). In addition, the meter is not detected on the web yet. This is the log being generated right now: |
Have you been able to clarify the issue with register 5000H ? I went through all the documentation I have found on the web to try to understand the behavior and the configuration on the smart meter. I think that your inverter try to identify the model of the smart meter by reading register 5000H. Actually it seems that by default the inverter try to talk to slave id 32d but by reading register 3FH, there is a way to refine the slave id of the smart meter. It seems that this register is holding
hope this will help :-) |
Not yet, but I'm going to study the documentation again to try to find a solution, I'm in a dead end. Thanks for your support! |
as far as I know modbus used 16 bit registers. So register 3FH should contain 2 bytes
|
@Nicknack1234 have you been able to get the full map of the S100 smart meter ? |
I agree that documentation is confusing regarding addr 0x5000. I have checked it on my inverter and it matches So I would suggest to respond I can't find what is this 0x73 function code in the third request 207300000001c370. Let me know if you get more success with this... |
Hi pdf83, thanks for your support!, the project is working again: request: fe03003f0001a009: slave 254 ($FE), register 63 ($3F), 1 register | answer: address=254 ($FE), baud rate=1 (9600 bps) FE0302FE012DF0 I have improved the debug messages and there are some details to be solved:
I suspect the answer is not the optimum and because of this the updates are a bit slow. I you know how to improve this, please let me know. Thanks in advance! |
Hi @Linux-RISC, Happy to learn that you are now able to communicate again with inverter. This means that we are progressing...
Did you try to not answer to these requests ? This requests are most probably not for your meter. Let me know. |
Thanks again, @pdf83 The script cheater.sh no longer answers the "20*" requests. I think the data are updated quite faster, I'll keep this behaviour. |
Great. Thank you for sharing results. on my side I will try to start my project, based on your results, which will try to emulate Sungrow Smart Meter with ESP32 as a Modbus slave. |
Also looking at this and wanted to add my findings. At start-up, the inverter will auto search for different power meters. It doesn't know what kind of meter is installed and will send every 10 second a dedicated request to known meters.
For the S100, it will be slaveid 0x20 and will use custom function 0x73 for that. The exact meaning I don't know, but if you answer to this, the inverter will start querying (every 200ms). If you stop answer to the 200ms queries (for x times?) the inverter will turn back to its power meter search mode and again send every 10 seconds the search queries. Sending all 0 for those holding registers, my inverter doesn't seem to have troubles with this. It just signals 0 for all the values. The S100 is the 1-phase meter from Sungrow. Because I had initial problems with my setup (3-phase/3-wire, instead of the more general 3-phase/4-wire) the default solution Sungrows gives with a single-phase inverter and S100 single-phase meter was not working. This because in that kind of setup, you can't use only 1 phase to detect if you are injecting or importing power. You need to have the full 3-phase power to do so. So the solution was to use a DTSU666 (and configure this in 3-phase/3-wire) and connect to the inverter. Just to state, that a single phase inverter also will look for a 3-phase power meter(s). |
Hi, @pdf83 any progress on this ? Very interested as would like to feed data to that ESP32 and make some power limitations :) |
So using the information I have used modbus master to dump the first 100 registers.
I will monitor the values throughout the day to generate a proper map. So far I can see register 24 is grid frequency and 6 is grid voltage.
The S100 slave ID is 32 and the value of register 0 is 64 and doesn't seem to change.
The text was updated successfully, but these errors were encountered: