openyou/libfitbit

Freezes forever in sync

brainstorm opened this issue · 3 comments

First time ever I try it... I wonder why it stucks on tha last receive :-S

; fitbit_client.py
<-- ['b7', 'a4', '09', '4e', '00', '21', '75', '00', '00', '00', '00', '00', '00', 'b7', 'a4', '09', '4e', '00', '21', '75', '00', '00', '00', '00', '00', '00', 'b7', 'a4', '09', '4e', '00', '21', '75', '00', '00', '00', '00', '00', '00', 'b7', 'a4', '09', '4e', '00', '21', '75', '00', '00', '00', '00', '00', '00', 'b7', 'a4', '09', '4e', '00', '21', '75', '00', '00', '00', '00', '00']
--> ['a4', '01', '4a', '00', 'ef']
<-- ['a4', '01', '6f', '20', 'ea']
--> ['a4', '09', '46', '00', '00', '00', '00', '00', '00', '00', '00', '00', 'eb']
<-- ['a4', '03', '40', '00', '46', '00', 'a1']
--> ['a4', '03', '42', '00', '00', '00', 'e5']
<-- ['a4', '03', '40', '00', '42', '00', 'a5']
--> ['a4', '03', '43', '00', '00', '10', 'f4']
<-- ['a4', '03', '40', '00', '43', '00', 'a4']
--> ['a4', '02', '45', '00', '02', 'e1']
<-- ['a4', '03', '40', '00', '45', '00', 'a2']
--> ['a4', '02', '47', '00', '03', 'e2']
<-- ['a4', '03', '40', '00', '47', '00', 'a0']
--> ['a4', '02', '44', '00', 'ff', '1d']
<-- ['a4', '03', '40', '00', '44', '00', 'a3']
--> ['a4', '05', '51', '00', 'ff', 'ff', '01', '01', 'f0']
<-- ['a4', '03', '40', '00', '51', '00', 'b6']
--> ['a4', '01', '4b', '00', 'ee']
<-- ['a4', '03', '40', '00', '4b', '00', 'ac']

qdot commented

This is an issue with the beacon, or lack thereof. I usually test libfitbit with the fitbit on the base, which means the beacon signal always gets a response. Obviously, this is a bad idea. :)

I need to make the beacon timeout after a second, and retry. I'll try to get that fixed ASAP, but if you test with the fitbit on the base, it should work that way.

Yeah, that worked, thanks !

qdot commented

Actually, there wasn't even a bug in the first place. The beacon signal /is/ getting sent, it can just take a variable amount of time to contact the tracker. Not only that, if you've just run a web client process, the last thing the web client does is turn off the tracker beacon response for 15 minutes.