openyou / libfitbit

Library for accessing and transfering data from the Fitbit health device
http://www.openyou.org
BSD 3-Clause "New" or "Revised" License
422 stars 66 forks source link

Difficulty getting this running on Ubuntu 11.10 #14

Open mooredan opened 12 years ago

mooredan commented 12 years ago

Maybe I just missing something basic, but any help would be appreciated.

The base is definitely seen by the system:

lsusb | grep Cyg

Bus 002 Device 006: ID 10c4:84c4 Cygnal Integrated Products, Inc.

ll /dev/fit

lrwxrwxrwx 1 root root 15 2011-10-28 17:44 /dev/fitbit-ant_2-1.5 -> bus/usb/002/006

...but I get an AttributeError when starting it:

python fitbit.py

Traceback (most recent call last): File "fitbit.py", line 351, in sys.exit(main()) File "fitbit.py", line 317, in main if not base.open(): File "/home/mooredan/src/libfitbit/python/antprotocol/bases.py", line 24, in open if not super(FitBitANT, self).open(vid, pid): File "/home/mooredan/src/libfitbit/python/antprotocol/libusb.py", line 63, in open self._connection = usb.core.find(idVendor = vid, AttributeError: 'module' object has no attribute 'core'

dpkg --get-selections | grep usb | grep py

python-usb install

uname -a

Linux horsetooth 3.0.0-12-server #20-Ubuntu SMP Fri Oct 7 16:36:30 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux

cat /etc/issue

Ubuntu 11.10 \n \l

Please let me know if you need more info, thanks.

Dan

qdot commented 12 years ago

You'll need to install the libusb-1.0_0-dev package ( I may have the dashes and underscores out of order there, check apt-cache).

On Sat, Oct 29, 2011 at 10:25 AM, mooredan < reply@reply.github.com>wrote:

Maybe I just missing something basic, but any help would be appreciated.

The base is definitely seen by the system:

lsusb | grep Cyg

Bus 002 Device 006: ID 10c4:84c4 Cygnal Integrated Products, Inc.

ll /dev/fit

lrwxrwxrwx 1 root root 15 2011-10-28 17:44 /dev/fitbit-ant_2-1.5 -> bus/usb/002/006

...but I get an AttributeError when starting it:

python fitbit.py

Traceback (most recent call last): File "fitbit.py", line 351, in sys.exit(main()) File "fitbit.py", line 317, in main if not base.open(): File "/home/mooredan/src/libfitbit/python/antprotocol/bases.py", line 24, in open if not super(FitBitANT, self).open(vid, pid): File "/home/mooredan/src/libfitbit/python/antprotocol/libusb.py", line 63, in open self._connection = usb.core.find(idVendor = vid, AttributeError: 'module' object has no attribute 'core'

dpkg --get-selections | grep usb | grep py

python-usb install

uname -a

Linux horsetooth 3.0.0-12-server #20-Ubuntu SMP Fri Oct 7 16:36:30 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux

cat /etc/issue

Ubuntu 11.10 \n \l

Please let me know if you need more info, thanks.

Dan

Reply to this email directly or view it on GitHub: https://github.com/qdot/libfitbit/issues/14

mooredan commented 12 years ago

sudo apt-get install libusb-1.0-0-dev

That alone didn't do it, I had to install pyusb-1.0.0-a1from http://sourceforge.net/projects/pyusb/files/

...after unzipping: sudo python setup.py install

...but that just got me past the original issue, now there is a USB time out error:

Traceback (most recent call last): File "fitbit.py", line 351, in sys.exit(main()) File "fitbit.py", line 317, in main if not base.open(): File "/home/mooredan/src/libfitbit/python/antprotocol/bases.py", line 24, in open if not super(FitBitANT, self).open(vid, pid): File "/home/mooredan/src/libfitbit/python/antprotocol/libusb.py", line 78, in open self._check_reset_response(0x80) File "/home/mooredan/src/libfitbit/python/antprotocol/protocol.py", line 127, in _check_reset_response data = self._receive() File "/home/mooredan/src/libfitbit/python/antprotocol/libusb.py", line 91, in _receive r = self._connection.read(self.ep['in'], size, 0, self.timeout) File "/usr/local/lib/python2.7/dist-packages/usb/core.py", line 637, in read self.__get_timeout(timeout) File "/usr/local/lib/python2.7/dist-packages/usb/_debug.py", line 52, in do_trace return f(_args, *_named_args) File "/usr/local/lib/python2.7/dist-packages/usb/backend/libusb10.py", line 493, in bulk_read timeout) File "/usr/local/lib/python2.7/dist-packages/usb/backend/libusb10.py", line 593, in __read timeout)) File "/usr/local/lib/python2.7/dist-packages/usb/backend/libusb10.py", line 357, in _check raise USBError(_str_error[retval.value]) usb.core.USBError: Operation timed out

I tried several debugging steps:

This appears similar to a more recently reported timeout error (the issue list and/or docs show another one resolved).

Can you suggest any further troubleshooting steps?

Dan

..but now, there's a USB timeout error

qdot commented 12 years ago

Oh, sorry, I thought you'd already installed pyusb-1 since it found the usb module.

Yeah, now you're to the same point pretty much everyone else is. These timeout errors have been rampant in libfitbit since I started, and I just haven't had time to fix them. Not sure what the issue is yet.

On Sat, Oct 29, 2011 at 2:54 PM, mooredan < reply@reply.github.com>wrote:

sudo apt-get install libusb-1.0-0-dev

That alone didn't do it, I had to install pyusb-1.0.0-a1from http://sourceforge.net/projects/pyusb/files/

...after unzipping: sudo python setup.py install

...but that just got me past the original issue, now there is a USB time out error:

Traceback (most recent call last): File "fitbit.py", line 351, in sys.exit(main()) File "fitbit.py", line 317, in main if not base.open(): File "/home/mooredan/src/libfitbit/python/antprotocol/bases.py", line 24, in open if not super(FitBitANT, self).open(vid, pid): File "/home/mooredan/src/libfitbit/python/antprotocol/libusb.py", line 78, in open self._check_reset_response(0x80) File "/home/mooredan/src/libfitbit/python/antprotocol/protocol.py", line 127, in _check_reset_response data = self._receive() File "/home/mooredan/src/libfitbit/python/antprotocol/libusb.py", line 91, in _receive r = self._connection.read(self.ep['in'], size, 0, self.timeout) File "/usr/local/lib/python2.7/dist-packages/usb/core.py", line 637, in read self.__get_timeout(timeout) File "/usr/local/lib/python2.7/dist-packages/usb/_debug.py", line 52, in do_trace return f(_args, *_named_args) File "/usr/local/lib/python2.7/dist-packages/usb/backend/libusb10.py", line 493, in bulk_read timeout) File "/usr/local/lib/python2.7/dist-packages/usb/backend/libusb10.py", line 593, in __read timeout)) File "/usr/local/lib/python2.7/dist-packages/usb/backend/libusb10.py", line 357, in _check raise USBError(_str_error[retval.value]) usb.core.USBError: Operation timed out

I tried several debugging steps:

  • unplugging and re-plugging the base from/to the USB port
  • with the fitbit tracker installed
  • with the fitbit tracker not installed
  • run as root/not as root

This appears similar to a more recently reported timeout error (the issue list and/or docs show another one resolved).

Can you suggest any further troubleshooting steps?

Dan

..but now, there's a USB timeout error

Reply to this email directly or view it on GitHub: https://github.com/qdot/libfitbit/issues/14#issuecomment-2567159