Search This Blog

Tuesday, April 21, 2015

Garmin ANT – using a Raspberry PI to sync Garmin Data from a Forerunnuer 401


I’ve a spare original Raspberry PI that wasn’t doing very much. I’ve also a Garmin GPS watch that can sync data over ANT (wireless) to the likes of Strava. So I set about searching for a way to do this… to find it’s already been done!

Once the PI has Raspbian running you need to follow these instructions. 

(mainly copied from URL above with additional steps added)

> SSH to the PI

sudo apt-get update

sudo apt-get install python-pip

sudo apt-get install python-pip libusb-1.0-0

sudo apt-get install python-lxml

sudo pip install python-ant-downloader
apt-get install python python-lxml python-pkg-resources python-requests python-serial


Make sure you have permission to access the USB device. Add a text file with one of the following to /etc/udev/rules.d/99-garmin.rules.

On Ubuntu 10.04 (or other other older distros):

SUBSYSTEM=="usb", SYSFS{idVendor}=="0fcf", SYSFS{idProduct}=="1008", MODE:="666"

The first time you run the program it will need to pair with your GPS device. Make sure the the GPS unit is awake (press a button), and make sure pairing is enabled. Then just run ant-downloader. When prompted accept the pairing request on your GPS device. Once request is accepted a key is saved and you should not need to pair again.

You may also choose to enable "Force Downloads" on your device. This will cause all old data to be downloaded. WARNING, It will also upload all data to Garmin Connect.


See antd.cfg from configuration options including where files are saved, and Garmin Connect login details. The file will be created in ~/.antd the first time you run the program.   (Note: check root folder after running the data download first time, if not showing using ls then just use vi to edit the file and it’ll load)

Twitter API – Error 401


I have a Raspberry PI2 running a PostgreSQL database (+PostGIS)…. and a python script to grab GeoTweets. It works surprisingly well.

However one thing to consider is that the Pi clock resets to 1970 after power has been disconnected!

If you don’t do this and try to connect to the Twitter API then you get error 401 – unauthorised. Also need to remember to set the clock without adding an hour for BST!!