Skip to content
This repository has been archived by the owner on Apr 14, 2018. It is now read-only.

USB Timeout (again) #13

Open
TedHerman opened this issue Aug 8, 2011 · 1 comment
Open

USB Timeout (again) #13

TedHerman opened this issue Aug 8, 2011 · 1 comment

Comments

@TedHerman
Copy link

I've encountered a repeatable timeout problem with the most recent libfitbit.

  1. To confirm it's the most recent version, here's what I did:
    herman@touring:~/fitbit/libfitbit$ git log | head -n 5
    commit ee607b24c57b19872959c4ab8edf4dbeed5404d3
    Author: qdot 
    Date:   Sun Aug 7 22:21:36 2011 -0700
    
    Made libusb base core reset on open, making communication much more reliable
    
  2. Unplug, then replug fitbit. Now, log of running the test:
    Script started on Mon 08 Aug 2011 05:24:47 PM CDT
    herman@touring:~/fitbit/libfitbit/python$ su
    root@touring:/home/herman/fitbit/libfitbit/python# 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/herman/fitbit/libfitbit/python/antprotocol/bases.py", line 24, in open
        if not super(FitBitANT, self).open(vid, pid):
      File "/home/herman/fitbit/libfitbit/python/antprotocol/libusb.py", line 78, in open
        self._check_reset_response(0x80)
      File "/home/herman/fitbit/libfitbit/python/antprotocol/protocol.py", line 127, in _check_re
    set_response
        data = self._receive()
      File "/home/herman/fitbit/libfitbit/python/antprotocol/libusb.py", line 91, in _receive
        r = self._connection.read(self.ep['in'], size, 0, self.timeout)
      File "/usr/lib/python2.6/site-packages/usb/core.py", line 637, in read
        self.__get_timeout(timeout)
      File "/usr/lib/python2.6/site-packages/usb/_debug.py", line 52, in do_trace
        return f(*args, **named_args)
      File "/usr/lib/python2.6/site-packages/usb/backend/libusb10.py", line 493, in bulk_read
        timeout)
      File "/usr/lib/python2.6/site-packages/usb/backend/libusb10.py", line 593, in __read
        timeout))
      File "/usr/lib/python2.6/site-packages/usb/backend/libusb10.py", line 357, in _check
        raise USBError(_str_error[retval.value])
    usb.core.USBError: Operation timed out
    
  3. Background info.
    Linux kernel:  Linux version 2.6.37.6-smp (root@midas) (gcc version 4.5.2 (GCC) ) #2 SMP Sat Ap
    r 9 23:39:07 CDT 2011
    

    Distro: Slackware 13.37.0

    Vmlinuz config: config-huge-smp-2.6.37.6-smp:

    CONFIG_USB_EHCI_HCD=y
    CONFIG_USB_EHCI_ROOT_HUB_TT=y
    CONFIG_USB_EHCI_TT_NEWSCHED=y
    CONFIG_USB_OXU210HP_HCD=y
    CONFIG_USB_ISP116X_HCD=y
    CONFIG_USB_ISP1760_HCD=y
    CONFIG_USB_ISP1362_HCD=y
    CONFIG_USB_OHCI_HCD=y

    CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set

    CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set

    CONFIG_USB_OHCI_LITTLE_ENDIAN=y
    CONFIG_USB_UHCI_HCD=y
    CONFIG_USB_U132_HCD=m
    CONFIG_USB_SL811_HCD=y
    CONFIG_USB_SL811_CS=m
    CONFIG_USB_R8A66597_HCD=y
    CONFIG_USB_WHCI_HCD=m
    CONFIG_USB_HWA_HCD=m

  4. Tail of /var/log/messages showing device unplug/replug:
    Aug  8 17:19:57 touring kernel: [27583.000141] usb 4-1: USB disconnect, address 12
    Aug  8 17:20:01 touring kernel: [27586.665026] usb 4-1: new full speed USB device using uhci_hcd and address 13
    Aug  8 17:20:01 touring kernel: [27586.819034] usb 4-1: New USB device found, idVendor=10c4, idProduct=84c4
    Aug  8 17:20:01 touring kernel: [27586.819043] usb 4-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    Aug  8 17:20:01 touring kernel: [27586.819049] usb 4-1: Product: Fitbit Base Station
    Aug  8 17:20:01 touring kernel: [27586.819054] usb 4-1: Manufacturer: Silicon Labs
    Aug  8 17:20:01 touring kernel: [27586.819058] usb 4-1: SerialNumber: 01014A9BF5F4E37402014A9BF5F4
    
@reedwade
Copy link
Contributor

I'm running into this same problem also.

But not so much now. I had been reliably failing with usb.core.USBError: Operation timed out exception as above but..

I commented out
self._check_reset_response(0x80)
at line 78 of libusb.py

I reran and got different errors. So I put that back.

I then reran and got a successful sync (!)

So, I ran it again and got this--

Traceback (most recent call last):
  File "fitbit_client.py", line 137, in <module>
    sys.exit(main())
  File "fitbit_client.py", line 132, in main
    f = FitBitClient()
  File "fitbit_client.py", line 86, in __init__
    if not base.open():
  File "/home/reed/fitbit/libfitbit/python/antprotocol/bases.py", line 24, in open
    if not super(FitBitANT, self).open(vid, pid):
  File "/home/reed/fitbit/libfitbit/python/antprotocol/libusb.py", line 78, in open
    self._check_reset_response(0x80)
  File "/home/reed/fitbit/libfitbit/python/antprotocol/protocol.py", line 127, in _check_reset_response
    data = self._receive()
  File "/home/reed/fitbit/libfitbit/python/antprotocol/libusb.py", line 96, in _receive
    raise ANTReceiveException("Checksums for packet do not match received values!")
antprotocol.protocol.ANTReceiveException: Checksums for packet do not match received values!

I run it again and get successful sync.

Then run it again and get the checksum error.

then, success, alternating back and forth -- I can sync but I need to run and fail first.

One more piece of info, this is with a fitbit ultra.

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

No branches or pull requests

2 participants