bt-scale
bt-scale copied to clipboard
Cannot read from Beurer BF700
I'm trying to run on a Raspberry Pi 4 but after connecting I always get an error. Do you know what can i do to solve this?
Thanks
connecting...
connection_status -> successful
---------------------------------------------
init?
char-write-req 0x002e E601
---------------------------------------------
Traceback (most recent call last):
File "scale.py", line 461, in start_measurement_script
child.expect("0x002e value: e6 00 20", timeout=4)
File "/home/pi/.local/lib/python2.7/site-packages/pexpect/spawnbase.py", line 344, in expect
timeout, searchwindowsize, async_)
File "/home/pi/.local/lib/python2.7/site-packages/pexpect/spawnbase.py", line 372, in expect_list
return exp.expect_loop(timeout)
File "/home/pi/.local/lib/python2.7/site-packages/pexpect/expect.py", line 181, in expect_loop
return self.timeout(e)
File "/home/pi/.local/lib/python2.7/site-packages/pexpect/expect.py", line 144, in timeout
raise exc
TIMEOUT: Timeout exceeded.
<pexpect.pty_spawn.spawn object at 0xb6c9f810>
command: /usr/bin/gatttool
args: ['/usr/bin/gatttool', '-I', '-b', '00:13:04:1A:9F:5F']
buffer (last 100 chars): 'Error: \x1b[0mCharacteristic Write Request failed: Invalid handle\r\n\x1b[0;94m[00:13:04:1A:9F:5F]\x1b[0m[LE]> '
before (last 100 chars): 'Error: \x1b[0mCharacteristic Write Request failed: Invalid handle\r\n\x1b[0;94m[00:13:04:1A:9F:5F]\x1b[0m[LE]> '
after: <class 'pexpect.exceptions.TIMEOUT'>
match: None
match_index: None
exitstatus: None
flag_eof: False
pid: 2253
child_fd: 5
closed: False
timeout: 30
delimiter: <class 'pexpect.exceptions.EOF'>
logfile: None
logfile_read: None
logfile_send: None
maxread: 2000
ignorecase: False
searchwindowsize: None
delaybeforesend: 0.05
delayafterclose: 0.1
delayafterterminate: 0.1
searcher: searcher_re:
0: re.compile('0x002e value: e6 00 20')
I have the same issue. Did you finnd the solution?
Having the same issue. Increased the timeout to 10, but this does not help. Anyone knows something?
I figured for my BF720 that removing child.expect("0x002e value: e6 00 20", timeout=4)
in line 461 of scale.py allows the script to progress abit further. I could not find any hint that such a string would appear in the child's stream.
me@raspi:~/myfiles/bt-scale $ python2.7 scale.py
connecting...
connection_status -> successful
---------------------------------------------
init?
char-write-req 0x002e E601
init.
---------------------------------------------
set scale time
char-write-req 0x002e E9652D8758
---------------------------------------------
get scale status
char-write-req 0x002e E74F0000000000000000
unable to get scale status, will exit now. (TODO: implement retry)