I’ve bought a GPS device for use during treking and cycling. Since the choice is rather limited here where most of the GPS devices are car dedicated I’ve ended up with a Garmin eTrex legend HCx.

Connecting

Upon connection my Ubuntu syslog shows:

Sep  7 15:53:47 black kernel: [16333.973603] usb 3-1: new full speed USB device using uhci_hcd and address 3
Sep  7 15:53:47 black kernel: [16334.117759] usb 3-1: configuration #1 chosen from 1 choice
Sep  7 15:53:47 black NetworkManager: <debug> [1220792027.300131] nm_hal_device_added(): New device added (hal udi is '/org/freedesktop/Hal/devices/usb_device_91e_3_noserial').
Sep  7 15:53:47 black NetworkManager: <debug> [1220792027.366350] nm_hal_device_added(): New device added (hal udi is '/org/freedesktop/Hal/devices/usb_device_91e_3_noserial_if0').

Next step was to install gpsbabel, create some kind of a trip map in googleearth and trying to upload it to the device.

Uploading something to the GPS

Here are 2 commands which convert the KML file to gpx (also an XML format) and the upload the gpx to the device:

gpsbabel -t -i kml -f one.kml -x track,title=$name -o gpx -F one.gpx
gpsbabel -t -i gpx -f one.gpx -o garmin -F usb:0

If you have arrived to this point then you should be happy and start understanding a bit what waypoints, tracks and routes are. If you are planning a road based trip then you probably want to design a route and then let the GPS plot a course based on the installed maps. If you are more of an offroad fan then you will plot some waypoints and use them for guidance. I’ve found that the qlandkarte application (also in apt) knows to read maps and allows you to design routes. It also can connect directly to the gps if you don’t like command line.

Downloading data from the GPS

Once you return from your trip you will probably want to download your tracks and data and you can do this with 2 reverse commands:

gpsbabel -t -i garmin -f usb:0 -o gpx -F trip-tracks.gpx
gpsbabel -t -i gpx -f trip-tracks.gpx -o kml -F trip-tracks.kml

You can then use either qlandkarte to see the graphic of your altitudes or googleearth to superimpose the track on the field. It will result something like this:

Next slide
See associated kml or gpx or track description.

Some resources

Comments:

Thomas -

Hello there! I thought it would be useful to indicate another useful free online conversion for gpx to kml files or kml to gpx formats. gpx2kml.com is a fast and easy way to do a quick conversion. Cheers!