Getting GPS data into Scientific Linux 6.0

The tried and true (command line) program for interfacing between GPS instruments and Linux workstations is gpsbabel. QGIS and GRASS for example use gpsbabel to pull waypoints and tracks into GIS layers. However, to get gsbabel working on Scientific Linux 6.0 requires jumping a few hurdles

The steps below should also be applicable to RedHat Enterprise Linux 6 and, of course CentOS 6.

To begin we need to install the gpsbabel package. But it’s not yet available on the standard repositories. Hopefully this will change and the EPEL repo will offer gpsbabel for RHEL 6 and clones as they did for the 5.x versions. Until then we can just download and use the package from Fedora’s koji build system. I used the 1.3.6 version (not the newest) built for Fedora 12 x86_64. It should install fine on SL 6.0.

Next is the kernel module issue. For years now Linux kernels have shipped with a kernel module named garmin_gps. But it seems this module is flaky compared to the internal driver that gpsbabel uses. More details are found on the gpsbabel website .  If you’re using any model Garmin GPS, it’s recommended to blacklist the kernel driver and rely only on the gpsbabel software. Here’s how it’s done (the commands below must be run as root): First remove the current module from memory, and check it’s gone:

# rmmod garmin_gps
# lsmod | grep garmin
(Should return nothing)

Now edit the file /etc/modprobe.d/blacklist.conf and add the following line:

# MS: remove kernel garmin_gps module
blacklist garmin_gps
This prevents the module from loading on future reboots.

Finally, you must give regular users access to the USB device. In most modern distros the mounting of hardware is handled automatically by a program called udev. By default, new devices are accessible only to the root user, but we need to allow a regular user to access the usb port when the GPS is plugged in. We do this by adding a udev config file. Again as root begin editing a new file: /etc/udev/rules.d/51-garmin.rules and enter this single line:

SYSFS{idVendor}=="091e", SYSFS{idProduct}=="0003", MODE="0666"

Then run:
# udevadm control --reload-rules

That’s it. Now switch back to a regular user, plugin your GPS, and try to download some data. A typical command line for gpsbabel might be:
$ gpsbabel -t -i garmin -o gpx usb: bike_rides.gpx

Leave a Reply

Your email address will not be published. Required fields are marked *