LinuxDevCenter.com

oreilly.comSafari Books Online.Conferences.

We've expanded our Linux news coverage and improved our search! Search for all things Linux across O'Reilly!

Search
Search Tips

advertisement

Print Subscribe to Linux Subscribe to Newsletters
Linux & Unix > Excerpts >

Making the Palm/Linux Connection

by Chris Halsall
05/05/2000

Also in Linux and Your PDA:

A Palm Introduction - The gizmo that's taken the handheld marketplace by storm

All Linux PDA: Fact or Fiction? - Have you heard about the Yopy?

Linux and Unix users are often pleasantly surprised by how much software is available to support PalmOS devices. In addition to the traditional graphical "Palm Desktop" environment programs like J-Pilot, there exists a large quantity of low-level and specialized tools for communicating with, managing, and even emulating the Palm.

Practical Pilot-Link

Included with most modern Linux distributions now is a package called "pilot-link," written by Kenneth Albanowski. This suite of tools and libraries enables communications between a Unix environment and a Palm though the serial port, and is used by many other programs to take care of the messy details. Language bindings exist for C, C++, Python, Tcl, and Perl. If you find you don't have pilot-link installed, or want to upgrade, download locations can be found at FileWatcher).

A few Pilot-Link tricks

There's a little bit of configuration needed to allow pilot-link to establish a connection with a PalmOS device, specifically dealing with the serial port the Palm is connected to. It's a good idea to set up a symbolic link from /dev/pilot to the proper serial port. For example, if your Palm Pilot's cradle is connected to the second serial port, execute the command ln -s /dev/ttyS1 /dev/pilot as root. To make sure every program can access the port, execute the command chmod 666 /dev/ttyS0 (again, as root).

The default communications speed used by pilot-link is a miserable 9600 baud. The environmental variable "PILOTRATE" can be set to the desired baud rate, such as 19200, 38400, or even 57600. Don't set this too high though, or communications errors will slow things down even worse. It's also possible to override the serial port used by setting the environmental variable "PILOTPORT." Since some other programs don't look at this variable though, I recommend having the sym-link set up as above as well.

The tools included in the pilot-link package over many different services, all command-line oriented. Be aware that some of them are experimental, so it's a really good idea to back up your Palm before using them. man pilot-link to see a list of all the included commands, what they do, and their stability status. Several of the commands also have man pages of their own.

If your Palm has never been used before, you will need to set the UserName on the device before any other communications can be done. This is done using the "install-user" command, and need only be done once. Unlike the other pilot-link components, the serial port must be explicitly passed, so install-user /dev/pilot yourname 500 would set the username to "yourname" and the UserID to 500. The UserID parameter is optional, but I like to set mine to be the same as my Unix user ID.

The Handy Pilot-xfer

The most useful tool included is probably "pilot-xfer," which has its own man page, and is able to do most of the data exchange needed day-to-day. To back up your Palm, for example, simply execute the command pilot-xfer -b BACKUP_DIRECTORY, place your Palm in its cradle, and press the hot-sync button. Every program (.prc) and database (.pdb) file on the Palm will be transferred and stored in the directory. To synchronize all the files, execute the pilot-xfer -s BACKUP_DIRECTORY command. To completely restore instead (for example, after a hard-crash), use pilot-xfer -r BACKUP_DIRECTORY.

It's also possible to install a new program or database file on a Palm by running pilot-xfer -i FILE. To see a list of all the files in a Palm's memory, execute pilot-xfer -l. Note that the list doesn't include the ".prc" or ".pdb" suffix, so when you fetch a file back with pilot-xfer -f FILE, FILE should not include the suffix. In fact, if it's given, the transfer will fail with "unable to locate database" message.

We have only really scratched the surface of what is possible using the tools inside the pilot-link package. As shown here, the package allows full, if only command-line, support of a Palm's file system. I encourage you to look at the pilot-link, pilot-xfer, and related man pages for additional tools and abilities. And if you're writing a user-space Palm-enabled application, you would likely save yourself a lot of development time by leveraging on the included libraries.

Pages: 1, 2, 3

Next Pagearrow




Tagged Articles

Post to del.icio.us

This article has been tagged:

palm

Articles that share the tag palm:

Making the Palm/Linux Connection (16 tags)

Palm Programming with Waba (3 tags)

Java Programming for Palm OS (2 tags)

What's J2ME? (2 tags)

View All

linux

Articles that share the tag linux:

Managing Disk Space with LVM (74 tags)

Use Your Digital Camera with Linux (60 tags)

mdadm: A New Tool For Linux Software RAID Management (59 tags)

Asterisk: A Bare-Bones VoIP Example (43 tags)

View All

howto

Articles that share the tag howto:

Rolling with Ruby on Rails (258 tags)

From Weblog to CMS with WordPress (98 tags)

Top Ten Digital Photography Tips (92 tags)

Top Ten Mac OS X Tips for Unix Geeks (79 tags)

View All

jpilot

Articles that share the tag jpilot:

Making the Palm/Linux Connection (3 tags)

View All

pilot

Articles that share the tag pilot:

Making the Palm/Linux Connection (2 tags)

View All

Recommended for You

Sponsored Resources

  • Inside Lightroom
Advertisement

Sponsored by:

Sign up today to receive special discounts,
product alerts, and news from O'Reilly.
Privacy Policy >
View Sample Newsletter >
  • Youtube
  • http://www.youtube.com/OreillyMedia
  • Twitter
  • Subscribe
  • View All RSS Feeds >
O'Reilly Media

800-889-8969 or 707-827-7019
Monday-Friday 7:30am-5pm PT
©2011, O'Reilly Media, Inc.
All trademarks and registered trademarks appearing on oreilly.com are the property of their respective owners.
  • About O'Reilly
  • Academic Solutions
  • Contacts
  • Customer Service
  • Careers
  • Press Room
  • Privacy Policy
  • Terms of Service
  • Writing for O'Reilly
  • Community
  • Authors
  • Forums
  • Membership
  • Newsletters
  • RSS Feeds
  • User Groups
  • Partner Sites
  • makezine.com
  • makerfaire.com
  • craftzine.com
  • igniteshow.com
  • PayPal Developer Zone
  • O'Reilly Insights on Forbes.com