Sunday, August 1, 1999

Using your Palm device with Linux

.KEYWORD linux
.FLYINGHEAD THE LINUX LIFE
.TITLE Using your Palm device with Linux
.FEATURE
.SUMMARY The Linux operating system user base has been growing by leaps and bounds over the last year. In this article, contributing editor Jason Perlow helps you set up Linux to work with your Palm device, show you how to get HotSync operations working, and explore some tasty desktop solutions.
.AUTHOR Jason Perlow
The Linux operating system user base has been growing by leaps and bounds over the last year, due to a combination of factors: the explosion of the open source phenomenon; improvements in Linux that make it more palatable to end-users; and a general anti-Microsoft sentiment that has been sweeping some among the power-user community. Until recently, however, Linux users have been lacking tools to allow them the same level of Palm device interoperability their Windows and Macintosh-using peers have been enjoying for quite some time.

But that’s no longer the case. In this article, we’ll help you set up Linux to work with your Palm device, show you how to get HotSync operations working, and explore some tasty desktop solutions.

If you’re not a Linux user, you’ll find this article interesting. But you should know that we’re aiming the article at already established Linux users. If you’ve got questions, feel free to post them on the PowerBoards. A link to the appropriate discussion board is at the end of the article.

.H1 Setting up the HotSync connection
Assuming you’ve got your favorite Linux distribution up and running, the first thing you’ll want to do is connect your HotSync cradle to an available communications port. In most Linux distributions (such as Red Hat 6.0) the first two serial COM ports are mapped to /dev/cua0 and /dev/cua1, but it might be /dev/ttys0 or /dev/ttys1.

By default, most Linux synchronization software looks for the HotSync port on /dev/pilot, so the first thing you’ll want to do is make a hard link (using the ln command) to your serial port by issuing the following command from the shell prompt:

.BEGIN_CODE
ln /dev/cua1 /dev/pilot
.END_CODE

Replace "cua1" with the name of the port to which you connected your Palm OS device’s cradle.

.H1 Syncing up, penguin style
The next thing you’ll want to do is download a copy of software called Pilot-link. If you’re running a recent version of Red Hat or Caldera, you’ve probably already got Pilot-link installed. Just in case, you can download the latest version from ftp://ryeham.ee.ryerson.ca/pub/PalmOS/.

Like a lot of open source applications, you will need to unzip it with gunzip and untar it, then run the configuration script by running "./configure" from the directory you’ve untar’ed Pilot-link to.

After the configuration script has configured the Makefile for your system, simply type "make install" to compile and install Pilot-link on your system.

.PAGE
Once you’ve got Pilot-link installed, you should edit your .bashrc (it’s a hidden file located in your home directory) or similar shell configuration file to export the environment variable PILOTRATE to a nice, high number like 115,200. This sets the baud rate at which Linux talks to the Palm unit’s cradle for performing a HotSync operation. On my system, I ran "pico .bashrc" from the /home/jason directory and added the following lines:

.BEGIN_CODE
PILOTRATE=115200
export PILOTRATE
.END_CODE

Pilot-link comes with a lot of command-line utilities for doing stuff with your Palm device. Among them are:

.BEGIN_LIST
.BULLET addresses: dump Palm Address Book into generic format;
.BULLET ccexample: test program demonstrating C++ interface;
.BULLET debugsh: command-line interface to Palm debug monitor;
.BULLET dlpsh: command-line interface to Palm HotSync protocol;
.BULLET getrom: program to fetch ROM using getrom.prc or getrom2.prc;
.BULLET getrom.prc: Palm device program to help dump a 512K ROM;
.BULLET getrom2.prc: Palm device program to help dump a 1024K ROM (used for OS 2.x or 3.x);
.BULLET iambicexample: test program demonstrating C++ interface;
.BULLET ietf2datebook: convert IETF calendar to format used by install-datebook;
.BULLET install-datebook: import Date Book records from a text format into Palm device;
.BULLET install-memo: import Memo Pad records from a text format into Palm device;
.BULLET install-todos: import To Do records from a text format into Palm device;
.BULLET install-user: modify user name settings (and report lots of into) about Palm device;
.BULLET memos: export memos from Palm device in mailbox format;
.BULLET pi-csd: must be running to accept Network HotSync connects;
.BULLET pi-getram: program that retrieves RAM from Palm device;
.BULLET pi-getrom: program that retrieves ROM from Palm device (without getrom.prc);
.BULLET pi-nredir: program that accepts connections and redirects them via the Network HotSync protocol;
.BULLET pi-port: experimental program to separate serial layer from Pilot-link;
.BULLET pilot-addresses: import and export Address Book;
.BULLET pilot-clip: experimental program to import and export data from Palm device clipboard;
.BULLET pilot-debug: graphical and command-line program to interface with Pilot debug monitor;
.BULLET pilot-dedupe: strips duplicate records from Palm device databases;
.BULLET pilot-file: disect .prc and .pdb files;
.BULLET pilot-mail: import mail from POP3 mailbox into Palm organizer’s Mail application, and send mail via sendmail;
.BULLET pilot-schlep: store a single file on the Palm device;
.BULLET pilot-undelete: turn archived records into normal records;
.BULLET pilot-xfer: back up, restore, install and delete Palm databases (this is a very useful program);
.BULLET read-expenses: export Expense application database into text format;
.BULLET read-ical: export Palm Date Book and To Do databases into an ical calendar (ical is required);
.BULLET read-todos: export Palm To Do database into generic text format;
.BULLET reminders: export Palm Date Book into a ‘remind’ data file;
.BULLET sync-plan: completely synchronize the Palm Date Book with the Plan calendar via netplan;
.BULLET validate: experimental program to test C++ features.
.END_LIST

Of all of these utilities, you will likely use pilot-xfer the most. Pilot-xfer allows you to install programs on your Palm device, make a backup, and restore that backup.

To install a program, type the following at the command prompt:

.BEGIN_CODE
pilot-xfer /dev/pilot -i program.prc
.END_CODE

To backup your Palm device, type the following at the command prompt:

.BEGIN_CODE
pilot-xfer /dev/pilot -b backup-directory
.END_CODE

This will copy all of the databases on your Palm OS device to a directory called "backup-directory", creating it if it doesn’t already exist.

To restore data to Palm device, type the following at the command prompt:

.BEGIN_CODE
pilot-xfer /dev/pilot -r backup-directory
.END_CODE

Generally, you will only need to do this if your Palm device loses power or if you have to do a hard reset.

To list the programs on your Palm device, type the following at the command prompt:

.BEGIN_CODE
pilot-xfer /dev/pilot -l
.END_CODE

.H1 Choose your desktop
While the utilities in Pilot-link are handy, you’ll want to duplicate the Palm Desktop environment on the Linux desktop. While 3Com doesn’t provide desktop support for Linux, there are a few open-source alternatives that fit the bill nicely.

J-pilot, which is by far the most complete, can be obtained from http://jpilot.linuxbox.com/. Like Pilot-link, you’ll want to download the source code and compile it for your Linux distribution. J-pilot uses the GTK toolset and libraries (which is also used by the GNOME environment), so you’ll want to download them from http://www.gnome.org if you don’t have them installed on your system. Red Hat Linux 6.0 comes with GNOME and GTK installed by default.

J-pilot works very much like the Windows and Mac versions of Palm Desktop. Many of the applications look similar to the Windows program. For example, you can see the Address Book, shown in Figure A.

.FIGPAIR A Edit your address book in J-pilot.

The Date Book, shown in Figure B, is pretty slick-looking, too.

.FIGPAIR B Here’s the J-pilot Date Book.

Figure C shows J-pilot’s Memo Pad section.

.FIGPAIR C Here’s how the Memo Pad application looks in J-pilot.

If you make your To Do List entries in J-file, it’ll look something like Figure D.

.FIGPAIR D Here’s how your J-pilot To Do List will look.

J-pilot cannot backup your Palm unit’s databases, nor can you export data from it to other applications. For that, you’ll need KPilot, shown in Figure E, which runs in KDE, the competing environment to GNOME.

.FIGPAIR E You’ll need Kpilot to export data to other applications or to backup your Palm device’s databases.

Luckily, with most Linux distributions, you can run KDE and GNOME apps side by side without leaving the desktop. Red Hat Linux 6.0 comes with KDE 1.1 and KPilot pre-installed, several other distributions such as SuSE and Caldera use KDE as the default GUI. If KPilot isn’t already installed as part of your distribution, you can get it from http://www.slac.com/pilone/kpilot_home/download.html.

Like J-pilot, you synchronize, view and modify Address Book and Memo entries on your Linux desktop, and export Address Book and Memo entries to text files.

Additionally, KPilot includes a graphical program installation utility and a conduit for synchronizing with POP3 email. KPilot also can backup your system like pilot-xfer and saves your data in a subdirectory of your user directory, /.kde/share/apps/kpilot/DBBackup/Firstname Lastname/.

.h1 Wrap-up
This may have been the first time PalmPower’s gone into depth with Linux, but it sure won’t be the last. In future articles, we’ll go into depth on conduits to Linux applications, and other Linux utilities for your Palm organizer you can download from the Internet.

.BEGIN_SIDEBAR
.H1 Product availability and resources
Visit the Palm OS Desktop HOWTO at http://www.orbits.com/Palm/PalmOS-HOWTO.html.

The Pilot-link software is available from ftp://ryeham.ee.ryerson.ca/pub/PalmOS/.

Visit the J-pilot homepage at http://jpilot.linuxbox.com/.

Visit the KPilot homepage at http://www.slac.com/pilone/kpilot_home/download.html.
.END_SIDEBAR

.BIO Jason Perlow is a contributing editor with PalmPower. When he’s not recompiling his Linux kernel or scouring the net for great Linux software, he can be reached at perlow@hotmail.com.
.DISCUSS http://powerboards.zatz.com/cgi-bin/webx?13@@.ee6d52b