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!

2 opmerkingen:

  1. For Garmin USB connections follow instructions over here:
    http://wiki.openstreetmap.org/wiki/USB_Garmin_on_GNU/Linux

    BeantwoordenVerwijderen
  2. /etc/udev/rules.d:
    ATTRS{idVendor}=="091e", ATTRS{idProduct}=="0003", MODE="0660", GROUP="plugdev"

    /etc/modprobe.d:
    # prevent garmin_gps from being loaded so generic USB can be used instead
    blacklist garmin_gps

    BeantwoordenVerwijderen