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!
For Garmin USB connections follow instructions over here:
BeantwoordenVerwijderenhttp://wiki.openstreetmap.org/wiki/USB_Garmin_on_GNU/Linux
/etc/udev/rules.d:
BeantwoordenVerwijderenATTRS{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