Open patrickremy opened 7 years ago
Thank you! It is absolutely possible to have it resume failed downloads.
There are a lot more that could be done with regards to error recovery, right now it just aborts everything and fails with an error, if it fails during a packet transfer it could try to resend it, or if the connection breaks it could reestablish (this would work a bit different depending on the error and where it occurs.
The other thing that could be done is to save whatever has been downloaded already while the transfer is still ongoing (perhaps to a temporary file) and if the program exits for some reason it could resume from that point when we run it again.
Both of these things should probably be (at least mostly) done in the https://github.com/Tigge/openant project.
Have you been able to test whether Garmin's ANT-FS stack supports the download resume feature ?
I've been trying a bit with my 910XT, and I seem to be getting a "CRC incorrect" response whatever "Initial Request/ CRC seed" combination I try in my Download Request command (logs below)
Any idea what I could be doing wrong ?
Patrick
==================== Example:
....
MainThread 2017-08-23 20:08:10,571 ant.fs.manager DEBUG Download 26, o7680, c47837 (manager.py:322)
MainThread 2017-08-23 20:08:10,571 ant.fs.command DEBUG packing 'D\t\x1a\x00\x00\x1e\x00\x00\x00\x01\xdd\xba\x00\x00\x00\x00' in array('B', [68, 9, 26, 0, 0, 30, 0, 0, 0, 1, 221, 186, 0, 0, 0, 0]),<type 'array.array'> (command.py:79)
.....
MainThread 2017-08-23 20:08:25,787 ant.fs.manager DEBUG Download 26 timeout (manager.py:345)
MainThread 2017-08-23 20:08:25,798 ant.fs.manager DEBUG Run 5 (manager.py:164)
.....
MainThread 2017-08-23 20:10:42,436 ant.fs.manager DEBUG Download 26, o7680, c47837 (manager.py:322)
MainThread 2017-08-23 20:10:42,436 ant.fs.command DEBUG packing 'D\t\x1a\x00\x00\x1e\x00\x00\x00\x01\xdd\xba\x00\x00\x00\x00' in array('B', [68, 9, 26, 0, 0, 30, 0, 0, 0, 1, 221, 186, 0, 0, 0, 0]),<type 'array.array'> (command.py:79)
MainThread 2017-08-23 20:10:42,436 ant.easy.channel DEBUG send burst transfer 0 (channel.py:112)
.....
ant.base 2017-08-23 20:10:45,075 ant.base.ant DEBUG Read data: [a4 09 50 20 44 89 05 00 00 00 00 00 15] (now have [a4 09 50 20 44 89 05 00 00 00 00 00 15] in buffer) (ant.py:230)
ant.base 2017-08-23 20:10:45,075 ant.base.ant DEBUG XXXXGot message, <ant.base.Message 50:[20 44 89 05 00 00 00 00 00] (s:a4, l:9, c:15)> (ant.py:121)
...
MainThread 2017-08-23 20:13:15,432 ant.fs.manager DEBUG Download 26, o7680, c47837 (manager.py:322)
MainThread 2017-08-23 20:13:15,432 ant.fs.command DEBUG packing 'D\t\x1a\x00\x00\x1e\x00\x00\x00\x00\xdd\xba\x00\x00\x00\x00' in array('B', [68, 9, 26, 0, 0, 30, 0, 0, 0, 0, 221, 186, 0, 0, 0, 0]),<type 'array.array'> (command.py:79)
....
ant.base 2017-08-23 20:13:17,955 ant.base.ant DEBUG Read data: [a4 09 50 20 44 89 05 00 00 00 00 00 15] (now have [a4 09 50 20 44 89 05 00 00 00 00 00 15] in buffer) (ant.py:230)
ant.base 2017-08-23 20:13:17,955 ant.base.ant DEBUG XXXXGot message, <ant.base.Message 50:[20 44 89 05 00 00 00 00 00] (s:a4, l:9, c:15)> (ant.py:121)
...
MainThread 2017-08-23 20:16:09,441 ant.fs.manager DEBUG Download 26, o7680, c0 (manager.py:322)
MainThread 2017-08-23 20:16:09,441 ant.fs.command DEBUG packing 'D\t\x1a\x00\x00\x1e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' in array('B', [68, 9, 26, 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]),<type 'array.array'> (command.py:79)
...
ant.base 2017-08-23 20:16:11,999 ant.base.ant DEBUG Read data: [a4 09 50 20 44 89 05 00 00 00 00 00 15] (now have [a4 09 50 20 44 89 05 00 00 00 00 00 15] in buffer) (ant.py:230)
ant.base 2017-08-23 20:16:11,999 ant.base.ant DEBUG XXXXGot message, <ant.base.Message 50:[20 44 89 05 00 00 00 00 00] (s:a4, l:9, c:15)> (ant.py:121)
....
MainThread 2017-08-23 20:20:17,532 ant.fs.manager DEBUG Download 26, o7680, c0 (manager.py:322)
MainThread 2017-08-23 20:20:17,532 ant.fs.command DEBUG packing 'D\t\x1a\x00\x00\x1e\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00' in array('B', [68, 9, 26, 0, 0, 30, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0]),<type 'array.array'> (command.py:79)
....
ant.base 2017-08-23 20:20:20,053 ant.base.ant DEBUG Read data: [a4 09 50 20 44 89 05 00 00 00 00 00 15] (now have [a4 09 50 20 44 89 05 00 00 00 00 00 15] in buffer) (ant.py:230)
ant.base 2017-08-23 20:20:20,053 ant.base.ant DEBUG XXXXGot message, <ant.base.Message 50:[20 44 89 05 00 00 00 00 00] (s:a4, l:9, c:15)> (ant.py:121)
I have not tested if Garmin stacks supports this, but there is at least nothing in the specification that would prohibit this - quite the opposite. You are of course correct in that Garmin could have a stack that does not support this and I should have clarified this in my first reply. I'm sorry about that. I'll try to take a look at this tonight and see if the results are reproducible on my watch as well.
On Thu, Aug 24, 2017 at 10:14 AM, Patrick Remy notifications@github.com wrote:
Have you been able to test whether Garmin's ANT-FS stack supports the download resume feature ?
I've been trying a bit with my 910XT, and I seem to be getting a "CRC incorrect" response whatever "Initial Request/ CRC seed" combination I try in my Download Request command (logs below)
Any idea what I could be doing wrong ?
Patrick
==================== Example:
- the first download stops at offset 7680:
.... MainThread 2017-08-23 20:08:10,571 ant.fs.manager DEBUG Download 26, o7680, c47837 (manager.py:322) MainThread 2017-08-23 20:08:10,571 ant.fs.command DEBUG packing 'D\t\x1a\x00\x00\x1e\x00\x00\x00\x01\xdd\xba\x00\x00\x00\x00' in array('B', [68, 9, 26, 0, 0, 30, 0, 0, 0, 1, 221, 186, 0, 0, 0, 0]),<type 'array.array'> (command.py:79) ..... MainThread 2017-08-23 20:08:25,787 ant.fs.manager DEBUG Download 26 timeout (manager.py:345) MainThread 2017-08-23 20:08:25,798 ant.fs.manager DEBUG Run 5 (manager.py:164)
- I then try to re-initiate a connection and send a DownloadRequest with the same offset, CRC and "Initial Request":
..... MainThread 2017-08-23 20:10:42,436 ant.fs.manager DEBUG Download 26, o7680, c47837 (manager.py:322) MainThread 2017-08-23 20:10:42,436 ant.fs.command DEBUG packing 'D\t\x1a\x00\x00\x1e\x00\x00\x00\x01\xdd\xba\x00\x00\x00\x00' in array('B', [68, 9, 26, 0, 0, 30, 0, 0, 0, 1, 221, 186, 0, 0, 0, 0]),<type 'array.array'> (command.py:79) MainThread 2017-08-23 20:10:42,436 ant.easy.channel DEBUG send burst transfer 0 (channel.py:112) ..... ant.base 2017-08-23 20:10:45,075 ant.base.ant DEBUG Read data: [a4 09 50 20 44 89 05 00 00 00 00 00 15] (now have [a4 09 50 20 44 89 05 00 00 00 00 00 15] in buffer) (ant.py:230) ant.base 2017-08-23 20:10:45,075 ant.base.ant DEBUG XXXXGot message, <ant.base.Message 50:[20 44 89 05 00 00 00 00 00] (s:a4, l:9, c:15)> (ant.py:121)
- same with an IR=0
... MainThread 2017-08-23 20:13:15,432 ant.fs.manager DEBUG Download 26, o7680, c47837 (manager.py:322) MainThread 2017-08-23 20:13:15,432 ant.fs.command DEBUG packing 'D\t\x1a\x00\x00\x1e\x00\x00\x00\x00\xdd\xba\x00\x00\x00\x00' in array('B', [68, 9, 26, 0, 0, 30, 0, 0, 0, 0, 221, 186, 0, 0, 0, 0]),<type 'array.array'> (command.py:79) .... ant.base 2017-08-23 20:13:17,955 ant.base.ant DEBUG Read data: [a4 09 50 20 44 89 05 00 00 00 00 00 15] (now have [a4 09 50 20 44 89 05 00 00 00 00 00 15] in buffer) (ant.py:230) ant.base 2017-08-23 20:13:17,955 ant.base.ant DEBUG XXXXGot message, <ant.base.Message 50:[20 44 89 05 00 00 00 00 00] (s:a4, l:9, c:15)> (ant.py:121)
- same with CRC=0 and IR=1
... MainThread 2017-08-23 20:16:09,441 ant.fs.manager DEBUG Download 26, o7680, c0 (manager.py:322) MainThread 2017-08-23 20:16:09,441 ant.fs.command DEBUG packing 'D\t\x1a\x00\x00\x1e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' in array('B', [68, 9, 26, 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]),<type 'array.array'> (command.py:79) ... ant.base 2017-08-23 20:16:11,999 ant.base.ant DEBUG Read data: [a4 09 50 20 44 89 05 00 00 00 00 00 15] (now have [a4 09 50 20 44 89 05 00 00 00 00 00 15] in buffer) (ant.py:230) ant.base 2017-08-23 20:16:11,999 ant.base.ant DEBUG XXXXGot message, <ant.base.Message 50:[20 44 89 05 00 00 00 00 00] (s:a4, l:9, c:15)> (ant.py:121)
- same with CRC=0 and IR=0
.... MainThread 2017-08-23 20:20:17,532 ant.fs.manager DEBUG Download 26, o7680, c0 (manager.py:322) MainThread 2017-08-23 20:20:17,532 ant.fs.command DEBUG packing 'D\t\x1a\x00\x00\x1e\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00' in array('B', [68, 9, 26, 0, 0, 30, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0]),<type 'array.array'> (command.py:79) .... ant.base 2017-08-23 20:20:20,053 ant.base.ant DEBUG Read data: [a4 09 50 20 44 89 05 00 00 00 00 00 15] (now have [a4 09 50 20 44 89 05 00 00 00 00 00 15] in buffer) (ant.py:230) ant.base 2017-08-23 20:20:20,053 ant.base.ant DEBUG XXXXGot message, <ant.base.Message 50:[20 44 89 05 00 00 00 00 00] (s:a4, l:9, c:15)> (ant.py:121)
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Tigge/antfs-cli/issues/169#issuecomment-324566136, or mute the thread https://github.com/notifications/unsubscribe-auth/AALIdC5WjOVs1IB5MGCtkJ6Bl-GvTfQnks5sbTDzgaJpZM4PAdFL .
Hi,
thanks a lot for this project : it's enabled me to use Windows even less !
I was wondering whether you had looked into adding the ability to resume partially completed transfers. It would be nice to have that to help with the download failures I get on a regular basis. Do you know whether it is supposed to be supported by the Garmin watches ? I'd rather not spend too much time on that if we already know Garmins do not support it.
Thanks