nebgor / sma-bluetooth

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

No uploading to pvoutput #40

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
Any time I run 'smatool'

What is the expected output? What do you see instead?
I expect to see my live data updated on pvoutput.  Nothing is sent.  The data 
does appear in the local database though.

What version of the product are you using? On what operating system?
0.14 on Fedora 12

Please provide any additional information below.

I get the following data in mysql:
mysql> select * from DayData;
+---------------------+----------+------------+--------------+-------------+----
------+---------------------+
| DateTime            | Inverter | Serial     | CurrentPower | ETotalToday | 
PVOutput | CHANGETIME          |
+---------------------+----------+------------+--------------+-------------+----
------+---------------------+
| 2011-09-29 14:15:00 | 3300     | 2001823863 |          768 |       0.126 | 
NULL     | 0000-00-00 00:00:00 |
| 2011-09-29 14:20:00 | 3300     | 2001823863 |         1476 |       0.249 | 
NULL     | 0000-00-00 00:00:00 |
| 2011-09-29 14:25:00 | 3300     | 2001823863 |         1344 |       0.361 | 
NULL     | 0000-00-00 00:00:00 |
| 2011-09-29 14:30:00 | 3300     | 2001823863 |         1236 |       0.464 | 
NULL     | 0000-00-00 00:00:00 |
| 2011-09-29 14:35:00 | 3300     | 2001823863 |         1656 |       0.602 | 
NULL     | 0000-00-00 00:00:00 |
| 2011-09-29 14:40:00 | 3300     | 2001823863 |         1572 |       0.733 | 
NULL     | 0000-00-00 00:00:00 |
| 2011-09-29 14:45:00 | 3300     | 2001823863 |         1392 |       0.849 | 
NULL     | 0000-00-00 00:00:00 |

Besides that, I've used Wireshark to see if any data is being transmitted at 
all to PVOutput - none is.

Using an SB3300.

Original issue reported on code.google.com by mar...@defiler.co.uk on 30 Sep 2011 at 2:59

GoogleCodeExporter commented 9 years ago
I also cannot get output to pvoutput.org.  Additionally my mysql database 
logging appears to work but with a NULL value in the PVoutput column? Is this 
expected?  My Almanac table contains records but no sunrise times are recorded.

I have set up an old laptop running debian 6
uname -a
Linux solarcollector 2.6.32-5-686 #1 SMP Mon Oct 3 04:15:24 UTC 2011 i686 
GNU/Linux

I have setup my crontab to run every 10 minutes.  All console output is 
discarded to /dev/null 2>&1

regards

Paul

Original comment by oldpau...@gmail.com on 28 Oct 2011 at 10:39

GoogleCodeExporter commented 9 years ago
The NULL value is correct.  That gives you the date/time that the data was 
uploaded to PVOutput.  Since it's not uploading, it's not updating that column.

Would you like me to upload my perl script that does the magic for me.  It's a 
bit clunky (moreso when my perl libraries screwed up during an update to Fedora 
15), but it seems stable.

Original comment by mar...@defiler.co.uk on 28 Oct 2011 at 11:44

GoogleCodeExporter commented 9 years ago
yes please, I will try anything!

Original comment by oldpau...@gmail.com on 28 Oct 2011 at 1:27

GoogleCodeExporter commented 9 years ago
Here's my clunky perl script.  There are a few variables to set in the 'main' 
function.  They're split into the MySQL config variables and PVOutput 
variables.  Should be self-explanatory.

At the start of the 'main' function, you'll need to modify the path in $command 
to point to the folder containing the sma-bluetooth 'smatool' - it can reside 
in the same folder as smatool.pl quite happily.  Obviously make sure they're 
both executable.

You'll need the Math::Round library installed in perl - you can grab it off 
cpan easily.

Original comment by mar...@defiler.co.uk on 28 Oct 2011 at 8:25

Attachments:

GoogleCodeExporter commented 9 years ago
Hi,

 Thanks for sending me the file, however, my browser tries to open your
attachment as a http: link not as a perl script.  Please could you mail the
attachment to me at oldpaulie@gmail.com and I would be grateful to give your
'clunky' script a go.  I'm sure it would be better than any script I could
write.

Original comment by oldpau...@gmail.com on 29 Oct 2011 at 4:08

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Hi,

Even with your script I am getting date errors. Any idea?

100    94  100    56  100    38     88     60 --:--:-- --:--:-- --:--:--   184
Response: Bad request 400: Date is too far in the past [20120708]

2012-07-08 17:20:00     3000TLHF        2120171783      132     2.279   NULL   
0000-00-00 00:00:00
2012-07-08 17:20:00, 3000TLHF, 2120171783, 132, 2.279
Command: curl -d "d=20120708" -d "t=17:20" -d "c1=1" -d "v1=2279" -d "v2=132" 
-H "X-Pvoutput-Apikey: 9797789" -H "X-Pvoutput-SystemId: 9567" 
http://pvoutput.org/service/r2/addstatus.jsp
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    94  100    56  100    38     89     60 --:--:-- --:--:-- --:--:--   186
Response: Bad request 400: Date is too far in the past [20120708]

2012-07-08 17:25:00     3000TLHF        2120171783      120     2.289   NULL   
0000-00-00 00:00:00
2012-07-08 17:25:00, 3000TLHF, 2120171783, 120, 2.289
Command: curl -d "d=20120708" -d "t=17:25" -d "c1=1" -d "v1=2289" -d "v2=120" 
-H "X-Pvoutput-Apikey: 876868" -H "X-Pvoutput-SystemId: 9567" 
http://pvoutput.org/service/r2/addstatus.jsp
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    94  100    56  100    38     89     60 --:--:-- --:--:-- --:--:--   183
Response: Bad request 400: Date is too far in the past [20120708]

2012-07-08 17:30:00     3000TLHF        2120171783      132     2.300   NULL   
0000-00-00 00:00:00
2012-07-08 17:30:00, 3000TLHF, 2120171783, 132, 2.300
Command: curl -d "d=20120708" -d "t=17:30" -d "c1=1" -d "v1=2300" -d "v2=132" 
-H "X-Pvoutput-Apikey: 75577675" -H "X-Pvoutput-SystemId: 9567" 
http://pvoutput.org/service/r2/addstatus.jsp
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    83  100    45  100    38     71     60 --:--:-- --:--:-- --:--:--   149
Response: Forbidden 403: Exceeded 60 requests per hour

Original comment by piet.sik...@gmail.com on 23 Jul 2012 at 1:09

GoogleCodeExporter commented 9 years ago
PVOutput will only accept "live" values up to 7 days in the past, so those 
dates won't work.  Each time you try to send an update it counts towards your 
60-per-hour cap, even if the update fails.  So what you need to do is just put 
a date into the PVOutput field of the database for any values more than 7 days 
old.
If you take values up to 14 days old, you can put them into a CSV file and 
upload them manually with your web browser.  That might help to clear some of 
your older values out too - that's how I primed my uploads with my oldest 
values when I first set it up.

Hope that helps.

Original comment by mar...@defiler.co.uk on 23 Jul 2012 at 4:20

GoogleCodeExporter commented 9 years ago
Thanks. It did help but only once.

I truncated the day data table and the first time everything went well. My plan 
is to execute the script every half hour (cron). The second time I ran the 
script this was the output. Never mind the power, it was dark at the time. But 
the date (1970) ??

cd /home/piet/smatool ; ./smatool -from "2012-07-23 21:00:00" -to "2012-07-23 
22:00:00"
2012-07-23 21:38:39 Unit Serial          = 3821139 none
2012-07-23 21:38:39 NO DATA for 1f 82 = 8001 NO UNITS
2012-07-23 21:38:39 NO DATA for 20 82 = 9071 NO UNITS
2001-01-01 01:00:07 NO DATA for 21 82 = 601 NO UNITS
2001-01-01 01:00:07 NO DATA for 21 82 = 635 NO UNITS
2012-07-23 21:38:45 Total Power          = 0 Watts
2012-07-23 22:02:10 Max Phase 1          = 2000 Watts
2012-07-23 22:02:10 Max Phase 2          = 2000 Watts
2012-07-23 22:02:10 Max Pahse 3          = 2000 Watts
2012-07-23 22:02:10 Unknown              = 0 Unknown
2012-07-23 22:02:10 Unknown              = 0 Unknown
2012-07-23 22:02:10 NO DATA for 80 41 = 0 NO UNITS
2012-07-23 21:38:45 Output Phase 1       = 0 Watts
2012-07-23 21:38:45 Output Phase 2       = 0 Watts
2012-07-23 21:38:45 Output Phase 3       = 0 Watts
2012-07-23 21:38:45 Line Voltage Phase 1Volts = 0 Volts
2012-07-23 21:38:45 Line Voltage Phase 2Volts = 0 Volts
2012-07-23 21:38:45 Line Voltage Phase 3Volts = 0 Volts
2012-07-23 21:38:45 Line Current Phase 1Amps = 0 Amps
2012-07-23 21:38:45 Line Current Phase 2Amps = 0 Amps
2012-07-23 21:38:45 Line Current Phase 3Amps = 0 Amps
2012-07-23 21:38:45 Grid Frequency       = 0 Hertz

22/8/1970 15:58:08  total=18446180161683456.000 Kwh current=0 Watts togo=0 i=11 
crc=1939907936
1/1/1970 01:04:15  total=0.000 Kwh current=-221354173485073563648 Watts togo=0 
i=23 crc=1939907936Date Error! prev=20185088 current=255

Any thoughts?

Original comment by piet.sik...@gmail.com on 24 Jul 2012 at 6:52

GoogleCodeExporter commented 9 years ago
Yep - my 3300 throws up spurious results like that too.  That's why I have my 
cron job set to poll the inverter every 5 minutes, and it returns a whole hour 
of data.  That means if the inverter is handing out gibberish like this it gets 
a lot of attempts to get it right.

Original comment by mar...@defiler.co.uk on 24 Jul 2012 at 11:44

GoogleCodeExporter commented 9 years ago
Thanks, I'll try that too. Do I have to empty my daydata table before the 7th 
day? Or is the script smart enough?

Original comment by piet.sik...@gmail.com on 24 Jul 2012 at 2:15

GoogleCodeExporter commented 9 years ago
Not at all.  I have 300 days of data in my table - the script will update the 
PVOutput field with a timestamp of when the reading was sucessfully uploaded.  
It checks for records with a NULL timestamp for uploading.  Leaving uploaded 
data in the table is absolutely fine.

Original comment by mar...@defiler.co.uk on 24 Jul 2012 at 2:33

GoogleCodeExporter commented 9 years ago
You are right. It is weird though, I've got an android app which retrieves the 
right data every time it connects but smatool fails most of the time.

Original comment by piet.sik...@gmail.com on 25 Jul 2012 at 7:38