Search:  
Gentoo Wiki

HOWTO_PDA-PIM

This article is part of the HOWTO series.
Installation Kernel & Hardware Networks Portage Software System X Server Gaming Non-x86 Emulators Misc


Please improve it in any way that you see fit, and remove this notice {{Cleanup}} from the article. For tips on cleaning and formatting see Cleanup process



Please format this article according to the guidelines and Wikification suggestions, then remove this notice {{Wikify}} from the article


Note: This page was salvaged from the gentoo website, it has since been removed from there.

I do not know if this information is at all accurate, and is probably outdated, but I've put it here in case it could come in handy, or rather serve as a base for a proper article.

Contents

PDA Independent Setup

The first thing that must be done before any information management is done, is getting your PDA to talk to your computer.

USB Connection

The first thing you must do is see if your kernel supports your USB hardware properly, and if not, install the appropriate drivers. This HOWTO assumes that you know the basics of configuring a kernel.

If you do not already have the sources to the Linux kernel on your hard drive, now would be the time to go and get them. I will not cover the different kernels that Gentoo offers, so if you would like more information, please consult the Installation Guide.

Linux Kernel Configuration: Necessary USB Kernel Options (Kernel 2.6)
Device Drivers --->
  USB support  --->
    <M> Support for Host-side USB
    [*]   USB device filesystem 
    --- USB Host Controller Drivers
    <M> EHCI HCD (USB 2.0) support
    <M> OHCI HCD support
    <M> UHCI HCD (most Intel and VIA) support
    USB Serial Converter support  --->
      <M> USB Serial Converter support
      <M>   USB PocketPC PDA Driver

Instead of USB PocketPC PDA Driver choose the Module of your Handheld. If you have a Palm, it is quite likely that the proper module is the same as the Visor, right above the "USB PocketPC PDA Driver"

Note: If possible, compile these as modules, and add them to /etc/modules.autoload/kernel-2.6 so that they can be automatically loaded at boot time.

Serial Connection

I'll assume your serial PDA cradle plugs into the first serial port (/dev/ttyS0, or /dev/tts/0 in "devfs" notation).

Code: Adding serial device
# groupadd serial
# chown root:serial /dev/tts/0
# chmod g+rw /dev/tts/0
# ls -l /dev/tts/0
# crw-rw----    1 root     serial     4,  64 Dec 31  1969 /dev/tts/0
# ln -s /dev/tts/0 /dev/pilot
# nano -w /etc/group (add appropriate users to the serial group)

We've added a "serial" group to the system, and you should add any users who need to use the serial port (any Palm pilot users) to the serial group. We've given the serial group "rw" permissions on /dev/tts/0, and for future reference we have made a /dev/pilot symbolic link to /dev/tts/0. Thanks to recent changes in how devfs is handled on Gentoo these changes will persist after rebooting.

Note: Users of pre-rc6-r13 can either upgrade sys-apps/baselayout and sys-fs/devfsd (and merge in any "._cfg*" files in /etc that result), or simply add the appropriate permissions and symlink in /etc/devfsd.conf.

Restarting devfsd

Now you need to restart the devfsd daemon. If your config file has errors, you may need to start the daemon again manually because it will stop running.

Code: Restarting devfsd
# killall -HUP devfsd

Sharp Zaurus (SL5000/SL5500) USB Connection

The Zaurus has the handy feature of being able to connect to your computer like a device on the network, but it does not require a network card (NIC). All that you need is your Zaurus' USB cradle, and the usbd kernel module.

Note: Most of this information is derived from http://www.zauruszone.com/howtos/lc_generic.shtml. I give much thanks to Sharp's Developer website for their willingness to work with the Open Source community.

2.6.x Kernel Directions

No patch is required for the 2.6 kernel - usb network drivers are built in.

Configure your kernel like so:

Linux Kernel Configuration: (gentoo-sources-2.6.x)
Device Drivers  --->
  USB support  --->
    USB Network Adapters  --->
      <M> Multi-purpose USB Networking Framework
      <M>   Sharp Zaurus (stock ROMs) and compatible

After this, you may need to reboot. Then skip to "After kernel configuration."


2.4.x Kernel Directions

The first thing that has to be done is the kernel patch. The usbd driver is a patch file that is patched against a kernel tree, and then enabled during kernel configuration.

Code: Getting and Installing the usbd kernel patch
# cd /usr/src
# wget http://www.zauruszone.com/howtos/downloads/usbdnet-2.4.18-patch.gz
Patch for kernel 2.4.18
# wget http://www.zauruszone.com/howtos/downloads/usbdnet-2.4.19-patch.gz
Patch for kernel 2.4.19
# wget http://www.zauruszone.com/howtos/downloads/usbdnet-2.4.20-patch.gz
Patch for kernel 2.4.20

Now, patch the kernel, where 2.4.x is the patch that corresponds to your kernel version

# zcat usbdnet-2.4.x.patch.gz | patch -p0

Once that is done, configure your kernel and add these options:

Linux Kernel Configuration: Sharp Zaurus (SL5000/SL5500) USB Connection
Code maturity level options -->
  <*> Prompt for development and/or incomplete code/drivers
Device Drivers -->
  USB support -->
    USB Network Adapters -->
       <M>   USBD Network (Encapsulated) Host-to-Host Link (EXPERIMENTAL)
      [04dd] USBD Network idVendor 
      [8004] USBD Network idProduct.

It does not matter if the usbd module is built as a module or into the kernel. If you do build it as a module, make sure that you load it after you reboot. Additionally, make sure that you have the necessary USB information built into your kernel, as noted above.


After kernel configuration

After your kernel is configured and you have rebooted, it is time to see if the patch has worked and you are in business.

After turning your Zaurus on, insert it into the cradle and hit the sync button. If you check /var/log/messages, you should see some information like this:

Code: /var/log/messages output
# tail -f /var/log/messages
output
hub.c: USB new device connect on bus1/1, assigned device number 38
usb.c: USB device 38 (vend/prod 0x4dd/0x8004) is not claimed by any active driver.
v0.4b sl@lineo.com, tbr@lineo.com
usbdnet.c: v0.4b sl@lineo.com, tbr@lineo.com
usbdnet.c: USB Host to Device Network - for Linux USB Devices using MDLM/CDC
usb.c: registered new driver usbdnet

If all goes well with that step, move on to loading the network device:

# ifconfig -a

One of the adapters, namely usb0 should show up in the list.

Now it is time to setup the network on the Zaurus. USB Networking is similar to PPP in that each device on either end gets an IP address. The IP address on the Zaurus is set via the network setup tool. If it is not "192.168.129.201" then use the given IP adddress when trying to ping the Zaurus below.

If when you put the Zaurus in the cradle an interface other then usb0 is created, replace all usb0 instances with that interface name for this section of the HOWTO. You should be able to configure the device using the following commands:

# ifconfig usb0 192.168.129.1 netmask 255.255.255.255 up 
# route add -host 192.168.129.201 usb0 

Now, try to ping the Zaurus,

ping 192.168.129.201

if you've got a reply then you are sucessfully connected!

Note: The above steps will only get your desktop talking to the Zaurus for syncing purposes. If you wish to connect to the Internet from the Zaurus via the USB cradle, please consult the Sharp Zaurus Developer website.

Miscellaneous Procedures

Before compiling any programs that you will be using for your PDA, it is a good idea to add pda to your USE variable in /etc/make.conf. Doing this will ensure that any programs you have will have their optional PDA (if availible) support built-in.

Now, if you are going to be using a Palm/Handspring, it is a good idea to add the necessary symlinks.

# ln -s /dev/usb/tts/1 /dev/palm
# ln -s /dev/usb/tts/1 /dev/pilot

Handspring/Palm Syncing

General Information

You will need software to synchronize the data on your PDA. So far, we have setup the hardware side of the house, now its time for the (hopefully) easier software side. There are two major categories for syncing software; some are rather low-level and simply perform the synchronization download, others are more robust palm environments to edit and view the data on your palmtop.

Coldsync

Coldsync is considered a low-level program, because it doesn't do anything fancy like some of the ones covered later. This may or may not be what you are looking for. Coldsync can be found at http://www.coldsync.org/ It was written as a replacement for pilot-link. To install this program, do the following:

# emerge coldsync

Now, after making sure all of your modules are loaded, press the sync button on the cradle and within a few seconds, execute coldsync with proper options as a user this time:

# mkdir ~/palmbackup/
press the sync button
# coldsync -p /dev/usb/tts/1 -mb ~/palmbackup/

Pilot-link

Pilot-Link can be found at http://www.gnu-designs.com/pilot-link. This utility is beyond the scope of this tutorial because I chose not to use this program directly. However, I've read that the execution command is something like this:

# mkdir ~/palmbackup/
press the sync button
# pilot-xfer -p /dev/usb/tts/1 -b ~/palmbackup/

Higher-Level Syncing Software

There are a few Palm desktop equivalents. I will go over how to use JPilot, which uses the pilot-link libraries. You can try them out at your own pleasure:

J-Pilot

J-Pilot is easy. Emerge it and run it, play around with it. To install, type:

# emerge jpilot

Now as a user, go ahead and sync your palm first, then run the software:

# jpilot-sync
# jpilot

Note: If syncing doesn't work, look at the error message; you may need to make a symlink, set your permissions properly in devfsd, or pass an argument. See the manpage.

Smooth, Sexy Automation

Now you should go and look at your devfsd configuration file again. If you hadn't guessed by, this is how you get the PDA to sync automatically when you press the sync button. When that device shows up, you can setup devfsd to automatically execute something. Below, I have an example setup for user YOU:

File: /etc/devfsd.conf
#configure USB  added by YOU!
REGISTER        ^usb            PERMISSIONS     0.0     0777
REGISTER        ^usb/tts        PERMISSIONS     0.0     0777
Use this if you are using jpilot to sync
REGISTER        ^usb/tts/1      EXECUTE       /bin/su YOU -c	"/usr/bin/jpilot -sync"
Use this if you are using coldsync to sync
REGISTER       ^usb/tts/1       EXECUTE       /bin/su YOU -c	/usr/local/bin/sync-coldsync &

If you are using coldsync to sync, you have to create a small script called /usr/local/bin/sync-coldsync with the following content:

File: /usr/local/bin/sync-coldsync
#!/bin/sh
/usr/bin/coldsync -p /dev/usb/tts/ -mb $HOME/palmbackup

Note: This option is not availible if you are syncing via serial since serial is always "on". USB is detected differently than serial. You may try, but this will not work with serial.

Note: The daemon is run as root. Notice that it uses su to change to the person who owns the pilot before syncing, and doesn't require a password to do so.

Final Notes

Additional info:


The contents of this document are licensed under the Creative Commons - Attribution / Share Alike license.

Copyright 2001-2005 Gentoo Technologies, Inc.

Retrieved from "http://www.gentoo-wiki.info/HOWTO_PDA-PIM"

Last modified: Sun, 24 Jun 2007 20:45:00 +0000 Hits: 24,200