Skip to content

Instantly share code, notes, and snippets.

@vti
Last active August 29, 2015 14:16
Show Gist options
  • Save vti/bc1b628c23c084f13825 to your computer and use it in GitHub Desktop.
Save vti/bc1b628c23c084f13825 to your computer and use it in GitHub Desktop.
Reliably send GPX to Garmin EDGE 500
#!/bin/sh
#set -x
FILE=$1
DEV=$2
MOUNT=/tmp/garmin
FILE_BASENAME="${FILE%.gpx}"
FILE_DATES="$FILE_BASENAME-dates.gpx"
FILE_TCX="$FILE_BASENAME.tcx"
sudo umount $DEV
sudo dosfsck -av $DEV
mkdir $MOUNT 2>/dev/null
sudo mount -t vfat $DEV $MOUNT
gpsbabel -i gpx -f $FILE -x track,faketime=f19780705200000+2 -o gpx -F $FILE_DATES
gpsbabel -i gpx -f $FILE_DATES -o gtrnctr -F $FILE_TCX
sudo cp $FILE_TCX $MOUNT/Garmin/NewFiles/
sudo umount $DEV
sudo eject $DEV
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment