bravohe / sma-bluetooth

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

strange dates, extreme power values, and crc errors when talking to SB 3000HF-30 #124

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. run ./smatool
2. check output in shell
3. check smatool db tables

What is the expected output?
Not sure what I should be seeing but I'm sure what I see isn't right.

What do you see instead?
strange dates (sometimes even in the future), extreme power values (frequently 
even negative) and crc errors

What version of the product are you using?
current head 3b8df63532b4 downloaded via hg clone 
https://code.google.com/p/sma-bluetooth/ a yesterday with a few amendments:

invcode.in
using file from janus44444 clone to get codes for my 3000HF-30
applied fix for issue 166 cleaned up spaces

sma.in.new
applied fix for issue 121 replaced $ADD2 with reverse BT address of adapter

smatool.c
applied corrections as listed in 
https://www.google.com/accounts/Login?continue=http%3A%2F%2Fcode.google.com%2F&f
ollowup=http%3A%2F%2Fcode.google.com%2F
replaced hardcoded pvoutput URLs with conf.PVOutputURL

also applied fix for issue 106 to get LiveData table created

On what operating system?
Raspbian “wheezy”
Linux raspberrypi 3.6.11+ #474 PREEMPT Thu Jun 13 17:14:42 BST 2013 armv6l 
GNU/Linux

Please provide any additional information below.

I'm new to this and have successfully setup my raspi and can talk to my SMA 
Sunny Boy 3000HF-30 using a Hama Bluetooth 2.1 Class 1 adapter. I can see data 
in all smatool DB tables but the data in the DayData table always looks strange:

mysql> select * from DayData;
+---------------------+----------+------------+--------------+-------------+----
-----+----------+---------------------+
| DateTime            | Inverter | Serial     | CurrentPower | ETotalToday | 
Voltage | PVOutput | CHANGETIME          |
+---------------------+----------+------------+--------------+-------------+----
-----+----------+---------------------+
| 1970-01-01 01:09:17 | 3000HF30 | 212****995 |  -2147483648 | 9999999.999 |    
NULL | NULL     | 0000-00-00 00:00:00 |
| 1970-01-01 01:05:11 | 3000HF30 | 212****995 |  -2147483648 | 9999999.999 |    
NULL | NULL     | 0000-00-00 00:00:00 |
| 1974-05-23 02:06:09 | 3000HF30 | 212****995 |   2147483647 | 9999999.999 |    
NULL | NULL     | 0000-00-00 00:00:00 |
| 2013-06-25 12:05:04 | 3000HF30 | 212****995 |  -2147483648 | 9999999.999 |    
NULL | NULL     | 0000-00-00 00:00:00 |
| 1970-07-14 05:35:03 | 3000HF30 | 212****995 |  -2147483648 |   16777.215 |    
NULL | NULL     | 0000-00-00 00:00:00 |
| 1970-01-01 01:05:36 | 3000HF30 | 212****995 |  -2147483648 | 9999999.999 |    
NULL | NULL     | 0000-00-00 00:00:00 |
| 1974-05-23 00:10:57 | 3000HF30 | 212****995 |   2147483647 | 9999999.999 |    
NULL | NULL     | 0000-00-00 00:00:00 |
| 1970-01-01 01:13:22 | 3000HF30 | 212****995 |  -2147483648 |   16777.215 |    
NULL | NULL     | 0000-00-00 00:00:00 |
| 2013-06-25 12:05:05 | 3000HF30 | 212****995 |  -2147483648 | 9999999.999 |    
NULL | NULL     | 0000-00-00 00:00:00 |
| 1970-07-14 05:25:19 | 3000HF30 | 212****995 |  -2147483648 | 9999999.999 |    
NULL | NULL     | 0000-00-00 00:00:00 |
| 1970-01-01 01:00:00 | 3000HF30 | 212****995 |   2147483647 | 9999999.999 |    
NULL | NULL     | 2013-06-25 12:05:04 |
| 1970-07-14 05:20:14 | 3000HF30 | 212****995 |  -2147483648 |       0.000 |    
NULL | NULL     | 0000-00-00 00:00:00 |
| 1970-01-01 01:05:03 | 3000HF30 | 212****995 |   2147483647 | 9999999.999 |    
NULL | NULL     | 0000-00-00 00:00:00 |
+---------------------+----------+------------+--------------+-------------+----
-----+----------+---------------------+
13 rows in set (0.01 sec)

On the other hand, the data in the LiveData table always looks fine:

| 1106 | 2013-06-25 11:05:04 | 3000HF30 | 212****995 | Total Power          |   
 2555 | Watts   | 0000-00-00 00:00:00 |
| 1107 | 2013-06-25 11:05:04 | 3000HF30 | 212****995 | Max Phase 1          |   
 3000 | Watts   | 0000-00-00 00:00:00 |
| 1108 | 2013-06-25 11:05:04 | 3000HF30 | 212****995 | Max Phase 2          |   
 3000 | Watts   | 0000-00-00 00:00:00 |
| 1109 | 2013-06-25 11:05:04 | 3000HF30 | 212****995 | Max Phase 3          |   
 3000 | Watts   | 0000-00-00 00:00:00 |
| 1110 | 2013-06-25 11:05:04 | 3000HF30 | 212****995 | Unknown              |   
    0 | Unknown | 0000-00-00 00:00:00 |
| 1111 | 2013-06-25 11:05:04 | 3000HF30 | 212****995 | Output Phase 1       |   
 2555 | Watts   | 0000-00-00 00:00:00 |
| 1112 | 2013-06-25 11:05:04 | 3000HF30 | 212****995 | Output Phase 2       |   
    0 | Watts   | 0000-00-00 00:00:00 |
| 1113 | 2013-06-25 11:05:04 | 3000HF30 | 212****995 | Output Phase 3       |   
    0 | Watts   | 0000-00-00 00:00:00 |
| 1114 | 2013-06-25 11:05:04 | 3000HF30 | 212****995 | Line Voltage Phase 1 |   
  241 | Volts   | 0000-00-00 00:00:00 |
| 1115 | 2013-06-25 11:05:04 | 3000HF30 | 212****995 | Line Voltage Phase 2 |   
    0 | Volts   | 0000-00-00 00:00:00 |
| 1116 | 2013-06-25 11:05:04 | 3000HF30 | 212****995 | Line Voltage Phase 3 |   
    0 | Volts   | 0000-00-00 00:00:00 |
| 1117 | 2013-06-25 11:05:04 | 3000HF30 | 212****995 | Line Current Phase 1 |   
   11 | Amps    | 0000-00-00 00:00:00 |
| 1118 | 2013-06-25 11:05:04 | 3000HF30 | 212****995 | Line Current Phase 2 |   
    0 | Amps    | 0000-00-00 00:00:00 |
| 1119 | 2013-06-25 11:05:04 | 3000HF30 | 212****995 | Line Current Phase 3 |   
    0 | Amps    | 0000-00-00 00:00:00 |
| 1120 | 2013-06-25 11:05:04 | 3000HF30 | 212****995 | Grid Frequency       |   
   50 | Hertz   | 0000-00-00 00:00:00 |
+------+---------------------+----------+------------+----------------------+---
------+---------+---------------------+

And I aways see output like this in the shell with extreme values and crc 
errors:

28/4/1974 17:34:09  total=151696016.000 Kwh current=0 Watts togo=0 i=11 crc=0
1/1/1970 01:05:03  total=1954226944.000 Kwh current=21630369660928 Watts togo=0 
i=23 crc=0Date Error! prev=136398849 current=303

14/7/1970 05:20:14  total=0.000 Kwh current=-23450722762752 Watts togo=0 i=35 
crc=0Date Error! prev=303 current=16777214

1/1/1970 01:00:00  total=5893366755622912.000 Kwh current=70720403180598853632 
Watts togo=0 i=47 crc=0Date Error! prev=16777214 current=0

14/7/1970 05:25:19  total=3444563712.000 Kwh current=-70720363598180253696 
Watts togo=0 i=59 crc=0
14/7/1970 05:20:14  total=0.000 Kwh current=-41334765256704 Watts togo=0 i=71 
crc=0Date Error! prev=16777519 current=16777214

1/1/1970 01:00:00  total=594812705177600.000 Kwh current=7137752410591592448 
Watts togo=0 i=83 crc=0Date Error! prev=16777214 current=0

25/6/2013 11:34:39  total=72058914471936.000 Kwh current=-6273045888973668352 
Watts togo=0 i=95 crc=0
1/1/1970 01:13:22  total=16777.215 Kwh current=-864707002654261248 Watts togo=0 
i=107 crc=0Date Error! prev=1372156479 current=802

1/1/1970 01:00:00  total=0.000 Kwh current=-201326560 Watts togo=0 i=119 
crc=0Date Error! prev=802 current=0

23/5/1974 00:10:57  total=72058889306112.000 Kwh current=864706659056877568 
Watts togo=0 i=131 crc=0
14/7/1970 05:20:14  total=0.000 Kwh current=-864706659056877568 Watts togo=0 
i=143 crc=0Date Error! prev=138496257 current=16777214

1/1/1970 01:00:00  total=0.000 Kwh current=0 Watts togo=0 i=155 crc=0Date 
Error! prev=16777214 current=0

1/1/1970 01:00:00  total=5893366755622912.000 Kwh current=70720403180598853632 
Watts togo=0 i=167 crc=0
1/1/1970 01:05:36  total=1451698944.000 Kwh current=-70720385588412809216 Watts 
togo=0 i=179 crc=0
14/7/1970 05:35:03  total=16777.215 Kwh current=-17420186025984 Watts togo=0 
i=191 crc=0Date Error! prev=336 current=16778103

1/1/1970 01:00:00  total=594839078961152.000 Kwh current=7138069069940391936 
Watts togo=0 i=203 crc=0Date Error! prev=16778103 current=0

25/6/2013 11:34:39  total=72057589071872.000 Kwh current=-6273377941485256704 
Watts togo=0 i=215 crc=0
1/1/1970 01:00:00  total=0.000 Kwh current=-864690991016181760 Watts togo=0 
i=227 crc=0Date Error! prev=1372156479 current=0

1/1/1970 01:00:00  total=0.000 Kwh current=0 Watts togo=0 i=239 crc=0
23/5/1974 02:06:09  total=72057815564288.000 Kwh current=864693808514727936 
Watts togo=0 i=251 crc=0
1/1/1970 01:05:11  total=72057589071872.000 Kwh current=-2783138807808 Watts 
togo=0 i=263 crc=0Date Error! prev=138503169 current=311

1/1/1970 01:00:00  total=0.000 Kwh current=-864690991016181760 Watts togo=0 
i=275 crc=0Date Error! prev=311 current=0

1/1/1970 01:00:00  total=5893366755622912.000 Kwh current=70720403180598853632 
Watts togo=0 i=287 crc=0
1/1/1970 01:09:17  total=72057580683264.000 Kwh current=-69855712052143718400 
Watts togo=0 i=299 crc=0
14/7/1970 05:20:14  total=0.000 Kwh current=-864690991016181760 Watts togo=0 
i=311 crc=0Date Error! prev=557 current=16777214

Original issue reported on code.google.com by mwFF3...@gmail.com on 25 Jun 2013 at 11:23

GoogleCodeExporter commented 9 years ago
Correction to the changes I applied:

invcode.in
using file from janus44444 clone to get codes for my 3000HF-30
applied fix for issue 116 cleaned up spaces (I had written issue 166 by mistake)

Also, I applied another fix:

repost.c
updated pvoutput url to use r2

Not that the repost change makes any difference as my smatool so far never get 
to the point of sending data to PVOutput.

Cheers
Michael

Original comment by mwFF3...@gmail.com on 26 Jun 2013 at 7:20

GoogleCodeExporter commented 9 years ago
I found a solution - I installed smaspot (http://code.google.com/p/sma-spot/) 
and this worked straight away without any issues. It doesn't store data in a DB 
but instead downloads the daily and monthly CSV files and - most importantly 
for me - updates PVOutput. That's all I need and it's working for 2 days now 
without any issues.

Cheers
Michael

Original comment by mwFF3...@gmail.com on 28 Jun 2013 at 2:20