Garmin forerunner and Ubuntu 14.04

This post is about getting running data off of a Garmin Forerunner 305 and uploaded to the Garmin Connect website. This post follows my previous post on the Garmin forerunner and Ubuntu 12.04. Basically I will repeat these previous instructions, making sure that everything can still be done on Ubuntu 14.04– the good news is that everything works on 14.04, so read on if you are interested.

  • First, we install some dependencies:
$ sudo apt-get install garmin-forerunner-tools libxml2-utils
  • Second, we grab code from a git repository (do this in a directory where you want the code to reside– I’ll do this in ~/gitlocal/):
$ cd ~/gitlocal/
$ git clone git@github.com:cstrelioff/garmin-dev.git

Edit: 2015, Aug 27

The above git clone command uses ssh and will only work if you have a github account setup and have an ssh key on file. If you don’t and would rather not bother setting that up you can

  1. Dowload a zip of the repository from the github page and unzip on your local computer– look for the Download ZIP button on the right side of the page.
  2. Use git with https instead of ssh. This changes the git clone command to
$ git clone https://github.com/cstrelioff/garmin-dev.git

End edit

  • Finally we are ready to get data. I will give one approach – start by making a directory where the data will be saved. For example,
$ mkdir ~/GarminData
$ cd ~/GarminData

Next, we connect the watch to the computer using the usb cable and obtain the data from the watch:

$ garmin_save_runs

Edit: 2016, Mar 28

Above corrected to “garmin_save_runs”, from “garmin-save-runs”, thanks to comment below.

End edit

If there is data on the watch, this command should produce *.gmn files that use the directory structure: Year/Month/*.gmn.

Finally, the *.gmn files need to be converted to *.tcx for upload to Garmin Connect. It is probably good to choose a consistent place to do this. For example, create a directory called tcxfiles:

$ mkdir ~/GarminData/tcxfiles
$ cd ~/GarminData/tcxfiles/

A command to do the conversions has to provide full paths for gmn2tcx and the input *.gmn file. So, try something like this if you’ve used the directory structure discussed above:

$ ~/gitlocal/garmin-dev/gmn2tcx ~/GarminData/DataFromWatch/Year/Month/file.gmn > run-name.tcx

Be sure to change ~/GarminData/DataFromWatch/Year/Month/file.gmn to something that makes sense. If all went well, the file run-name.tcx (change this filename to something sensible as well) will be in your local directory and ready to upload. Of course, in the short run you’ll want to write a script to automate this process and avoid the typing.

Tags

api [1]   arduino [1]   audio [2]   audio features [1]   babel [1]   Bayesian [7]   Beta [1]   blog setup [1]   bootstrap [1]   bottleneck [1]   c++ [1]   caret [1]   cmpy [1]   conditional probability [6]   coursera [1]   coursera intro to data science [3]   css [1]   cython [1]   d3 [2]   decision trees [2]   diy [1]   dropbox [1]   dsp [1]   e1071 [1]   essentia [1]   garmin [1]   geojson [1]   ggplot2 [1]   gis [2]   git [1]   gnuplot [1]   graphs [1]   html5 [1]   igraph [1]   ipython [1]   javascript [7]   joint probability [6]   json [1]   LaTeX [2]   LDA [1]   Lea [2]   machine learning [3]   marginal probability [6]   matplotlib [1]   meteor [2]   mir [1]   MongoDB [3]   music [2]   my python setup [5]   my ubuntu setup [10]   mysql [3]   networks [1]   networkx [1]   nodejs [5]   npm [3]   numexpr [1]   numpy [1]   octave [1]   Open Oakland [2]   openpyxl [1]   pandas [3]   patsy [1]   pip [2]   pweave [1]   pygraphviz [1]   pymc [1]   PySoundFile [2]   python [15]   Python [1]   python 2.7 [5]   python 3.4 [2]   pyyaml [1]   qgis [1]   R [1]   randomForest [1]   restview [1]   resume [1]   rpart [1]   running [1]   scikit-learn [3]   scipy [1]   screen [1]   server setup [1]   shapefile [1]   social networks [1]   Socrata [1]   sound [2]   sphinx [1]   sql [4]   sqlite3 [1]   ssh [1]   ssh keys [1]   statsmodels [1]   supervised learning [2]   sympy [1]   tableau [1]   tinkerer [2]   topic models [1]   tree [1]   ubuntu 14.04 [13]   Ubuntu 14.04 [3]   ubuntu 16.04 [4]   vim [2]   virtualbox [1]   virtualenv [4]   virtualenvwrapper [3]   VPS [1]   vundle [1]   webpack [1]   yaml [1]