nebgor / sma-bluetooth

Automatically exported from code.google.com/p/sma-bluetooth
0 stars 0 forks source link

smatool produces results that are 55min early??? #57

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. I have modified the code to accept Adelaide 1/2hr timezone
2. I have compared the results from when smatool queries the inverter about a 
time/date range, and the sniff output when Sunny Explorer queries the inverter.
3. The time range request seems correct for both, and the returned results for 
accumulated energy for each time value match up, as expected, but the time 
values are interpreted differently.

What is the expected output? What do you see instead?
I expected because those results were identical, the energy/power at each time 
would also be identical, but smatool is 55min early.  smatool is interpreting 
the timestamps literally, which gives early results, whereas the Sunny Explorer 
seems to correctly add on the time.

Doesn't make sense, I know, but my knowledge of the protocol is only gained by 
reverse engineering the sniff and studying the smatool code, so I'm probably 
missing something.

Sunny Explorer Snoop Logs:
request for day of 20111120-20111120
<payloadbytes>2a2048004400b2000bff7f017e3f00412f98488315004a9e2125800001007eff03
606509e04e0007a2337d5d00007800a442c93600000000000009800002007058afc74eacffc84e38
4c7e86</payloadbytes>

Inverter was first turned on and started producing at 18:20 that day (producing 
144W = (0x0c-0x00)*12)
First returned message from inverter with non-zero energy:
<payloadbytes>2a2075007100410009efdb7e6d00134a9e212580002f9848831500080000000000
00eca1c84e000000000000000018a3c84e000000000000000044a4c84e0c0000000000000070a5c8
4e0f000000000000009ca6c84e0f00000000000000c8a7c84e0f00000000000000f4a8c84e100000
000000000020aa40</payloadbytes>

But that timecode 44 a4 c8 4e maps literally to 17:25:00, when I would have 
expected to see it at 28 b1 c8 4e (which maps to 18:20:00).

Is there some magical offset number that smatool needs to marry up the results 
(which are out) to the requests (which are not)???  and why 55 min?

What version of the product are you using? On what operating system?
0.15 modified for 1/2hr timezones, and numerous other quick fixes for crashes 
and buffer overflows.  Sorry, the original code just won't run for me - I'll 
attach my copy of the file with current modifications if you're able to run it 
and compare the results...

Please provide any additional information below.
Feel free to use the mods to add to the next version, unless you've already 
fixed them...

Original issue reported on code.google.com by djkammer...@gmail.com on 12 Dec 2011 at 5:24

GoogleCodeExporter commented 8 years ago
Modified code attached

Original comment by djkammer...@gmail.com on 12 Dec 2011 at 5:26

Attachments:

GoogleCodeExporter commented 8 years ago
As per comment on issue 58, I solved my issue by mucking around with the time 
on all the different devices talking to the inverter.  The Sunny Beam was the 
worst because it doesn't have 1/2 hr timezones.

I suspect there is more to this time thing than the reverse engineering done so 
far has uncovered - Sunny Explorer wasn't having a problem...

This issue can be closed, since I suspect there's little that could be done in 
the short term to address this, and getting the time right on the inverter and 
correctly wrong on the Sunny Beam got it working better for me.

Original comment by djkammer...@gmail.com on 22 Dec 2011 at 3:16