Review: Four GPS Software Packages for Linux

I picked up a new Pharos iGPS-500 GPS Receiver from earlier this week for under 60 bones. When I opened it up, found out exactly how absolutely TINY it is. The “Actual Size” denotation on the box is slightly misleading fraudulent. Although the GPS portion of the device is small, the USB to serial adapter that plugs into the GPS unit doubles the “Actual Size in Real Life,” that the marketing droids happily ignored.

That minor quibble aside, I don’t really care how big it is. It could be the size of a banana phone and I would still use it – as long as it was able to find my current location and do it quickly. This USB GPS unit claims to be one of the fastest GPS units out there, sporting the new Sirf III (or SiRFstar III) chipset.
Pharos PB010 USB iGPS-500 GPS Receiver
According to Wikipedia the Sirf III chipset inside this Pharos iGPS-500 is capable of acquiring and maintaining a signal lock in urban or densely covered forest environments. This is great news for me personally, since I’m always lugging around a laptop when I go hiking in the forest.

It is pretty quick to lock onto a location when I’m inside. In fact, I have yet to do any driving tests with it yet (too busy compiling this article) although I’m sure it’ll work just fine. With this particular model, you can even purchase a Bluetooth adapter for it after the fact and use it with something other than a computer – some smartphones have GPS software available and will work just fine with a Bluetooth connection. Pretty rad, if I do say so myself.

Getting it working in Ubuntu Hardy required a bit of research. The information I found assumes a pretty high level of knowledge, and there’s not any centralized location for getting GPS units working that I could find.

Hardware Installation:
I plugged in the unit, and ran dmesg | grep tty to make sure it was detected:

usb 2-2: pl2303 converter now attached to ttyUSB0

This means the device is available at /dev/ttyUSB0 – pretty simple.

Installing software:
I’m testing four different GPS software suites for Linux: GPS Drive, Roadnav, Navit and VIking. GPS Drive and Viking are right in the Ubuntu repository. Roadnav has a debian package available on their website that worked quite well. Last but not least there’s Navit, which requires installing from source. I’m assuming that the person reading this wants to test out all four software suites. They each have their own strengths and weaknesses, and it’s best to test out each platform before settling on a choice.

# apt-get install gpsd python-gps gpsdrive viking gpsd-clients libgps-dev libgtk2.0-dev glutg3-dev libcegui-mk2-dev libxmu-dev libsdl-dev libpcre3-dev libspeechd-dev libtiff-dev libdevil-dev build-essential subversion automake


Now that we’ve got all the software we need to get any of the four programs working, making sure the device works with gpsd is a good starting point. gpsd is an abstraction layer between a compatible device and the mapping software. If your device works with gpsd, you’ll be all set. The reason we need gpsd is because there’s no standard for communication for GPS units. Each company has their own way of doing things. Magellan, DeLorme and Garmin never got together to create an open standard for communication and gpsd is the savior that converts each different GPS protocol into something each piece of mapping software can understand easily.

$ gpsd -N -n -D 2 /dev/ttyUSB0
gpsd: launching (Version 2.36)
gpsd: listening on port gpsd
gpsd: successfully connected to the DBUS system bus
gpsd: running with effective group ID 0
gpsd: running with effective user ID 0
gpsd: opening GPS data source at ‘/dev/ttyUSB1’
gpsd: speed 9600, 8N1
gpsd: garmin_gps not active.
gpsd: gpsd_activate(1): opened GPS (5)
gpsd: client (0) connect on fd 6
gpsd: client(0) turned on raw mode
gpsd: speed 4800, 8N1

Looking good. Let’s make sure that gpsprof can access it.

$ gpsprof -f cycle
gpsprof: looking for fix…first fix in 0.42sec, gathering samples……(27.42 sec) done.
Cycle report Fri Apr 4 04:07:49 2008, Generic NMEA, 4800N1, cycle 1s
The sentence set emitted by this GPS is: GSA RMC GGA GSV
GSA: is emitted once a second.
RMC: is probably emitted once a second.
GGA: is emitted once a second.
GSV: is emitted once every 5 seconds.
Send cycle is once per second.

If all is well with gpsd and gpsprof, we’re all set and ready to rock and roll.

I tested out GPS Drive first – it’s right in the Ubuntu repositories. GPS Drive works fine right out of the box. The maps it uses are fairly good, but could be higher resolution. For an application that’s got “Drive” in the name, it’s got a not-so-driver-friendly interface, and the routing portion is klunky. Otherwise, it’s a nice basic application that has a cool indicator in the status bar for how many GPS signals it’s caught onto.

Next, I downloaded Roadnav‘s debian installer for Ubuntu Gutsy Gibbon 7.10 from their website and installed it, had no problems running in 8.04. Roadnav has a really slick looking 3D view. It’s got a pleasing interface, and is suitable for a lower resolution screen. Directions and route finding are dismal at best. I would say that it’s pretty average in most ways – nothing sticks out as great except the 3D viewport.

Next, we’re taking a look at Navit. If you’re a new Linux user or otherwise technophobic, Avert your eyes and skip on down to the next software package, or just go down to the nearest 7-11 and pickup a hardcopy map. It’ll be easier and definitely faster. Navit doesn’t come with any maps by default, nor does it allow downloading maps from the web automatically, which is a huge disadvantage. Here’s the compile instructions for Navit on Ubuntu – should work in both 7.10 and 8.04… watch out for that first step – it’s a doozy!

svn co libgarmin
tar -xzvf navit-0.0.4.tar.gz
tar -xzvf quesoglc-0.7.1.tar.gz
cd quesoglc-0.7.1 && ./configure –prefix=/usr
sudo make && sudo make install
cd../libgarmin && ./
sudo make && sudo make install
sudo make && sudo make install

I added libgarmin support in those instructions – just in case you’ve got a Garmin GPS you’re working with – can’t hurt to have extra support just in case. 🙂 Navit doesn’t come with maps, other than the developers’ hometown of Munich that gets downloaded during the compile process. We probably don’t need a map of Munich, so I went and downloaded a free online US state map of Utah. Navit does a pretty nifty thing here – it can use three different types of maps: OpenStreetMaps, Grosser Reiseplaner (Eurpean), and Garmin. OpenStreetMaps is a free offering for the USA, so that’s what I’ll be using. So now that we’ve got it Navit compiled, there’s one step left – configuration. Probably harder than copy and pasting stuff in, but if you want to get it working, have at it:
Create a folder to store Navit configuration settings:
mkdir ~/.navit
The Utah Map I downloaded from the above link was bzipped, used this command to extract:
bunzip2 Utah.bz2
To parse the map into a format usable by Navit, use the osm2navit tool and copy the resulting file into our configuration directory:
cat Utah.osm | osm2navit ~/.navit/Utah.bin && cp Utah.bin ~/.navit
Configure Navit properly for our location:
mkdir ~/.navit && cp ~/navit-0.0.4/src/navit.xml ~/.navit
The Navit webiste suggests visiting an online mapping application to get your current latitude and longitude so that Navit will startup centered on your general location. I find it’s a little bit easier to Google for “latitude longitude cityname”
Open up navit.xml in the editor of your choice.
Around line 16 you’ll see this:

<navit center=”4808 N 1134 E” zoom=”256″ tracking=”1″ cursor=”1″ orientation=”0″>

I changed the center part to this to point it at Salt Lake City, Utah

center=”4071 N -111 W”

Around line 66 you’ll see the following:

<map type=”binfile” enabled=”yes” data=”$NAVIT_SHAREDIR/maps/osm_bbox_11.3,47.9,11.7,48.2.bin”/>

I changed that line to reflect the map file location:

<map type=”binfile” enabled=”yes” data=”~/.navit/Utah.bin” />

And…. Done! launch navit and you should have maps for your location (assuming you downloaded something other than Utah maps) and it should be centered on your location (assuming you properly wrote in your latitude and longitude). Hot damn. Navit is great and all, but I’m not quite sure it’s ready. It needs some spit shine and polish before I would recommend using it.

On the other end of the spectrum, there’s a brilliant peice of software aptly named Viking. Historically speaking, Vikings are considered an extinct society of explorers and conquerors hailing from Minnesota who wear purple and yellow uniforms.

Viking – the software – is fantastic. It’s the only program tested today that will download Google Map tiles automagically to render a map. This solves the problem of having bad maps. You can even go as far as downloading maps and saving them to your hard drive. This shatters the Terms of Service for Google Maps in at least two ways:

The Service may not be used for or with real time route guidance (including without limitation, turn-by-turn route guidance and other routing that is enabled through the use of a sensor)
You may not use Google Maps in a manner which gives you or any other person access to mass downloads or bulk feeds of numerical latitude and longitude coordinates.

Sorry Google! However, this violation doesn’t quite stop me from recommending Viking. It’s got some neat features such as multiple map layers, all three types of maps from Google (Street, Hybrid, and Satellite) as well as the ability to import data from GPS units that have built-in tracking functions. Also it has a routing function that pulls waypoint data from Google. I didn’t find myself wishing for any features from another GPS package – I think it’s the best free offering available for the general purpose of tracking where you are and easily getting good directions – as long as you have an internet connection.

I’ve read many opinions from varying biases that say GPS software for Linux is not up to par with software developed for Windows or Mac.  I would have to disagree – Viking does what I need and does it well. Did I miss any free GPS software for Linux that should have been included here? Please let me know via email, comments, or twitter.