Disclaimer : This document is a work in progress and should not be considered official yet.

Gentoo PDA Guide

Sven Vermeulen  Author
Chris White  Author

Updated November 20, 2007

1.  Setting up PDA Support

Introduction

PDAs are everywhere. They are an evolution of the paper journals and address books and have become very feature-rich: addresses and telephone numbers, pictures and movies, small spreadsheets or documents, calender entries, ... anything is possible with PDAs. And thanks to wireless technology, PDAs can manipulate or receive data from various devices (like GPS devices or other PDAs) or join the world-wide Internet.

However, most PDAs run a propriatary operating system and might not be easy to synchronise with your computer if you are not running software of the same vendor. Luckily, the free software community has made serious efforts in reverse engineering access to the PDAs and some companies have even opened their specification to connect with the PDA. This guide will cover accessing and synchronizing PDAs with your system.

Kernel Setup

The first thing we need to do is get the kernel to recognize our device. Open up the kernel configuration (for instance, through make menuconfig) and add support for your PDA. If your device uses USB to connect to a computer you will most likely find support for it under Device Drivers -> USB support -> USB Serial Converter support. For instance, iPAQ users (and many others) can use the USB PocketPC PDA Driver.

Code Listing 1.1: Kernel Driver Setup

<M> USB Serial Converter support
[ ]   USB Serial Console device support (EXPERIMENTAL)
[ ]   USB Generic Serial Driver
< >   USB Belkin and Peracom Single Port Serial Driver
< >   USB ConnectTech WhiteHEAT Serial Driver
< >   USB Digi International AccelePort USB Serial Driver
< >   USB Cypress M8 USB Serial Driver
< >   USB Empeg empeg-car Mark I/II Driver
< >   USB FTDI Single Port Serial Driver (EXPERIMENTAL)
< >   USB Handspring Visor / Palm m50x / Sony Clie Driver
<M>   USB PocketPC PDA Driver

You might wonder why it is called a Serial Converter. This is because you are going to use USB (technology) to talk with your device, even though the device itself is accessed using a serial protocol.

You will also need asynchronous PPP support:

Code Listing 1.2: Kernel Driver Setup for Async PPP

Device Drivers --->
  Network device support --->
    <M> PPP (point-to-point protocol) support
      <M> PPP support for async serial ports

Rebuild the kernel and its modules. If you only had to modify a module, you can install the modules and continue. Otherwise, set up the new kernel in your boot loader and reboot.

Detecting Your PDA

Ok, now that we have the kernel module setup, let's go ahead and get some information. Plug in your device and take a look at your modules list if you have build support for the device as a kernel module:

Code Listing 1.3: Checking if your PDA is detected

# lsmod
Module                  Size  Used by
ipaq                   30736  0
usbserial              25120  1 ipaq
(...)

# dmesg | grep Pocket
drivers/usb/serial/usb-serial.c: USB Serial support registered for PocketPC PDA
drivers/usb/serial/ipaq.c: USB PocketPC PDA driver v0.5
ipaq 3-2:1.0: PocketPC PDA converter detected
usb 3-2: PocketPC PDA converter now attached to ttyUSB0

# ls -la /dev/ttyUSB0
crw-rw---- 1 root uucp 188, 0 Sep 27 19:21 /dev/ttyUSB0

As we can see, the device has been detected and is now accessible through /dev/ttyUSB0.

2.  Using SynCE

Introduction

SynCE is the tool you can use to connect to and work with Windows Mobile and Windows CE powered devices. The tool connects, through the device set up earlier, to the device and allows applications to synchronise appointments, addresses and more.

A list of devices supported through SynCE can be found on the SynCE website.

SynCE is not available through a stable ebuild though, so before installing it, you will first need to mark them in /etc/portage/package.keywords.

Code Listing 2.1: List of packages to list in package.keywords

app-pda/synce
app-pda/synce-software-manager
app-pda/synce-librapi2
app-pda/synce-libsynce
app-pda/synce-multisync_plugin
app-pda/synce-rra
dev-libs/libmimedir
app-pda/synce-dccm
app-pda/synce-trayicon
app-pda/orange
app-pda/dynamite
app-pda/synce-kde
app-pda/synce-gnomevfs
app-pda/synce-serial

Then, install the app-pda/synce and net-dialup/ppp packages to obtain the necessary tools.

Configuring the PDA

The next task is to configure the serial device we found earlier (/dev/ttyUSB0 in our example) to be used with SynCE:

Code Listing 2.2: Configuring the serial device for SynCE

~# synce-serial-config ttyUSB0

You can now run synce-serial-start to start a serial connection.

This step only has to be performed once: it stored the necessary PPP-related information inside /etc/ppp/peers/synce-device which is read by PPP when it is called by synce-serial-start.

Accessing The Device

Now, log on as the user who will be using the PDA and run the vdccm command. This tool is the connection manager for SynCE through which programs connect to the device.

Code Listing 2.3: Launching the connection manager

~$ vdccm

As root again, run synce-serial-start which will connect to the device. With some PDAs, you will notice this on the PDA itself through a synchronisation symbol or any other event.

Code Listing 2.4: Running synce-serial-start

~# synce-serial-start

In some cases, the first attempts fail but this isn't shown immediately. You can rerun the command a few times until the command replies that a serial connection is already started. To verify that the connection is done, check if a ppp interface (like ppp0) is created and has an IP address attached to it.

When ppp0 is started, the configuration starts the /etc/init.d/net.ppp0 init script which is configured through /etc/conf.d/net.ppp0, so you definitely want to take a look at this configuration file.

File Navigation and Manipulation

The SynCE project provides a number of programs to communicate with the PDA and exchange files. The tools have similar namings as on a regular Unix system but with a p prepended to it: pcp, pls, pmv, prm, pmkdir, prmdir. Other tools are specific for PDAs, like prun to launch a program, synce-install-cab to install a CAB file or pstatus to display information about the device.

Beware though, the behavior of the tools is not all that intuïtive. For instance, the pls tool shows the contents of the My Documents directory whereas the pcp tool starts from the My Device location. As an example, we'll upload a file to the My Documents folder:

Code Listing 2.5: Uploading a file

~$ pls
Directory               Tue 01 Jan 2002 01:00:00 PM CET  Business/
Directory               Tue 01 Jan 2002 01:00:00 PM CET  Personal/
Directory               Tue 01 Jan 2002 01:00:00 PM CET  Templates/
~$ pcp music.mp3 :"My Documents/music.mp3"
File copy of 3852416 bytes took 0 minutes and 38 seconds, that's 101379 bytes/s.
~$ pls
Archive        3852416  Wed 02 Jan 2002 07:05:06 PM CET  music.mp3
Directory               Tue 01 Jan 2002 01:00:00 PM CET  Business/
Directory               Tue 01 Jan 2002 01:00:00 PM CET  Personal/
Directory               Tue 01 Jan 2002 01:00:00 PM CET  Templates/

SynCE for KDE Project

The SynCE for KDE Project aims to support PDAs within KDE by facilitating file exchange, synchronisation and installation and even provide mirroring capabilities so you can control your PDA from within KDE.

The raki tool is SynCE's PocketPC management tool for KDE. The first time you launch it, it asks whether you use dccm or vdccm. Once you selected the connection manager you use (in our example it would be vdccm) your KDE session (or any environment which supports KDE applets) will now have a PDA applet from which you can browse and synchronise your PDA.

However, KDE integration for PDAs is better maintained through KPilot...

3.  All-In-One Tools

KPilot

Note: The author did not get KPilot to run well on his iPAQ as it timed out before the connection was made. If anyone knows a possible solution to this, please report this at bug XXXXXX.

The kde-base/kpilot application provides synchronisation support from the PDA with Kontact (KDE) or Evolution (GNOME). Its setup is quite easy: install the package and launch it. The first time you run it, it will ask you to identify your PDA, either by passing on the device name or having KPilot auto-detect the device.

Once configured, you can quickly synchronise tasks, data, addresses and messages between your PDA and Kontact, the KDE PIM manager.