July 13, 2023

Garmin 66i, USB, and Linux - dealing with FIT files

I just finished going through the ordeal of copying the track from a recent hike onto my linux desktop. When I did the copy, I renamed it to "carrie.fit". The name "carrie" relates to place we hiked to.

So what the heck is a "fit" file?

file carrie.fit
carrie.fit: FIT Map data, unit id 84050944, serial 1409286145, Fri Dec 20 09:32:38 2024, manufacturer 4741, product -193, type -1
Trying to look at it with an editor is useless, it is some binary format.

Converting it using gpsbabel

There is no man page for gpsbabel, but it is installed on my Fedora system. Just typing "gpsbabel" yields the following:
GPSBabel Version 1.8.0.  https://www.gpsbabel.org

Usage:
    gpsbabel [options] -i INTYPE -f INFILE [filter] -o OUTTYPE -F OUTFILE
    gpsbabel [options] -i INTYPE -o OUTTYPE INFILE [filter] OUTFILE

    Converts GPS route and waypoint data from one format type to another.
    The input type and filename are specified with the -i INTYPE
    and -f INFILE options. The output type and filename are specified
    with the -o OUTTYPE and -F OUTFILE options.
    If '-' is used for INFILE or OUTFILE, stdin or stdout will be used.

    In the second form of the command, INFILE and OUTFILE are the
    first and second positional (non-option) arguments.

    INTYPE and OUTTYPE must be one of the supported file types and
    may include options valid for that file type.  For example:
      'gpx', 'gpx,snlen=10' and 'ozi,snlen=10,snwhite=1'
    (without the quotes) are all valid file type specifications.
Typing "gpsbabel --help" yields a huge amount of information.
I do this:
gpsbabel -i garmin_fit -f carrie.fit -o csv -F carrie.csv
gpsbabel -i garmin_fit -f carrie.fit -o gpx -F carrie.gpx
These commands run in well under a second, giving me:
ls -l carrie.*
-rw-r--r-- 1 tom tom  27025 Jul 13 12:12 carrie.csv
-rw-r--r-- 1 tom tom  48980 Jul 13 11:55 carrie.fit
-rw-r--r-- 1 tom tom 201168 Jul 13 12:12 carrie.gpx
wc carrie.csv
 1175  2350 27025 carrie.csv
wc carrie.gpx
  5884   8245 201168 carrie.gpx
The CSV file is a long list of lat/long values. Simple, but less data.
The GPX file is a long list of "trkpt" elements, wrapped in a trk and trkseg element, like so: We get extra information in the GPX file -- time, elevation, and speed. The elevations look to be in meters. The sample times are erratic, but I see 22 seconds commonly. No telling what units speed is in.
Have any comments? Questions? Drop me a line!

Tom's backpacking pages / tom@mmto.org