bravohe / sma-bluetooth

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

Table 'smatool.LiveData' doesn't exist + date error #106

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
I have a SMA SB3000TL21
using thiss inv code:
e8 / ec / 72 / 38  invcode 8A  used the sniffer to trace it.
When i run the smatool commmand i get weird error's
plus i get date error's
my linux skills aren't that experienced.

pi@raspberrypi ~/bin/sma-bluetooth $ date
Mon Oct 22 18:14:41 CEST 2012
pi@raspberrypi ~/bin/sma-bluetooth $ ./smatool
latitude=**.** longitude=*.** debug=0
2012-10-22 08:23:01 Unit Serial          = ***** none
Table 'smatool.LiveData' doesn't exist
2012-10-22 08:23:01 NO DATA for 1f 82 = 8001 NO UNITS
2012-10-22 08:23:01 NO DATA for 20 82 = 9074 NO UNITS
2012-10-22 08:23:01 NO DATA for 20 82 = 16777214 NO UNITS
2008-01-01 01:00:10 NO DATA for 21 82 = 601 NO UNITS
2008-01-01 01:00:10 NO DATA for 21 82 = 634 NO UNITS
2012-10-22 18:16:44 Total Power          = 0 Watts
Table 'smatool.LiveData' doesn't exist
2012-10-22 18:16:41 Max Phase 1          = 3000 Watts
Table 'smatool.LiveData' doesn't exist
2012-10-22 18:16:41 Max Phase 2          = 3000 Watts
Table 'smatool.LiveData' doesn't exist
2012-10-22 18:16:41 Max Phase 3          = 3000 Watts
Table 'smatool.LiveData' doesn't exist
2012-10-22 18:16:41 Unknown              = 0 Unknown
Table 'smatool.LiveData' doesn't exist
2012-10-22 18:16:41 Unknown              = 0 Unknown
Table 'smatool.LiveData' doesn't exist
2012-10-22 18:16:41 NO DATA for 80 41 = 0 NO UNITS
2012-10-22 18:16:44 Output Phase 1       = 0 Watts
Table 'smatool.LiveData' doesn't exist
2012-10-22 18:16:44 Output Phase 2       = 0 Watts
Table 'smatool.LiveData' doesn't exist
2012-10-22 18:16:44 Output Phase 3       = 0 Watts
Table 'smatool.LiveData' doesn't exist
2012-10-22 18:16:44 Line Voltage Phase 1Volts = 230 Volts
Table 'smatool.LiveData' doesn't exist
2012-10-22 18:16:44 Line Voltage Phase 2Volts = 0 Volts
Table 'smatool.LiveData' doesn't exist
2012-10-22 18:16:44 Line Voltage Phase 3Volts = 0 Volts
Table 'smatool.LiveData' doesn't exist
2012-10-22 18:16:44 Line Current Phase 1Amps = 0 Amps
Table 'smatool.LiveData' doesn't exist
2012-10-22 18:16:44 Line Current Phase 2Amps = 0 Amps
Table 'smatool.LiveData' doesn't exist
2012-10-22 18:16:44 Line Current Phase 3Amps = 0 Amps
Table 'smatool.LiveData' doesn't exist
2012-10-22 18:16:44 Grid Frequency       = 50 Hertz
Table 'smatool.LiveData' doesn't exist

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

What version of the product are you using? On what operating system?
I use a raspberry pi, with wheezy on it

Original issue reported on code.google.com by zoeper...@gmail.com on 22 Oct 2012 at 5:45

GoogleCodeExporter commented 9 years ago
I also see this error.

running on a Raspberry Pie with Raspberian wheezy

Original comment by coli...@gmail.com on 3 Nov 2012 at 1:18

GoogleCodeExporter commented 9 years ago
Had same error on raspberry pi resulting in data not being sent to PVOutput. 
Something to do with different schema. Table LiveData is not being created. 
(see c code in smamysql.c). I was able to fix this in my set up on raspberry pi 
by just running the create table sql query from the command prompt - once the 
table was created smatool started uploading to pvoutput.
In MySQL:
> use smatool;
> CREATE TABLE `LiveData` (`id` BIGINT NOT NULL AUTO_INCREMENT , `DateTime` 
datetime NOT NULL,`Inverter` varchar(10) NOT NULL,`Serial` varchar(40) NOT 
NULL, `Description` char(20) NOT NULL ,`Value` INT NOT NULL ,`Units` char(20) 
NOT NULL ,`CHANGETIME` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON 
UPDATE CURRENT_TIMESTAMP,   UNIQUE KEY 
(`DateTime`,`Inverter`,`Serial`,`Description`),PRIMARY KEY ( `id` ) ) ENGINE = 
MYISAM;

Then run smatool again if it is not alreay running and table LiveData is 
populated and pvoutput is uploaded (Note pvoutput live upload limits)

Original comment by marissan...@gmail.com on 24 Nov 2012 at 9:52

GoogleCodeExporter commented 9 years ago
Yes! Thank you. This missing "LiveData" table was the last thing that was 
needed to get smatool working on my Raspberry PI and SMA 3000 TL. Well, the 
*second* last thing. Once the missing table was created all I had to do was 
leave smatool alone and running for long enough to catch up with all the data 
it had downloaded from the 3000TL. You see, every time I ran it I kept aborting 
the thing after a few minutes as I thought it was hanging. Eventually I wised 
up and ran smatool with the debug and verbose flags and saw that it was just 
trying to upload 2 months of data to PVOutput 30 lines at a time with a delay 
between each set...and I had been crashing it out in the middle of it. Doh! I 
ran it and left it running overnight happily uploading data and the next 
morning found it had returned to the command prompt. I then setup the cronjob 
to run smatool automatically every 15 minutes and it has now been running 
without issue for 3 days so far. Happy as an extremely happy thing!

Original comment by slowboil...@gmail.com on 11 Dec 2012 at 9:38

GoogleCodeExporter commented 9 years ago
I also had the livedata error, and I resolved it in teh following way
-in the table settings: change the schema value from 3 to 2
-run ./smatool --UPDATE

=> the Livedate table is created

Original comment by lcb...@gmail.com on 26 Jan 2013 at 7:54

GoogleCodeExporter commented 9 years ago
I have exactly the same problem, and Im also using a 3000TL.

Copy pasted the TABLE_CREATE line into terminal, but I get 
ERROR 1064 (42000) You have an error in your SQL syntax ... syntax near CREATE 
TABLE LiveData (id BIGINT NULL AUTO_INCREMENT, DateTim at line 1

Im a beginner at linux/sql so dont know how to fix it.

Original comment by andy...@googlemail.com on 6 Jul 2013 at 9:04