jonneytest / sma-bluetooth

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

Did not find string #117

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
I installed & configured smatool.conf but when running "./smatool -d", I 
receive the error "Did not find string"

What version of the product are you using? On what operating system?
1. 2013-02-09-wheezy-raspbian
2. last version (received from apt-get)

Please provide any additional information below.
pi@raspberrypi ~/bin/sma-bluetooth $ ./smatool -d
variable=Inverter value=4000TL
variable=BTAddress value=00:80:25:21:28:7C
variable=BTTimeout value=
variable=0000 value=
variable=Config value=
variable=File value=sma.in.new
variable=Latitude value=50.998362
variable=Longitude value=3.954220
variable=MySqlHost value=localhost
variable=MySqlDatabase value=smatool
variable=MySqlUser value=smatool
variable=MySqlPwd value=smatool
variable=PVOutputURL value=http://pvoutput.org/service/r1/addstatus.jsp
variable=PVOutputKey value=
variable=PVOutputSid value=
variable=Inverter value=1700TL
variable=Code1 value=0x12
variable=Code2 value=0x1a
variable=Code3 value=0xd9
variable=Code4 value=0x38
variable=InvCode value=0x63
variable=InvCode value=
variable=Inverter value=2100TL
variable=Code1 value=0x17
variable=Code2 value=0x97
variable=Code3 value=0x51
variable=Code4 value=0x38
variable=InvCode value=0x63
variable=InvCode value=
variable=Inverter value=SB3000
variable=Code1 value=0x64
variable=Code2 value=0xc6
variable=Code3 value=0x46
variable=Code4 value=0x3b
variable=InvCode value=0x63
variable=InvCode value=
variable=Inverter value=3000TL
variable=Code1 value=0x32
variable=Code2 value=0x42
variable=Code3 value=0x85
variable=Code4 value=0x38
variable=InvCode value=0x71
variable=InvCode value=
variable=Inverter value=3000TLHF
variable=Code1 value=0x1b
variable=Code2 value=0xb1
variable=Code3 value=0xa6
variable=Code4 value=0x38
variable=InvCode value=0x83
variable=InvCode value=
variable=Inverter value=4000TL
variable=Code1 value=0x78
variable=Code2 value=0x21
variable=Code3 value=0xbf
variable=Code4 value=0x3a
variable=InvCode value=0x4e
variable=InvCode value=
variable=Inverter value=5000TL
variable=Code1 value=0x3f
variable=Code2 value=0x10
variable=Code3 value=0xfb
variable=Code4 value=0x39
variable=InvCode value=0x4e
variable=InvCode value=
variable=Inverter value=7000
variable=Code1 value=0xcf
variable=Code2 value=0x84
variable=Code3 value=0x84
variable=Code4 value=0x3a
variable=InvCode value=0x63
variable=InvCode value=
variable=Inverter value=10000TL
variable=Code1 value=0x69
variable=Code2 value=0x45
variable=Code3 value=0x32
variable=Code4 value=0x39
variable=InvCode value=0x80
variable=InvCode value=
variable=Inverter value=XXXXTL
variable=Code1 value=0x99
variable=Code2 value=0x35
variable=Code3 value=0x40
variable=Code4 value=0x36
variable=InvCode value=0x4e
utc=2013-02-22 19:56 local=2013-02-22 19:56 diff 0 hours
localOffset=0.000000
localOffset=0.000000 isdst=0
tzsecs=1 1
tzsecs=00 01
Before todays Almanac
SELECT sunrise FROM Almanac WHERE date=DATE_FORMAT( NOW(), "%Y-%m-%d" )
Before Check Schema
SELECT data FROM settings WHERE value='schema'
auto_set_dates
DELETE FROM DayData WHERE CurrentPower < 0 or ETotalToday = 9999999.999
SELECT DATE_FORMAT( DateTime, "%Y-%m-%d %H:%i:%S" ) FROM DayData ORDER BY 
DateTime DESC LIMIT 1
SELECT if(sunrise < NOW(),1,0) FROM Almanac WHERE date= DATE_FORMAT( NOW(), 
"%Y-%m-%d" )
SELECT if( dd.datetime > al.sunset,1,0) FROM DayData as dd left join Almanac as 
al on al.date=DATE(dd.datetime) and al.date=DATE(NOW()) WHERE 1 ORDER BY 
dd.datetime DESC LIMIT 1
Before close
Address 00:80:25:21:28:7C
datefrom=2000-01-01 00:00:00 dateto=2013-02-22 19:56:00
[18] 2013-02-22 19:56:09 Waiting for string
[18] 2013-02-22 19:56:09 waiting for: 7e 1f 00 61 7c 28 21 25 80 00 00 00 00 00 
00 00 02 00 00 04 70 00

[18] 2013-02-22 19:56:09 Waiting for data on rfcomm

Receiving
    00000000: .. .. .. .. .. .. .. .. .. .. .. .. 7e 1f 00 61
    00000010: 7c 28 21 25 80 00 00 00 00 00 00 00 02 00 00 04
    00000020: 70 00 01 00 00 00 00 01 00 00 00  rr=31

[18] 2013-02-22 19:56:09 looking for: 7e 1f 00 61 7c 28 21 25 80 00 00 00 00 00 
00 00 02 00 00 04 70 00
[18] 2013-02-22 19:56:09 received:    7e 1f 00 61 7c 28 21 25 80 00 00 00 00 00 
00 00 02 00 00 04 70 00 01 00 00 00 00 01 00 00 00

[18] 2013-02-22 19:56:09 Found string we are waiting for
[19] 2013-02-22 19:56:09 Extracting
extracting invcode=01
[20] 2013-02-22 19:56:09 Sending
[20] 2013-02-22 19:56:09 sending:
    00000000: .. .. .. .. .. .. .. .. .. .. .. .. 7e 1f 00 61
    00000010: 00 00 00 00 00 00 7c 28 21 25 80 00 02 00 00 04
    00000020: 70 00 01 00 00 00 00 01 00 00 00  cc=31

[21] 2013-02-22 19:56:09 Waiting for string
[21] 2013-02-22 19:56:09 waiting for: 7e 22 00 5c 7c 28 21 25 80 00 00 00 00 00 
00 00 05 00 7c 28 21 25 80 00

[21] 2013-02-22 19:56:09 Waiting for data on rfcomm

Receiving
    00000000: .. .. .. .. .. .. .. .. .. .. .. .. 7e 1f 00 61
    00000010: 7c 28 21 25 80 00 00 00 00 00 00 00 02 00 00 04
    00000020: 70 00 01 00 00 00 00 01 00 00 00  rr=31

[21] 2013-02-22 19:56:12 looking for: 7e 22 00 5c 7c 28 21 25 80 00 00 00 00 00 
00 00 05 00 7c 28 21 25 80 00
[21] 2013-02-22 19:56:12 received:    7e 1f 00 61 7c 28 21 25 80 00 00 00 00 00 
00 00 02 00 00 04 70 00 01 00 00 00 00 01 00 00 00

[21] 2013-02-22 19:56:12 Did not find string

Receiving
    00000000: .. .. .. .. .. .. .. .. .. .. .. .. 7e 1f 00 61
    00000010: 7c 28 21 25 80 00 00 00 00 00 00 00 02 00 00 04
    00000020: 70 00 01 00 00 00 00 01 00 00 00  rr=31

[21] 2013-02-22 19:56:15 looking for: 7e 22 00 5c 7c 28 21 25 80 00 00 00 00 00 
00 00 05 00 7c 28 21 25 80 00
[21] 2013-02-22 19:56:15 received:    7e 1f 00 61 7c 28 21 25 80 00 00 00 00 00 
00 00 02 00 00 04 70 00 01 00 00 00 00 01 00 00 00

[21] 2013-02-22 19:56:15 Did not find string
^C

Thanks in advance!

Original issue reported on code.google.com by kenny.ve...@gmail.com on 22 Feb 2013 at 7:56

GoogleCodeExporter commented 8 years ago
I think you have a problem with your password
variable=0000 value=

Original comment by s....@skynet.be on 24 Feb 2013 at 11:01

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I reinstalled and now the password is fine but I still receive the same "Did 
not find string" error :-(

root@raspberrypi:/home/pi/bin/sma-bluetooth# ./smatool -d
variable=Inverter value=4000TL
variable=BTAddress value=00:80:25:21:28:7C
variable=BTTimeout value=
variable=Password value=0000
variable=Config value=
variable=File value=sma.in.new
variable=Latitude value=
variable=Longitude value=
variable=MySqlHost value=localhost
variable=MySqlDatabase value=smatool
variable=MySqlUser value=xxxxxxxxxxxxxxxx
variable=MySqlPwd value=xxxxxxxxxxxxxxxxxxxxxxxx
variable=PVOutputURL value=http://pvoutput.org/service/r1/addstatus.jsp
variable=PVOutputKey value=
variable=PVOutputSid value=
variable=Inverter value=1700TL
variable=Code1 value=0x12
variable=Code2 value=0x1a
variable=Code3 value=0xd9
variable=Code4 value=0x38
variable=InvCode value=0x63
variable=InvCode value=
variable=Inverter value=2100TL
variable=Code1 value=0x17
variable=Code2 value=0x97
variable=Code3 value=0x51
variable=Code4 value=0x38
variable=InvCode value=0x63
variable=InvCode value=
variable=Inverter value=SB3000
variable=Code1 value=0x64
variable=Code2 value=0xc6
variable=Code3 value=0x46
variable=Code4 value=0x3b
variable=InvCode value=0x63
variable=InvCode value=
variable=Inverter value=3000TL
variable=Code1 value=0x32
variable=Code2 value=0x42
variable=Code3 value=0x85
variable=Code4 value=0x38
variable=InvCode value=0x71
variable=InvCode value=
variable=Inverter value=3000TLHF
variable=Code1 value=0x1b
variable=Code2 value=0xb1
variable=Code3 value=0xa6
variable=Code4 value=0x38
variable=InvCode value=0x83
variable=InvCode value=
variable=Inverter value=4000TL
variable=Code1 value=0x78
variable=Code2 value=0x21
variable=Code3 value=0xbf
variable=Code4 value=0x3a
variable=InvCode value=0x4e
variable=InvCode value=
variable=Inverter value=5000TL
variable=Code1 value=0x3f
variable=Code2 value=0x10
variable=Code3 value=0xfb
variable=Code4 value=0x39
variable=InvCode value=0x4e
variable=InvCode value=
variable=Inverter value=7000
variable=Code1 value=0xcf
variable=Code2 value=0x84
variable=Code3 value=0x84
variable=Code4 value=0x3a
variable=InvCode value=0x63
variable=InvCode value=
variable=Inverter value=10000TL
variable=Code1 value=0x69
variable=Code2 value=0x45
variable=Code3 value=0x32
variable=Code4 value=0x39
variable=InvCode value=0x80
variable=InvCode value=
variable=Inverter value=XXXXTL
variable=Code1 value=0x99
variable=Code2 value=0x35
variable=Code3 value=0x40
variable=Code4 value=0x36
variable=InvCode value=0x4e
utc=2013-02-24 13:29 local=2013-02-24 14:29 diff 1 hours
localOffset=1.000000
localOffset=1.000000 isdst=0
tzsecs=e11 3601
tzsecs=0e 11
Before Check Schema
SELECT data FROM settings WHERE value='schema'
auto_set_dates
SELECT DATE_FORMAT( DateTime, "%Y-%m-%d %H:%i:%S" ) FROM DayData ORDER BY 
DateTime DESC LIMIT 1
SELECT if(sunrise < NOW(),1,0) FROM Almanac WHERE date= DATE_FORMAT( NOW(), 
"%Y-%m-%d" )
SELECT if( dd.datetime > al.sunset,1,0) FROM DayData as dd left join Almanac as 
al on al.date=DATE(dd.datetime) and al.date=DATE(NOW()) WHERE 1 ORDER BY 
dd.datetime DESC LIMIT 1
Before close
Address 00:80:25:21:28:7C
datefrom=2000-01-01 00:00:00 dateto=2013-02-24 14:29:00
[18] 2013-02-24 14:29:56 Waiting for string
[18] 2013-02-24 14:29:56 waiting for: 7e 1f 00 61 7c 28 21 25 80 00 00 00 00 00 
00 00 02 00 00 04 70 00

[18] 2013-02-24 14:29:56 Waiting for data on rfcomm

Receiving
    00000000: .. .. .. .. .. .. .. .. .. .. .. .. 7e 1f 00 61
    00000010: 7c 28 21 25 80 00 00 00 00 00 00 00 02 00 00 04
    00000020: 70 00 01 00 00 00 00 01 00 00 00  rr=31

[18] 2013-02-24 14:29:56 looking for: 7e 1f 00 61 7c 28 21 25 80 00 00 00 00 00 
00 00 02 00 00 04 70 00
[18] 2013-02-24 14:29:56 received:    7e 1f 00 61 7c 28 21 25 80 00 00 00 00 00 
00 00 02 00 00 04 70 00 01 00 00 00 00 01 00 00 00

[18] 2013-02-24 14:29:56 Found string we are waiting for
[19] 2013-02-24 14:29:56 Extracting
extracting invcode=01
[20] 2013-02-24 14:29:56 Sending
[20] 2013-02-24 14:29:56 sending:
    00000000: .. .. .. .. .. .. .. .. .. .. .. .. 7e 1f 00 61
    00000010: 00 00 00 00 00 00 7c 28 21 25 80 00 02 00 00 04
    00000020: 70 00 01 00 00 00 00 01 00 00 00  cc=31

[21] 2013-02-24 14:29:56 Waiting for string
[21] 2013-02-24 14:29:56 waiting for: 7e 22 00 5c 7c 28 21 25 80 00 00 00 00 00 
00 00 05 00 7c 28 21 25 80 00

[21] 2013-02-24 14:29:56 Waiting for data on rfcomm

Receiving
    00000000: .. .. .. .. .. .. .. .. .. .. .. .. 7e 1f 00 61
    00000010: 7c 28 21 25 80 00 00 00 00 00 00 00 02 00 00 04
    00000020: 70 00 01 00 00 00 00 01 00 00 00  rr=31

[21] 2013-02-24 14:29:59 looking for: 7e 22 00 5c 7c 28 21 25 80 00 00 00 00 00 
00 00 05 00 7c 28 21 25 80 00
[21] 2013-02-24 14:29:59 received:    7e 1f 00 61 7c 28 21 25 80 00 00 00 00 00 
00 00 02 00 00 04 70 00 01 00 00 00 00 01 00 00 00

[21] 2013-02-24 14:29:59 Did not find string

Receiving
    00000000: .. .. .. .. .. .. .. .. .. .. .. .. 7e 1f 00 61
    00000010: 7c 28 21 25 80 00 00 00 00 00 00 00 02 00 00 04
    00000020: 70 00 01 00 00 00 00 01 00 00 00  rr=31

[21] 2013-02-24 14:30:02 looking for: 7e 22 00 5c 7c 28 21 25 80 00 00 00 00 00 
00 00 05 00 7c 28 21 25 80 00
[21] 2013-02-24 14:30:02 received:    7e 1f 00 61 7c 28 21 25 80 00 00 00 00 00 
00 00 02 00 00 04 70 00 01 00 00 00 00 01 00 00 00

[21] 2013-02-24 14:30:02 Did not find string

Receiving
    00000000: .. .. .. .. .. .. .. .. .. .. .. .. 7e 1f 00 61
    00000010: 7c 28 21 25 80 00 00 00 00 00 00 00 02 00 00 04
    00000020: 70 00 01 00 00 00 00 01 00 00 00  rr=31

[21] 2013-02-24 14:30:05 looking for: 7e 22 00 5c 7c 28 21 25 80 00 00 00 00 00 
00 00 05 00 7c 28 21 25 80 00
[21] 2013-02-24 14:30:05 received:    7e 1f 00 61 7c 28 21 25 80 00 00 00 00 00 
00 00 02 00 00 04 70 00 01 00 00 00 00 01 00 00 00

[21] 2013-02-24 14:30:05 Did not find string

Receiving
    00000000: .. .. .. .. .. .. .. .. .. .. .. .. 7e 1f 00 61
    00000010: 7c 28 21 25 80 00 00 00 00 00 00 00 02 00 00 04
    00000020: 70 00 01 00 00 00 00 01 00 00 00  rr=31

[21] 2013-02-24 14:30:08 looking for: 7e 22 00 5c 7c 28 21 25 80 00 00 00 00 00 
00 00 05 00 7c 28 21 25 80 00
[21] 2013-02-24 14:30:08 received:    7e 1f 00 61 7c 28 21 25 80 00 00 00 00 00 
00 00 02 00 00 04 70 00 01 00 00 00 00 01 00 00 00

[21] 2013-02-24 14:30:08 Did not find string

Receiving
    00000000: .. .. .. .. .. .. .. .. .. .. .. .. 7e 1f 00 61
    00000010: 7c 28 21 25 80 00 00 00 00 00 00 00 02 00 00 04
    00000020: 70 00 01 00 00 00 00 01 00 00 00  rr=31

[21] 2013-02-24 14:30:11 looking for: 7e 22 00 5c 7c 28 21 25 80 00 00 00 00 00 
00 00 05 00 7c 28 21 25 80 00
[21] 2013-02-24 14:30:11 received:    7e 1f 00 61 7c 28 21 25 80 00 00 00 00 00 
00 00 02 00 00 04 70 00 01 00 00 00 00 01 00 00 00

[21] 2013-02-24 14:30:11 Did not find string

Receiving
    00000000: .. .. .. .. .. .. .. .. .. .. .. .. 7e 1f 00 61
    00000010: 7c 28 21 25 80 00 00 00 00 00 00 00 02 00 00 04
    00000020: 70 00 01 00 00 00 00 01 00 00 00  rr=31

[21] 2013-02-24 14:30:14 looking for: 7e 22 00 5c 7c 28 21 25 80 00 00 00 00 00 
00 00 05 00 7c 28 21 25 80 00
[21] 2013-02-24 14:30:14 received:    7e 1f 00 61 7c 28 21 25 80 00 00 00 00 00 
00 00 02 00 00 04 70 00 01 00 00 00 00 01 00 00 00

[21] 2013-02-24 14:30:14 Did not find string
^C

Original comment by kenny.ve...@gmail.com on 24 Feb 2013 at 1:32

GoogleCodeExporter commented 8 years ago
it looks like he can find the first string but not the second (the inverter has 
2 strings attachted)

Original comment by kenny.ve...@gmail.com on 24 Feb 2013 at 1:33

GoogleCodeExporter commented 8 years ago
are you sure your inverter is a 4000TL ? 

SMA also have 2 other models in the 4000 range, namely the 4000TL-20 and the 
4000L-21. Each oene has different inverter codes in invcode.in
Try adding the 4000TL20 and changing your config to use it;
Inverter        4000TL20
Code1           0x67
Code2           0x6f
Code3           0x9a
Code4           0x36
InvCode         0x4e

Original comment by marcus.j...@gmail.com on 26 Feb 2013 at 9:46

GoogleCodeExporter commented 8 years ago
sorry, it's an 4000TL-20 (I didn't know it was different)
I'll try tonight!

Original comment by kenny.ve...@gmail.com on 27 Feb 2013 at 9:26

GoogleCodeExporter commented 8 years ago
still the same with other inverter code:
Receiving
    00000000: .. .. .. .. .. .. .. .. .. .. .. .. 7e 1f 00 61
    00000010: 7c 28 21 25 80 00 00 00 00 00 00 00 02 00 00 04
    00000020: 70 00 01 00 00 00 00 01 00 00 00  rr=31

[21] 2013-02-27 17:51:15 looking for: 7e 22 00 5c 7c 28 21 25 80 00 00 00 00 00 
00 00 05 00 7c 28 21 25 80 00
[21] 2013-02-27 17:51:15 received:    7e 1f 00 61 7c 28 21 25 80 00 00 00 00 00 
00 00 02 00 00 04 70 00 01 00 00 00 00 01 00 00 00

[21] 2013-02-27 17:51:15 Did not find string

Original comment by kenny.ve...@gmail.com on 27 Feb 2013 at 4:51

GoogleCodeExporter commented 8 years ago
I'm having very similar problems to this...

My background is that I've had a Raspberry Pi running the original Squeeze 
distribution of Debian from the Raspberry Pi Foundation with smatool connecting 
to my 4000TL-20 gathering stats for just over a year now with no problems 
(apart from occasional USB/Bluetooth problems requiring a reboot).

However, since a couple of days ago I can no longer get it to initialise a 
connection. The bluetooth side of things is working and it receives data from 
the inverter including extracting the NetID, but the inverter doesn't seem to 
respond to the initial send from smatool (line 20 of sma.in.new) and just 
continues to broadcast the same initial sequence of bytes as reported by the OP.

Based on what was said earlier about differences between the 4000TL and 
4000TL-20 I've tried adding the additional 4000TL20 entry to invcode.in and 
changing my config to use it, but it makes no difference (plus, bear in mind 
that it has been working fine for over a year using the 4000TL codes!)

I've tried connecting to the inverter with Sunny Explorer and it works just 
fine.

So I'm out of ideas :( I can provide verbose debug output if it helps but it 
will look almost identical to what the OP has already provided.

Can anyone help with this please as it's driving me mad!

Regards,
Darren

Original comment by darrensc...@gmail.com on 8 Mar 2013 at 12:17

GoogleCodeExporter commented 8 years ago
Have you tried already another BT adapter?
It's not because your BT "seems" to work, it can actually connect to the 
inverter. We've seen similar things with SMAspot on RasPi

Original comment by s....@skynet.be on 8 Mar 2013 at 12:30

GoogleCodeExporter commented 8 years ago
Thanks for the response.

No I haven't tried another BT adapter, primarily because it has been working 
for over a year with the existing one so I assumed if there were problems with 
this particular adapter I would have seen them long before now.

It's interesting that you mention SMAspot because I have actually tried that 
too today for the first time and it experiences similar symptoms (no response 
to the initial handshake, just continual "broadcast" type messages from the 
inverter).

I'll see if I can locate another BT adapter and give that a try. Will report 
back as soon as I have an update... 

Original comment by darrensc...@gmail.com on 8 Mar 2013 at 12:59

GoogleCodeExporter commented 8 years ago
OK - here's an update from me on this issue...

I've just tried replacing the previous Belkin FBT008 Broadcom based class 1 BT 
adapter that I have been using successfully with smatool for over a year - but 
which then suddenly stopped working - with a Technika (Tesco own brand) TKB109 
class 2 adapter. I was initially sceptical about whether this would make any 
difference... but I can report that smatool worked first time with the new 
adapter!

Does anyone have any idea why a BT adapter that was working for over a year 
would suddenly stop working with smatool (and SMAspot)? I have two identical 
adapters and I tried both of them, but neither worked with these tools. The 
adapters still work fine with other applications and on other computers 
(including Sunny Explorer on a Windows 7 machine).

Anyway, if anyone else experiences connection problems like this, take it from 
me it is definitely worth trying a different brand of BT adapter! Thanks for 
the help with resolving this issue for me.

Regards,
Darren

Original comment by darrensc...@gmail.com on 9 Mar 2013 at 4:47