Tigge / antfs-cli

Extracts FIT files from ANT-FS based sport watches such as Garmin Forerunner 60, 405CX, 310XT, 610 and 910XT.
MIT License
312 stars 76 forks source link

Set time: Interrupted: array index out of range #137

Closed spinwell closed 9 years ago

spinwell commented 9 years ago

Hello,

I installed your great software (first setuptools, after openant, after antfs-cli) but I get the following error:

antfs-cli Driver available: [<class ant.base.driver.SerialDriver at 0x7f8ef2cb3870>, <class ant.base.driver.USB2Driver at 0x7f8ef2cb3ef0>, <class ant.base.driver.USB3Driver at 0x7f8ef2cb3f58>]
 - Using: ant.base.driver.USB3Driver
Request basic information...
  Capabilities:  array('B', [8, 8, 0, 186, 54, 0, 223])
Starting system...
Key done...
Searching...
Authenticating with GARMIN SWIM (3897361840)
 - Passkey: OK
Traceback (most recent call last):
  File "build/bdist.linux-x86_64/egg/antfs_cli/program.py", line 354, in main
    g.start()
  File "/usr/local/lib/python2.7/dist-packages/ant/fs/manager.py", line 217, in start
    self._main()
  File "/usr/local/lib/python2.7/dist-packages/ant/fs/manager.py", line 155, in _main
    self.on_transport(beacon)
  File "build/bdist.linux-x86_64/egg/antfs_cli/program.py", line 196, in on_transport
    result = self.set_time()
  File "/usr/local/lib/python2.7/dist-packages/ant/fs/manager.py", line 353, in set_time
    result = self._get_commandpipe()
  File "/usr/local/lib/python2.7/dist-packages/ant/fs/manager.py", line 228, in _get_commandpipe
    return ant.fs.commandpipe.parse(self.download(0xfffe))
  File "/usr/local/lib/python2.7/dist-packages/ant/fs/commandpipe.py", line 209, in parse
    commandpipe_type = _classes[data[0]]
IndexError: array index out of range
 - Set time: Interrupted: array index out of range

So, no download from my Garmin Swim. Any suggestion? Thank you for the help and for this software.

p.s.: I am running Ubuntu 14.04 for 64bit, Python 2.7

Tigge commented 9 years ago

You can check out https://github.com/Tigge/antfs-cli/commit/2989272068df7f170417ca056a488cfd1562963f which should work, but please run it again with --debug and either paste the output in a https://gist.github.com or send an email to me and I'll try to debug it. I recently pushed a time sync feature that looks like it caused this error.

spinwell commented 9 years ago

Here is the debug:

https://gist.github.com/spinwell/a609d760f15f16d43ca6

BTW, the 2989272 version worked:

Downloading 6 file(s) Downloading 1989-12-31_01-25-32_1_4.fit: [..............................] ETA: 0:00:00 Downloading 1989-12-31_01-02-23_3_6.fit: [..............................] ETA: 0:00:00 Downloading 1989-12-31_01-02-23_2_5.fit: [..............................] ETA: 0:00:00 Downloading 2015-06-15_08-29-46_4_11.fit: [..............................] ETA: 0:00:00 Downloading 2015-06-16_08-30-45_10_8.fit: [..............................] ETA: 0:00:00 Downloading 2015-06-16_08-30-45_4_13.fit: [..............................] ETA: 0:00:00

Thank you!

Tigge commented 9 years ago

(I'll just leave this open until I've looked through the logs and fixed this)

Tigge commented 9 years ago

Ok, I've tracked this error down and will push a fix to openant to make sure it follow the specification when it comes to download request responses. If it for some reason can not download the file (in this case it exists but isn't downloadable) the response does not include any data or a footer. I have not taken this into account. Thank you for helping me track down this.

Tigge commented 9 years ago

I've filed https://github.com/Tigge/openant/issues/13 for this problem.