-
Notifications
You must be signed in to change notification settings - Fork 66
Checksums not always on r[:-1] ? #7
Comments
In terms of the checksums... I think this may be because I'm not clearing things correctly between transactions (runs of fitbit.py or fitbit_client.py), so we get truncated replies or replies from older commands, which don't line up correctly. It's still one of the major bugs that's holding up a more serious release. And don't worry, you're not dumping steps into my account. The client ID in fitbit_client.py is a random uuid I generated. That identifies the base station that the information was received off of, but doesn't identify the username/tracker to upload data from. You'd need my actual tracker serial to do that, and the tracker serial is only 5 bytes, not a UUID. :) |
Hi again Kyle, thanks for the explanations... just for the record, I usually get this one on the first run: ; fitbit_client.py Then afterwards (usually on the second run) it hangs as described on issue 6 (on that same last packet). I wonder why the reset() calls on fitbit.py's init is not enough to reach that clean state between runs... are there more opcodes to be reversed to do proper resets/initializations :-? |
Sometimes you end up with a single ANT message split across two USB packets - could that cause this error? |
Totally could be part of it, yes. I need to make message handling more robust. |
I've noticed that checksum errors are intermittent, mostly on the very first transaction, not very deterministic though, after a few tries it does not complain anymore. But that one caught my eye, it happened in the middle of a large conversation:
<-- ['a4', '03', '40', '00', '01', '05', 'e3']
Receive packet: array('B', [164, 9, 79, 0, 62, 97, 14, 0, 0, 0, 0, 0, 179])
9
Checksum: 179
<-- ['a4', '09', '4f', '00', '3e', '61', '0e', '00', '00', '00', '00', '00', 'b3']
--> ['a4', '09', '50', '00', '3f', '80', '0e', '00', '00', '00', '00', '61', '2d']
--> ['a4', '09', '50', '20', '00', 'c7', 'ea', '4d', '00', '00', '00', '00', 'bd']
--> ['a4', '09', '50', 'c0', 'ff', 'ff', 'fe', 'ff', 'ff', 'ff', '00', '00', '3c']
Receive packet: array('B', [164, 9, 78, 0, 62, 97, 14, 0, 0, 0, 0, 0, 178, 164, 3])
9
Checksum: 164
Traceback (most recent call last):
File "fitbit_client.py", line 132, in
sys.exit(main())
File "fitbit_client.py", line 128, in main
f.run_upload_request()
File "fitbit_client.py", line 113, in run_upload_request
self.info_dict["opResponse[%d]" % op_index] = base64.b64encode(''.join([chr(x) for x in self.fitbit.run_opcode(o["opcode"], o["payload"])]))
File "/home/romanvg/dev/libfitbit/python/fitbit.py", line 233, in run_opcode
data = self.receive_acknowledged_reply()
File "/home/romanvg/dev/libfitbit/python/antprotocol/protocol.py", line 205, in receive_acknowledged_reply
status = self._receive()
File "/home/romanvg/dev/libfitbit/python/antprotocol/libusb.py", line 85, in _receive
raise ANTReceiveException("Checksums for packet do not match received values!")
antprotocol.protocol.ANTReceiveException: Checksums for packet do not match received values!
Oh, btw, I may inadvertedly dumping my steps on your account, since I haven't change the UUID or anything (using the one that comes on the script itself.... sorry :-S).
The text was updated successfully, but these errors were encountered: