====== GPS-devices ======
===== Overview =====
GPS stands for **G**lobal **P**ositioning **S**ystem. GPS devices (also referred to as GPS receivers) provide the user with his/her geographic coordinates. GPS sport watches allow to save and export tracks, that is collections of geo-localized points describing the run or any movement that was done.
This howto is based on experiences on Garmin Etrex Legend HCx (GPS device) and, on Slackware 15.0, on a Garmin Forerunner 205 (GPS sport watch); but it should also work at least for any Garmin GPS receiver.
===== Software =====
I'm mostly using gpsbabel; this command line tool can retrieve and send data from/to a GPS device. \\
There's also qlandkartegt which can deal with the data provided by the GPS receiver. \\
Both are available via [[http://www.slackbuilds.org|SlackBuilds.org]]
===== Connecting the Device =====
When a GPS device is connected to the computer, it becomes recognized as a USB device by udev and the module garmin_gps is loaded. In most cases the module will not work for us. Fortunately gpsbabel comes with its own drivers so the module garmin_gps is not needed. One can blacklist it by adding in /etc/modprobe.d/blacklist.conf the line blacklist garmin_gps
===== udev-rules =====
If you want to access the device as a non-root user, the following udev rule allows users who are members of the //plugdev// group to access the GPS device.
# /etc/udev/rules.d/51-garmin.rules
ATTR{idVendor}=="091e", ATTR{idProduct}=="0003", MODE="666", GROUP="plugdev"
===== Sending Data to the Device =====
As an example here is the code which transfers a gpx waypoint file to a Garmin GPS device.
gpsbabel -i gpx -f $file -o garmin -F usb:
===== Exporting Data from the Device =====
In case of a GPS sport watch, the most important operation is extracting tracks from the device, usually in a gpx format.
Here is an example to extract all the tracks saved in the device to a single gpx file (using GPX format version 1.1):
gpsbabel -t -i garmin -f usb: -o gpx,gpxver=1.1 -F $FILEOUT
To extract to file $FILEOUT a single gpx track with name $TRACKNAME from a global gpx file $FILEIN containing all tracks:
gpsbabel -i gpx -t -f $FILEIN -x track,name=${TRACKNAME} -o gpx,gpxver=1.1 -F $FILEOUT
The extracted gpx track can then be further processed by other sw, such as ZombieTrackerGPS, or uploaded on Garmin Connect website (GPX format version 1.1 is mandatory)
===== Further Reading =====
The website for [[http://www.gpsbabel.org/|gpsbabel]] \\
The website for [[http://www.qlandkarte.org/|qlandkartegt]] \\
The website for [[https://www.zombietrackergps.net/ztgps/|ZombieTrackerGPS]] \\
The [[http://www.openstreetmap.org/|openstreetmap project]]
====== Sources ======
* Originally written by [[wiki:user:markush | Markus Hutmacher]] \\
* Contributions by [[wiki:user:pceres | Pasquale Ceres]]
{{tag>howtos gps, gpsd, gpsbabel}}