-
Notifications
You must be signed in to change notification settings - Fork 20
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
incorrect method used to identify data fields.. ? #37
Comments
Very, very interesting. I haven't looked at that part of the code for years, so I am a bit rusty, though: QUERY_DESCRIPTION was never used in the code. I can see in the documentation, that the QUERY_DESCRIPTION is properly set up with a reponse of 0x80. Unfortunately I cannot find a key to decode the reply on QUERY_DESCRIPTION Did you look at what the inverter replied with asked with QUERY_DESCRIPTION? BR Henrik |
Hi Henrik, I've written my own module in python just for fun, but I've learnt the protocol from reading you code and some PDF documents floating around the Internet. (search for eversolar_Inverter_PMU_PROTOCOL_V1-1.pdf or similar). The protocol document is difficult to understand - it's easier to learn from your code (thank you!). Here's the results from my inverter (Eversolar TL1500) send query_description...
My inverter returns 22 bytes, which represent the single-byte codes for each position 00 If you decode this as single bytes representing the data code by positional index.. So, looking up a huge table of all possible fields (from protocol PDF), and then keeping a map of index -> data code..
Then.. using this mapping to decode the two-byte values from normal_info (using the position as an index to loo up the previous mapping).. normal_info also has 22 fields for mine - which matches the response from query_description.
That's my take on it anyway.. The Impedance field seems broken on mine - it returns 0xFFFF (hence the 65.535 Ohms.) Also, I haven't re-assembled the multi-field high/low values yet. Also, I've trascribed all the definitions in, just incase they pop up.. eg: data definitions
.. etc.. There's about 87 of them. |
hi jgc234 |
I dumped my rough code into https://github.com/jgc234/eversolar .. I'll clean up the code a bit more in the next few days, but it should give you a rough idea how I decoded the fields. |
I know the code works, but reading through it, I believe the method used to determine the field types in the QUERY_NORMAL_INFO(0x11,0x2) reply packet is incorrect.
This is my understanding:
Rather than using a hard-coded list to map each field type (%DATA_BYTES in the code), the mapping should be dynamically described by the system itself. The mapping should be obtained using the QUERY_DESCRIPTION (0x11,0x00) command. This returns a list of all the data codes (in order) that will be returned when you when you call QUERY_NORMAL_INFO later. This would be unique to each device (in theory, although it looks like most return the same order anyway).
You then use this mapping to determine what fields are returned from the QUERY_NORMAL_INFO (0x11,0x02) command.
In theory, this should eliminate the need for the difference between options_strings mappings for different DATA_BYTES mappings, and explain every field returned by QUERY_NORMAL_INFO.
That's my understanding anyway..
The text was updated successfully, but these errors were encountered: