Paperless geocaching - Palm and Linux

From NzGpsWiki

After reading the articles on this site, I wanted to go paperless geocaching too. But I wanted to go paperless with Linux, for I've been penguin powered on the desktop for several years now. Before I went and splashed out on PDA, I needed to know it would work. Some detailed research was in order.

This article is the results of my research. It's written in a fairly basic way to assist beginners. If you're a Linux guru, then you probably don't need this article, because you're already done it.

The Palm PDA's normally connect through a USB to a proprietary Windows program on a PC. Some Palm PDA's also connect via bluetooth or wireless networking, but I wasn't interested in going that upmarket. I got the PDA installed and comfortable in Windows XP with the USB port, to be sure it was working.

My desktop is KDE running on Kubuntu. A quick search of the package list showed that I'd need KPilot to talk to the Palm via USB. Let's install KPilot from the command line for Kubuntu:

$ apt-get install kpilot

Configuring KPilot was easy; the first I ran it, the program auto-detected the PDA and did the necessary. Doing a hotsync backup of the Palm caused KPilot to partially crash when backing up certain files. While KPilot recovered gracefully from the problem, the Palm generally didn't; it often required a manual hardware reset. Not a good start... Reading the KPilot documentation and user comments revealed that certain Palm files should be put on the 'ignore backup' list for my model. My comfort and sanity was restored.

Following the advice of other articles on this site, I installed CacheMate on the Palm using the Windows interface. Now I needed a way to convert the geocaching LOC and GPX files to the CacheMate database format. The CacheMate website offered a zip file (CMconvert) for download that claimed to be Linux compatible source code.

After downloading the file and examining it, I found it was indeed C++ source code, configured for Windows, MacOS and Linux compilation. Problem was that I haven't done a source code compile in so long – and certainly not in Kubuntu – because everything I want is now in packages. A quick investigation and read of the Kubuntu / Debian documentation revealed that I needed to install the build-essential package to get the compiler tools, GNU C\C++ compiler, GNU Make and the required header files.

$ apt-get install build-essential

Reading the README and INSTALL files in the cmconvert zip file, told me that the source code used the familiar build commands:

$ ./configure

- to set up the source code for a compile

$ make

- to compile the code

$ make install

- to install the compiled code

At my first compile attempt, the ./configure command barfed saying the expat library was missing. The INSTALL file had said it was required, and I had thought was already installed. Often though packages are spit into a package of runtime libraries, and and separate a package of the development headers needed for software compilation. Doing a search of the available package lists found the expat development package in amongst a screen full of other expat packages:

$ apt-cache search expat
libexpat1-dev     – XML parsing C library – development kit

The missing package problem was easily fixed with:

$ apt-get install libexpat1-dev

With the expat development package installed, the compile was smooth and without issue. The program installed cleanly and included a man page in the UNIX tradition. To get a concise rundown of the software, key commands, etc, type the following:

$ man cmconvert

Now, from Linux, I could download GPX and LOC files from geocaching.com; convert them to Palm '.prb' files with cmconvert; then upload them to the Palm with kpilot.

I found the cmconvert commands a bit arcane to remember, so I wrote a wrapper shell script to handle this:


#!/bin/bash
#
# This script does conversions of gpx & loc files
#
# cmconvert.sh <file name>
#

if [ "x$1" = "x" ]; then
  echo "Usage: $0 <file name>"
  exit
fi

/usr/local/bin/cmconvert -CdOsa -N 10 $1''

The file is saved with the name cmconvert.sh to somewhere convenient, and given execution privileges. Executing cmconvert.sh <file to be converted> does the job nicely.

To complete the paperless transition, you probably also want to install GPSBabel to upload the LOC and GPX files directly to your GPS. I use another shell script to do this with my old GPS 12 serial cable to my GPS 60C (I've never got the USB cable to work for me under Linux):


#!/bin/bash
#
# This script does uploads of gpx & loc files to a Garmin GPS
#
# gpsbabel.sh <file name>
#

if [ "x$1" = "x" ]; then
  echo "Usage: $0 <file name>"
  exit
fi

/usr/bin/gpsbabel -i geo -f $1 -o garmin -F /dev/ttyS0

Happy paperless geocaching with the penguin. --ags 17:31, 17 April 2006 (NZST)