Bringing your Garmin GPS to Linux: Part 2

In Part 1 of this tutorial, I wrote about getting Linux to recognize and manage your Garmin GPS unit.  Now that everything is set up, we can begin to explore how to make use of the GPS.

Most of the work behind the scenes is made possible by the garmin_gps module, which is included by default in 2.6.x kernels.  This module acts as a ‘driver’ for the GPS.  You can verify its existence by executing the following command:
lsmod | grep garmin

One of the neat things you can do is have Linux read the position information from your GPS.  This is accomplished by gpsd, a background service which passes position information from the device to any program that can read it.  One such program is TangoGPS, which will display your current position overlaid over a basemap.  The basemap is constructed from tiles downloaded over the internet from a web mapping service (WMS) such as Google or OpenStreetMap.  With an internet connection, you can turn your Linux computer into a real-time navigation device.  Obviously, this has limited practical uses – but it is fun to play with.

A better use of your GPS is to collect position information in the field, either as tracks or points, and then use them on the computer.  Unfortunately, the garmin_gps module doesn’t really help with this.  There is a program called gpsbabel which will allow you to read and write from your GPS, but it is blocked by the garmin_gps module.  In order to get gpsbabel working we have to remove the module from the kernel, using this command:
modprobe -r garmin_gps

This only works temporarily, though – the module will be reloaded the next time you restart your computer.  To prevent this, you need to blacklist the module.  Add the following two lines to the end of /etc/modprobe.d/blacklist.conf:
# prevent garmin_gps from being loaded
blacklist garmin_gps

Once the module has been unloaded, gpsbabel should automatically take over the management of your GPS device.  This allows you to use a number of wonderful graphical GIS management programs, such as QLandkarte GT and Viking.  These programs can be used to transfer maps and data to and from your device, and are functionally similar to the proprietary Windows software provided by Garmin.

One small problem – while gpsbabel is managing your device, gpsd won’t work.  Fortunately, if you want to use it again, just reinsert the module by running the following command:
modprobe garmin_gps

If you prefer to return the module permanently to the kernel, simply comment out the last line of the blacklist.conf file like so:
# prevent garmin_gps from being loaded
# blacklist garmin_gps

Hopefully one of these solutions will help you on your way to happy GPSing.

(tested on Fedora 14, results on other distributions may vary slightly)

Comments are closed.