-
Notifications
You must be signed in to change notification settings - Fork 30
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
Microinverter HEARTBEAT (COUNTER) response implementation for cloudless time synchronization #81
Comments
If the time of the inverter is synchronized from the V5 frame probably we can add an optional argument to enable time stamping of all packets. Or maybe the synchronization only happens with the keep alive response from the server? By the way this
It is generated today at Edit: timestamp correction |
Ah mistakes were made. Edit3: fix: Incomplete seq num for V5 HEARTBEAT response
As far as I know it happens with response to HANDSHAKE packets (which are sent only in server mode, I think) and with response to that HEARTBEAT (COUNTER)... not sure if there are any other ways. I don't have currently any microinverters to test it out so I rely solely on echos from users atm, hah. Edit: HANDSHAKE code: 0x41 w/ response code 0x11 and same response content. Edit2: Hm, for that seq number should be proly used |
[Async]
w/ similar footprint which would contain some matching for 0x41 and 0x47 packets. [Sync] The only question I have is about "send flow". In my example i just copy pasted sending part of |
From what I see, the communication with the Solarman servers is a bit different in terms of packet structure. Timestamp is included in all server generated packets (ACKs to data packets sent by the logger). The format looks like:
Note: A logger attached to a Deye (SUN-12K-SG04LP3 / LSW-3) inverter completely ignores the server timestamp and uses its own. The difference is close to 2 hours between the two and does not seem to change. The inverter time is completely different. |
Yes that seems about right. Hybrid inverters doesn't even sends that heartbeat packets but microinverters do and I also know that microinverters will use time send in that packet. |
They do, plus a lot more: LoggerConnect = 0x4110
LoggerDataReport = 0x4210
LoggerSSIDReport = 0x4310
Logger4810Report = 0x4810
""" Strange logger report ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff """
ServerPingResponse = 0x1710
ServerSSIDAck = 0x1310
ServerDataAck = 0x1210
ServerConnOK = 0x1110
Server4810Ack = 0x1810 From these is obvious that the control code in the server response is always -> (logger control code) - 0x3000 |
My device so far never did in an inverter as server type of a communication... Edit: But maybe it's the matter of a firmware version or something. 😉 |
This is information uploaded to the Solarman servers. We see only the keep-alive/heartbeat/counter packet (0x4710) when communicating with the logger, the mode doesn't matter. |
Sure, I understand, I'm just saying that I don't see those w/ my SG04LP3. |
May I ask you what FW are you running w/ your stick and inverter? I'm now on:
|
Thanks for this. This is news to me as my inverter doesn't send these frames. How did you determine this? Just from packet captures? Could you document for the V5 Protocol documentation page if possible? @davidrapan Could we tidy up |
You can see them in pcap but also when you use proxy from examples. 😉 They are used in server mode communication, just the 0x47 is sometimes used in the client mode too. I did it outside of But sure I do agree it could be improved in terms of code reuse. I did the PR to discuss exactly that and what I did so far was w/ intention not to touch existing code too much so is the purpose of new code clear as much as possible for initial draft. 😉 Edit: The only way forward would be to split both current encoder and decoder methods and extract encoding and decoding of the header I guess. Edit2: And also the order would be in this case decoder -> encoder instead of usual encoder -> decoder calls and the fact that currently processed packet is reflected into current state of the class is quite confusing to me. 😆 Edit3:
Sure! |
Hi, Sorry for the delay. I needed some time offline.
Yes, a tcpdump of the entire communication with the solarman servers. I see that David has already added them in #82
|
Hi,
As it's currently "glued in" in a really ugly way (w/ refactored
COUNTER
toV5_HEARTBEAT
) but for proof of concept enough I guess. So what would be the best place of handling that? My first thoughts were about removing that check from_received_frame_is_valid
and add some additional flow later in the main loop but where? Any ideas?Log:
😉
The text was updated successfully, but these errors were encountered: