3.1. Configuring the Linux kernel

If you are currently running Linux, you must make sure that you have support compiled into your kernel for the necessary PPP modules. I won't go into detail here explaining how to compile a custom Linux kernel, you can find those instructions on LinuxDoc here or the kernel HOWTO I've written here .

3.1.1. Point-to-Point Protocol (PPP)

The first thing you will need is PPP support itself. You can find this under the Linux kernel config option labeled Network Device Support (for both 2.2.x, 2.4.x, and 2.5.x Linux kernels). Below is an image from "xconfig" that shows which options are available for PPP under the 2.4.21 kernel series. Make sure that these are modules and not compiled into the kernel proper as monolithic.

Figure 3-1. Selecting PPP Kernel Options

Simply select the item as a module (option M), or monolithic (option Y). I have had much better luck for compatibility with using it as a loadable module than I have with using it in a monolithic capacity. Your mileage may vary.

Here are the options as they appear in the .config file that the kernel will produce, after saving and exiting the Linux kernel configuration:

CONFIG_PPP=m
CONFIG_PPP_MULTILINK=y
CONFIG_PPP_ASYNC=m
CONFIG_PPP_SYNC_TTY=m
CONFIG_PPP_DEFLATE=m
CONFIG_PPP_BSDCOMP=m

One good reason to use modules is that you can load and unload them runtime, without rebooting to change the options or free the kernel resources they consume. Using modules also makes a much leaner, faster kernel overall, with less bloat.

If you selected PPP as a module, you will also need to verify that there are the proper definitions in your /etc/modules.conf file. The ones you will need to add to this file (which may be /etc/conf.modules depending on your distribution) are:

alias ppp0 off
alias char-major-108    ppp_generic
alias /dev/ppp          ppp_generic
alias tty-ldisc-3       ppp_async  
alias tty-ldisc-14      ppp_synctty
alias ppp0              ppp_generic
alias ppp-compress-21   bsd_comp   
alias ppp-compress-24   ppp_deflate
alias ppp-compress-26   ppp_deflate

Once that is done, and your kernel is compiled and installed, you should be all set for the next steps below. Reboot and select this kernel, and test that it works with all of your existing hardware and configuration options, then proceed to the next step.

3.1.2. Serial (RS232)

If you have a serial Palm handheld device, you're in luck. You don't have to do anything special to your kernel or your configuration, as long as your serial ports function properly, and are enabled in the BIOS.

To test that they are functioning properly, install the statserial package, and cradle your palm. Launch statserial against the serial port your serial Palm handheld is plugged into, and hit HotSync. You should observe the "Clear To Send" (CTS) go high (from 0 to 1) and the same for "Data Set Ready".

Figure 3-2. Debugging with statserial

If both of these do not go high (change from 0 to 1 when HotSync is pressed), then your serial port is misconfigured. Check the BIOS settings, dmesg , and setserial on the port proper. Here is what setserial reports on my machine (an IBM Thinkpad T23 named "broccoli"):

broccoli:~$ setserial /dev/ttyS0
/dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4, Flags: spd_vhi

If you get positive results with statserial, and you know your Palm handheld device works over the serial port, move onto the next step.

3.1.3. Universal Serial Bus (USB)

If you are using a Handspring , Sony , or Palm handheld device with a USB connection type (most of the newer Palm devices are USB), you will need to make sure that you can successfully connect your Visor to your Linux desktop over USB (if you're using a USB cradle or USB HotSync Cable ).

To do this, you have to first mount the usbdevfs file system onto your regular Linux filesystem, and also compile in support for the Visor into your Linux kernel. More information on getting USB running under Linux can be found here (general USB configuration, found on linux-usb.org) and here (README.usb, specific to pilot-link and Palm handhelds, read this first).

The proper mount line to use to mount the "USB Device Filesystem" ( usbdevfs ) is:

broccoli:~# mount -t usbdevfs /proc/bus/usb /proc/bus/usb

If you want this automatically mounted at boot time, you can add it to /etc/fstab using the following syntax:

# /etc/fstab: static file system information.
# <file system>         <mount point>   <type>     <options>   <dump> <pass>
   none                  /proc/bus/usb   usbdevfs   defaults    0      0

There are some modfications you'll need to add to your kernel's ${LINUX_KERNEL_SRC_DIR}/.config file to allow it to support USB on your system shown below:

CONFIG_USB=m
CONFIG_USB_DEBUG=y
CONFIG_USB_DEVICEFS=y
CONFIG_USB_BANDWIDTH=y
CONFIG_USB_UHCI=m
CONFIG_USB_HID=m 
CONFIG_USB_SERIAL=m
CONFIG_USB_SERIAL_DEBUG=y
CONFIG_USB_SERIAL_GENERIC=y

# Originally for Handspring Visor, now used by
# ALL USB Palm handheld devices from Handspring,
# Palm, and Sony.
CONFIG_USB_SERIAL_VISOR=m

# Enable these if you have a Keyspan USB->Serial adapter
CONFIG_USB_SERIAL_KEYSPAN_PDA=m
CONFIG_USB_SERIAL_KEYSPAN=m

Your own system may have different requirements, so make sure you follow those closely to match your architecture and hardware. Many machines use ohci , and many use uhci (and some, like my Thinkpad T23 use both). If you build both as modules, you can determine which one your system supports without having to recompile a new kernel or reboot.

3.1.4. Infrared (IrDA)

Setting up Infrared may be a bit more complicated than setting up USB or Serial connectivity, depending on how well your desktop hardware complies with the IrDA Standards .

There are some tools and diagnostics you can use to help configure it properly for your system. My test system was an IBM Thinkpad T23 running Debian Sid (Unstable) with the latest packages and updates installed as of 1-28-2003.

If you want to include kernel support for IrDA, you can rebuild your kernel with the following options enabled in your ${LINUX_KERNEL_SRC_DIR}/.config:

CONFIG_IRDA=m
CONFIG_IRCOMM=m
CONFIG_IRDA_OPTIONS=y
CONFIG_IRDA_CACHE_LAST_LSAP=y
CONFIG_IRDA_FAST_RR=y
CONFIG_IRDA_DEBUG=y

Once you have a shiny new kernel compiled with the proper support, download a copy of the irda-utils from the Linux IrDA Project homepage, and build it onto your system. This package contains several useful tools for configuring and manipulating your Infrared hardware such as irmanager, irattach, irdaping, irdadump, and others.

Usually irattach is started by irmanager. irattach attaches an IrDA capable tty to the basic services of Linux/IrDA. If kerneld or kmod are running, the modules irda and irtty are loaded automatically, if not you have to load them by hand, in that order. It is recommended that you start irattach in the background.

I start them all with a script which looks like this:

 #!/bin/sh
 # Start up the IrDA process and load necessary modules
 # 
 case "$1" in
   start)
      # Start IRDA
      echo -n "Starting up the IR modules"

      modprobe irda
      modprobe ircomm
      modprobe ircomm-tty
      irattach /dev/ttyS1 -s

      echo "Done."
      echo " "
      ;;

   stop)
      # Kill IRDA
      echo -n "Stopping IRDA and removing used modules"

      # Kill the irattach process and remove the modules
      killall -9 irattach
      rmmod ircomm-tty ircomm irda

      echo "Done."
      echo ""
      ;;

   *)
      echo "Usage: irdastart.sh {start|stop}"
      echo " "
      exit 1  

      esac
      exit 0

To load the IR modules and start the IrDA management using this script, simply save it to a file called "irdastart.sh" and type the following, as root:

broccoli:~# sh ./irdastart.sh start

If IrDA is properly started and you place your Palm within visible range of the IR window on your machine, you should see a dialog pop up that says "Waiting for Sender". If you got this far, you're nearly done.

Now you must make sure that "Beam Receive" is enabled on your Palm handheld (ONLY used for debugging the IrDA connectivity. This is not needed during "real" IrDA HotSync), which basically "turns on" the IrDA receiver on your Palm. If you leave this off, you will not be able to receive IrDA packets.

If you leave this off, it will save quite a bit of battery, so it's good to leave it disabled unless you need it.

  1. Tap on the Prefs icon

  2. Tap the menu in the upper-right corner, and select the "General" option

  3. At the bottom of the list of options should be one labeled "Beam Receive". If this is set to "Off", tap the dropdown arrow next to it and set the value to "On".

Below is an animation which shows how to enable this. To enable "Beam Receive" on your Palm, execute the following:

Figure 3-3. Enabling Beam Receive

The dialog that pops up on your Palm side should resemble this:

Figure 3-4. "Waiting for Sender" Dialog

On the Palm itself, you have to make sure you have support for synchronizing with Infrared. Palm OS versions 3.1 and up have this capability. If your Palm does not have Infrared support (if there is no IR window on the front of your Palm, such as on older Palm 1000 and Palm 5000 units), you will not be able to immediately sync over IR, however there are upgrade modules you can use to add IR support to your Palm.

On your Palm handheld, tap the HotSync icon, and you should see an image similar to the following. Under the center icon on the screen, there is a small dropdown window there for selecting the connection type. You should have an 'IR to a PC/Handheld' option there as shown below. To configure it for proper speed and port operation, simply follow the images below:

Figure 3-5. Selecting IrDA HotSync

Figure 3-6. IrDA HotSync Setup

Once you've done the above steps, you should be properly configured to try syncronizing. Move onto the Infrared Diagnostics section to proceed.