woensdag 5 mei 2010

Uploading GPS files to Garmin eTrex with GpsBabel

This will be just a small post. Spring is here (not this Spring...), the real spring! And it's time to start cycling for some of use. This is the small script I use to upload gpx files to my good old Garmin eTrex. (Python this time, but it's all about GpsBabel).



#!/usr/bin/python

import sys
import os

if __name__ == "__main__":
    file = sys.argv[1]
    print "Uploading file %s...." % file
    cmd = "gpsbabel -t -i gpx -f %s -x simplify,count=500 -x track,title='Active Log' -o garmin -F /dev/ttyUSB0" % file
    print cmd + "\n"
    os.system(cmd)
    print "Done!\n"



Just download a gpx file from from the internet, run the script, and you're of to go.

ben@pc:~/gpsfiles$ ~/bin/gpsupload  Cycling.gpx

Happy riding!