nebgor / sma-bluetooth

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

starting smatool at night results in bluetooth fail #6

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
nekobasu:/usr/local/src/sma-bluetooth# ./smatool
Error connecting to 00:80:25:09:E0:06
Error connecting to 00:80:25:09:E0:06
Error connecting to 00:80:25:09:E0:06
Error connecting to 00:80:25:09:E0:06

it probably should check the sunrise first to see if it is worth trying to 
connect

Also should it closeout or stay running? My thought is that it should stay 
running - that way I can do smatool & and have it collect data/update pvoutput 
quietly in the background without me worrying about it..

Original issue reported on code.google.com by b...@ticm.com on 12 Jan 2011 at 1:47

GoogleCodeExporter commented 8 years ago
Starting it during the day is fine... however without any arguments we get 
this...
nekobasu:/usr/local/src/sma-bluetooth# ./smatool
2011-01-13 07:34:26 Current power = 567 Watt
ffffffff

ffffffff
bad from
ffffffff

ffffffff
bad from

The interesting bit is that its taking keyboard input - it only gives the 
ffffffff at first, but if I hit return then we get the "bad from"

Original comment by b...@ticm.com on 13 Jan 2011 at 12:37

GoogleCodeExporter commented 8 years ago
It should still connect during the night - It wakes up my 3000TL and then 
connects, that's why I added the almanac.

Original comment by stephenb...@gmail.com on 13 Jan 2011 at 6:13

GoogleCodeExporter commented 8 years ago
Bad from has been fixed. 

Original comment by stephenb...@gmail.com on 13 Jan 2011 at 6:14

GoogleCodeExporter commented 8 years ago

Original comment by stephenb...@gmail.com on 13 Jan 2011 at 6:14

GoogleCodeExporter commented 8 years ago
Still occurs.. - ran with -v -d and got..

.
.
.
[48] Found string we are waiting for
7e 18 00 66 06 e0 09 25 80 00 00 00 00 00 00 00 04 00 05 00 00 00 

[49] Sending
ffffffff

ffffffff
bad from
ffffffff

ffffffff
bad from^C
nekobasu:/usr/local/src/sma-bluetooth-local#

Not sure what is printing out the ffffffff and responding to keyboard input...

Original comment by b...@ticm.com on 13 Jan 2011 at 7:21

GoogleCodeExporter commented 8 years ago
Found of of the problems..

in is_light the sql query only checks to see if NOW is after sunrise, it 
doesn't check to see if it is before sunset.

Change to -

    //Get Start of day value
    sprintf(SQLQUERY,"SELECT if(((sunrise < NOW()) AND (sunset > NOW())),1,0) FROM Almanac WHERE date= DATE_FORMAT( NOW(), \"%%Y-%%m-%%d\" ) " );

and it works nicely.

Original comment by b...@ticm.com on 13 Jan 2011 at 2:25