Friday, November 2, 2012

Fitbit and Linux

I have had a FitBit Ultra for a couple of months.  It is rather addictive to watch the number of steps taken and floors climbed.  It is also compelling to get in just one more floor and the next floor badge for the day.  There are a few technology challenges for me though...

*It requires Windows or OSX to setup the device and to sync the device.  Neither of these generally reside in my house and they definitively do not travel with me.
*The ultra syncs wirelessly to the usb base attached to a machine running the fitbit software - again Windows or OSX - which uploads the data to the server.
*The information can be viewed from any web browser and also from the IOS and Android apps. 

The newest FitBit products include bluetooth 4.0 direct syncing support and I cannot wait for mine!  But meanwhile...

I want to sync through my Linux box.  After some investigation I found a couple of projects to support this.  The software cannot yet setup a device but it can sync the data. I have been following the discussion and comments at

Here are the steps from my adventures with syncing my fitbit using my Fedora 17 system...

1. get the source code

2. try compiling... discover a number of -devel packages that I needed to install

3. hit the wall mentioned in other comments... the need to update mxml to 2.7 when the package is not built for Fedora 17

4. grab the mxml-2.5 SRPM from fedora and the mxml 2.7 source tarball from:

5. review the fedora patches to 2.5... concur with other comments that patch1 is already implemented upstream and can be removed from the SPEC file. Recreated the patch0 for no-rpath - trusting there is a reason for this...  And, finally, updated the SPEC file (version, release, changelog), build the packages, and install.  Easy.

6. Once I had all the -devel packages I needed installed and the mxml updated, the fitbit source compiled and installed easily.

There is a reporting issue though - the basic steps, floors, etc get reported but they are missing timestamps so the graphs no longer work and you cannot record activities including sleep.  Apparently it used to work and now it doesn't.  There were changes on the FitBit end around the end of August. I was hoping the data would resync the past 7 days when I got home and put the base back on the windows box but no luck.

I have wanted for some time to learn more about Fedora Packaging and this could be a package set I am willing to maintain...  if the timestamp issue gets resolved.  It is not worth it without that fix.  There are several components to the source that I expect to have to split to multiple packages to meet the Fedora guidelines but the only licensing info I see is a GPL3 so that looks good.

The other potential "project" is to use this device as an example in security training. The device needs a udev rule for dbus communication and the sample is very wide open. I have not scanned yet, but among my research for a linux client, i learned the itt apparently sends much data plain text. And what about containing the daemon in its own SELinux context?  That would be fun too.

I am looking forward to the "coming soon" android app to go with my "shipping late Oct" FitBit One as a replacement.  The only bluetooth 4.0 device I have is an android so I have to wait on that software but then I will finally be able to turn that win box back off.  I use the win box only for syncing the fitbit and backing up the ipad.