GPS for Linux

Sharing my Linux GPS/HRM tracking setup, as it took a bit of effort - as all things do on Linux.
Posted: Wed 06 Jul, 2016, 17:32

After a typically long period of deliberation, I finally decided to buy myself a
proper GPS tracker for recording my MTB rides. I have had a GPS tracker/mapper
on my phone for some time now, but with the possibility for ranging further a
field on a potential bike-packing trip in future, I did not want to rely on my
mobile phone. I also wanted to get a wireless HRM that would work with the GPS
tracker so that I could understand how hard I was working on my various routes.

TRYWIN D2 - very good (except for me..)

First of all, I bought a TRYWIN
D2
from Amazon as it had all the features I
needed. GPS, speed, altitude and ANT+ support to connect to a remote HRM
monitor. At the price of ?30 it was extremely well priced. I have to
confess it worked perfectly and it was with great reluctance that I decided to
send it back as there was no support for the file formats produced. The files
produced were binary and had the suffix .cpw, for which I could find no
documentation. There was a Windows CD provided, but I do not run a Windows
machine.

Garmin and Mio HRM

So I bought a Garmin Edge
25
along with a Mio Link HRM. So
far, I have been very impressed with both devices. I went out on my MTB this
morning and tracked the route on the Garmin. When I got back to my computer I
attached the Garmin using the USB and was able to browse about the directories -
no problems there. The Garmin produces
.FIT files that are binary files held
within an ACTIVITIES directory.

The ANT+ feature works perfectly and allows the Garmin to capture and display
your HR, which is then stored along with your other data.

FIT to gpx with gpsbabel

So, in order to use GPX viewer of choice, I wanted to convert the FIT file to
gpx so gpsbabel seemed like the obvious choice on Linux. It was with a fair
degree of disappointment that I discovered this was not going to be possible. I
even wrote a script to take care of it:

    #!/bin/bash

    gpxdir=${HOME}/git/dmcContent/gpx
    fitfile=$1
    gpxfile=`echo $fitfile | sed "s/FIT/gpx/"`

    if [[ $fitfile == "" ]]; then
      echo "Must provide a fit file"
      exit -1
    fi

    gpsbabel -t -i garmin_fit -f ${fitfile} -o gpx 
    

But alas gpsbabel returned the following error:

    Definition message reserved bits not zero 
    

After searching on the internet, there did not appear to be an easy fix for me.
Also, for a tool that pitches itself as the primary tool this job, I was just
surprised that it does not work for Garmin files - it is a very popular GPS
format. Also, when I looked at compiling the latest I discovered they require a
newer from of QT library that I had, which also concerned me, because as a
command line tool, QT should be unnecessary.

Enter TurtleSport

So after a bit more searching, I found
TurtleSport which is a Linux
friendly application for allowing you to view your GPS/Fitness data. I am
pleased to say it is excellent and as it is written in Java, it works without
any issues (i.e. no complex library dependencies). It is able to read the
native .FIT file format and then will save it out as .GPX without any problems.

Here is a screenshot of the report for my MTB route today.

TurtleSport

So I can now record my MTB rides, with HRM data and save them to GPX, all on
Linux. This means I can actually keep a track on my exercise hopefully get
myself fit enough to the my planned bikepacking trip. Awesome, and all thanks
to TurtleSport.