Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for garmin vivofit #58

Open
psukys opened this issue Jun 19, 2014 · 1 comment
Open

Support for garmin vivofit #58

psukys opened this issue Jun 19, 2014 · 1 comment

Comments

@psukys
Copy link

psukys commented Jun 19, 2014

Hello,
I'm really happy finding this repository, although I'm strugling to run it with garmin vivofit. I've been coding for a while and could contribute with a little show-around this codebase.
I'm also adding a log of a simple run and a try to sync.

$ sudo python ant-downloader.py 
[sudo] password for shookees: 
[MainThread]    2014-06-19 21:01:58,495 WARNING Failed to find Garmin nRF24AP2 (newer) USB Stick.
Traceback (most recent call last):
  File "/home/shookees/Documents/src/python-ant-downloader/antd/cfg.py", line 92, in create_hardware
    return hw.UsbHardware(id_vendor, id_product, bulk_endpoint)
  File "/home/shookees/Documents/src/python-ant-downloader/antd/hw.py", line 61, in __init__
    raise NoUsbHardwareFound(errno.ENOENT, "No available device matching vid(0x%04x) pid(0x%04x)." % (id_vendor, id_product))
NoUsbHardwareFound: [Errno 2] No available device matching vid(0x0fcf) pid(0x1008).
[MainThread]    2014-06-19 21:01:58,495 WARNING Looking for nRF24AP1 (older) Serial USB Stick.
[MainThread]    2014-06-19 21:01:59,502 INFO    Searching for ANT devices.
[MainThread]    2014-06-19 21:02:04,236 DEBUG   Got ANT-FS Beacon. device_number=0xd8a6 Beacon{'auth_type': 0, 'pairing_enabled': 0, 'data_available': 32, 'device_state': 0, 'period': 3, 'descriptor': 67373, 'upload_enabled': 16, 'data_page_id': 67, 'data': '', 'status_2': 0, 'status_1': 51}
[MainThread]    2014-06-19 21:02:04,236 INFO    Device has data. Linking.
[MainThread]    2014-06-19 21:02:04,237 DEBUG   Setting period to match device, hz=4
[MainThread]    2014-06-19 21:02:04,503 DEBUG   Linking with device. freq=2420mhz
[MainThread]    2014-06-19 21:02:05,770 WARNING Retryable error. 9 try(s) remaining. Send message was not acknowledged by peer. CHANNEL_EVENT(channel_number=0, msg_id=1, msg_code=6)
[MainThread]    2014-06-19 21:02:06,255 INFO    Pairing with device.
[MainThread]    2014-06-19 21:02:06,534 DEBUG   Got client auth string. Auth{'auth_string': 'v\xc3\xadvofit\x00\x00\x00\x00\x00\x00\x00\x00', 'beacon': <antd.antfs.Beacon object at 0x7f3f3e9579d0>, 'op_id': None, 'response_type': 0, 'client_id': 3883194534, 'host_id': 9168, 'data_page_id': 68, 'command_id': 132}
[MainThread]    2014-06-19 21:02:06,534 DEBUG   Device secret known.
[MainThread]    2014-06-19 21:02:06,762 DEBUG   Device accepted key.
[MainThread]    2014-06-19 21:02:06,877 INFO    Saving raw data to /home/shookees/.antd/0xe774d8a6/raw/20140619-210206.raw.
[MainThread]    2014-06-19 21:02:06,878 DEBUG   A000: executing product request
[Thread-1]  2014-06-19 21:02:08,604 WARNING Failed to receive RF beacon at expected period. channel_number=0
[Thread-1]  2014-06-19 21:02:11,479 WARNING Failed to receive RF beacon at expected period. channel_number=0
[Thread-1]  2014-06-19 21:02:11,979 WARNING Failed to receive RF beacon at expected period. channel_number=0
[MainThread]    2014-06-19 21:02:12,388 WARNING Caught error while communicating with device, will retry.
Traceback (most recent call last):
  File "/home/shookees/Documents/src/python-ant-downloader/antd/main.py", line 98, in downloader
    dev = antd.Device(host)
  File "/home/shookees/Documents/src/python-ant-downloader/antd/garmin.py", line 312, in __init__
    self.init_device_api()
  File "/home/shookees/Documents/src/python-ant-downloader/antd/garmin.py", line 343, in init_device_api
    product_data = self.get_product_data()
  File "/home/shookees/Documents/src/python-ant-downloader/antd/garmin.py", line 318, in get_product_data
    return self.execute(A000())[0]
  File "/home/shookees/Documents/src/python-ant-downloader/antd/garmin.py", line 415, in execute
    pkt = self.stream.read()
  File "/home/shookees/Documents/src/python-ant-downloader/antd/antfs.py", line 409, in read
    direct_reply = GarminSendDirect.unpack(self.channel.read())
  File "/home/shookees/Documents/src/python-ant-downloader/antd/ant.py", line 918, in read
    return self._session._send(ReadData(self.channel_number, ReadData), timeout=timeout).data
  File "/home/shookees/Documents/src/python-ant-downloader/antd/ant.py", line 680, in _send
    raise cmd.error
AntTimeoutError: No reply to command. ReadData(channel_number=0)
@braiden
Copy link
Owner

braiden commented Jul 5, 2014

I'm not really familiar with this device. But since its a newer device, you may have more success with https://github.com/Tigge/Garmin-Forerunner-610-Extractor

This is assuming that the vivofit uses the same communication protocol as newer devices.

Even if that software does work, more work is likely required, decyphering the .fit file to something your client software will support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants