Permalink
Commits on Feb 13, 2012
  1. Wait for ~5 minutes for a beacon (each _receive_message call takes ~4…

    … seconds
    
    to timeout, *75 = 300 seconds == 5 minutes).  This mimics the fitbit behavior
    and hopefully is more successful at catching a tracker.  Not sure if it
    really makes much difference, since we will re-try again right away if we
    don't see the tracker.
    committed Feb 13, 2012
  2. When a sync fails, re-try immediately. Only sleep 15 minutes after a

    successful sync.  This mimic's fitbit's software behavior.
    committed Feb 13, 2012
  3. For opcodes with 0x42 return value, where we retrieve data_bank infor…

    …mation,
    
    the first message should have a 0x70 "command", while subsequent messages
    should have "0x60" for the command.  This seems to be related to getting
    more detailed informaiton from the tracker.  I noticed this through careful
    reading of the fitbit software logs, and it appears to be getting the full
    info now.
    
    Also, after sending a payload, or after returning 0x41, pass the received
    response back as the result instead of synthesizing a dummy response.  I
    don't know if this really makes any difference, but it seems more "honest"
    with the fitbit website.
    committed Feb 13, 2012
  4. Loop limit for receiving bursts was too low. Allow for at least ~500 …

    …bytes,
    
    which works out to 62 messages.  Double that to be safe (this is a sanity check
    after all), and make it a nice round 128 messages.
    committed Feb 13, 2012
Commits on Feb 4, 2012
  1. Add debug output to mark what is going on in the protocol. Also, allo…

    …w retries
    
    of run_opcode.
    committed Feb 4, 2012
Commits on Jan 19, 2012
  1. Limit all loops to a maximum number of retries.

    Ensure that all of the loops eventually terminate.  This guarantees that the
    program will not get stuck looping for some condition that will never happen.
    committed Jan 19, 2012
  2. Limit all loops to a maximun number of retries.

    Ensure that all of the loops eventually terminate.  This guarantees that the
    program will not get stuck looping for some condition that will never happen.
    committed Jan 19, 2012
Commits on Jan 15, 2012
  1. Close the fitbit channel if an exception occurs so we can re-open it …

    …later
    
    In run_upload_request(), if an exception occurs, we catch it, close the
    fitbit channel, and re-raise the exception.  This makes sure that
    run_upload_request() always closes the device.  Since main() now waits
    15 minutes and re-tries, this ensures that the re-try will be able to open
    the device.
    Marcus Hall committed Jan 15, 2012
Commits on Jan 14, 2012
  1. Add framing to protocol layer, remove protocol info from libusb.py

    Add a _recieve_message() method to protocol.py (and an internal _find_sync()
    method).  The _receive_message() method is a match for _send_message().  It
    pulls in packets using libusb's _reeive() method, then locates the SYNC
    char to establish framing, breaks input into packets and verifies the checksum,
    manages timeouts, and performs logging.
    
    Removed the data_received method, since it was slightly weird call to an
    upper layer from libusb (and only called if debug was enabled, despite the
    fact that it performed some checksum and packet verification).
    
    libusb interfaces using a byte array (based on the underlying usb core),
    but the protocol layer now consistently uses int lists to interface (so
    now hexList takes an int list instead of a char array.)
    
    Finally, changed most calls to _receive() into calls to _receive_message(),
    except for _check_burst_response (which I need to study more) and
    FitBitANT.init() which is derived from libusb, not protocol.
    Marcus Hall committed Jan 14, 2012
  2. Reorg FitBitResponse.__init__

    Move member initialization before loop to try opening device.  If device
    does not exist, exit() instead of returning (which would subsequently
    try to use the conneciton and reach an ugly death.)
    Marcus Hall committed Jan 14, 2012
Commits on Jan 12, 2012
  1. Merge pull request #17 from Br3nda/master

    fixed url in header of python file.
    qdot committed Jan 12, 2012
Commits on Jan 11, 2012
  1. corrected url to git repo

    Br3nda committed Jan 11, 2012
Commits on Dec 31, 2011
  1. commented out 0x80 reset check

    reedwade committed Dec 31, 2011
  2. retry cleanups

    reedwade committed Dec 31, 2011
Commits on Dec 10, 2011
  1. set https upload url

    reedwade committed Dec 10, 2011
  2. added .gitignore for pycs

    reedwade committed Dec 10, 2011
Commits on Aug 8, 2011
  1. Made libusb base core reset on open, making communication much more r…

    …eliable
    
    Fixes #8
    qdot committed Aug 8, 2011
Commits on Aug 7, 2011
  1. Fixed close class for fitbit base in client

    qdot committed Aug 7, 2011
  2. Made fitbit_client deal with new bases classes correctly

    Fixed bug with _chan being references in tracker instead of base
    fixes #10
    qdot committed Aug 7, 2011
Commits on Jun 6, 2011
Commits on Jun 5, 2011
  1. Fixed issue with setting default VID/PID in bases

    Renamed garmin to dynastream, since it matches the suunto vid/pid
    qdot committed Jun 5, 2011
Commits on May 26, 2011
  1. Removed tracker class

    Moved fitbit specific ant functions into Fitbit class with tracker functions
    Made base a member of fitbit, which currently needs to be passed in to Fitbit class
    Kyle Machulis committed May 26, 2011
  2. Divided out bases and actual ANT calls into different classes, so we …

    …can easily support more than just the fitbit base
    Kyle Machulis committed May 26, 2011
  3. Added ridiculously permissive udev rules for linux

    Kyle Machulis committed May 26, 2011
  4. Finished burst sends, so took that out of plans

    Kyle Machulis committed May 26, 2011
Commits on May 21, 2011
  1. More code cleanup

    Fixed active score calculation
    Started work on next databank
    qdot committed May 21, 2011
  2. Found per minute bank

    Isolated per minute step count and active point count
    qdot committed May 21, 2011
Commits on May 20, 2011
  1. Started working on data format reversal

    Kyle Machulis committed May 20, 2011
Commits on May 19, 2011
  1. Full web services workflow now works! Yay!

    Added sleep between burst sends so we don't trigger prebuffering
    Added checksum calculation for burst payloads so fitbit specific bursts don't fail
    Removed payload kludge from client, now actually sends payload to device
    Kyle Machulis committed May 19, 2011
Commits on Mar 13, 2011
  1. Added extra receive to fix reset response stability

    Made error of zero length status more noticable
    qdot committed Mar 13, 2011