The Linux Rain Linux General/Gaming News, Reviews and Tutorials

Sync your Fitbit on Linux with Galileo

By Andrew Powell, published 12/11/2016 in Tutorials


If you have a Fitbit fitness device and wish to sync your device using the wireless dongle on your Linux machine, the good news is it is possible with the Bluetooth-based Fitbit devices, thanks to a small Python utility called Galileo. Note: you will need a bit of terminal-foo, but to be honest, I found the little program just as reliable if not more reliable and hassle-free than the official Fitbit apps on Android and Windows! In this short article we'll look at how to get it.

Galileo is a neat little Python utility written and maintained by Benoît Allard. As mentioned, it supports all Bluetooth-based Fitbit trackers, such as:

  • Fitbit One
  • Fitbit Zip
  • Fitbit Flex
  • Fitbit Force
  • Fitbit Charge
  • Fitbit Charge HR

Newer tracker devices such as the Alta, Surge, Blaze and the Fitbit Ultra are not supported as they use different network protocols, although the Fitbit Ultra apparently can be synchronised using another Python utility/library called libfitbit. I haven't had experience with it myself, not owning a Fitbit Ultra (I own the Fitbit Charge HR), and your mileage may vary but at least the option is there.

Either way, there is one caveat to be aware of: your Fitbit must be currently paired to your Fitbit account for a sync utility like Galileo to work. This means you must at least do the initial Fitbit setup routine on a Fitbit supported device and app, such as on an Android smartphone or using the official Fitbit Connect utility on Microsoft Windows. You should only have to do this once, however, and most of you reading this article probably already have.

Installing and running Galileo

The installation section of the Galileo site gives you the choice of either installing the utility through pip (the Python package manager) or from the usual common list of Linux distributions.

I'm on Ubuntu 16.04 and tried using the listed PPA, but it didn't seem to exist for my version of Ubuntu, so I went back and installed using pip, which seems the quick and easy way anyway.

sudo pip install galileo

WARNING: After this point, you'll be able to simply run the Galileo program, but ONLY as root user (or using sudo)! This is never ideal and you do so at your own risk. There is instructions on how to get Galileo to run as a regular user on the Galileo website and I recommend reading them, but it is a bit outside the scope of this article. Always be sure what you are running when executing programs/scripts as a super user.

Bearing in the mind the above warning/caveat, and making sure your Fitbit wireless dongle (also known as a Fitbit Base Station) is plugged into a USB port, running a synchronisation with Galileo is as simple as:

sudo galileo

Or just simply galileo if you have it set up for regular user privileges. You may also run Galileo with the -v flag, which makes it run with more verbosity. The result will be something like the image below.

Occasionally it may complain that the tracker couldn't be reached, but you'll likely find if you simply run the program again it will succeed on the next try. To be honest, I've found this to happen even with the official Fitbit apps on the other platforms, so it's probably really just the Fitbit hardware being finicky.

That's all there is to it! If you log in to the Fitbit website dashboard, you should see your recently synchronised stats. Plus any changes you make for your Fitbit device on the web dashboard will be applied whenever you run the sync through Galileo too, just as you would expect to happen when using the official Fitbit apps.



About the author

Andrew Powell is the editor and owner of The Linux Rain who loves all things Linux, gaming and everything in between.

Tags: fitbit sync tutorials shell python fitness
blog comments powered by Disqus