July 28, 2014
 
 
RSSRSS feed

CPEN and Linux: Techno-Tools for the Techno-Cool - page 2

Like a Kid at Christmas: Checking Out the CPEN

  • September 5, 2002
  • By Rob Reilly

I found it pretty easy to get the CPEN to talk to my Linux laptop. The laptop I used was a 300 Mhz. PII with 10GB disk and 256 MB of memory. Naturally, the IR port had to be operational on the Linux machine. An external IR dongle that could plug into a serial port is available from CPEN although I haven't tested one. You could use the dongle with a desktop. My system was loaded with SuSE Linux 7.3 Pro. I had to install some software, the Open OBEX driver, and some simple apps, which I will detail next.

First, the computer's BIOS had to be set so the IR port was configured for SIR. The speed has been quite acceptable with SIR and I really haven't experimented with FIR yet. Most of the files I've moved are fairly small text files and they don't take any time anyway. And, I've been running at the default 9600 baud rate. Perhaps if any of you code slingers build some Linux programs that use virtual disks on the CPEN, a faster transfer rate may be necessary. Put me first on your list to test your apps.

Setting up the hardware is done as root and can be carried out at the command line. I chose to set up the hardware using terminal windows under the KDE desktop and had no problem. Running the desktop gave the added convenience of being able to use YAST2 (SuSE 7.3 distribution) to load packages and set config.rc parameters.

Out of the box, SuSE 7.3 doesn't load the IRDA package by default. It had to be loaded via YAST2. The package included some drivers, links and tools to make the IR stuff work. It also contained a program called irdadump. Irdadump was used to see when a device was in range and actually showed the data as its streamed by. It was a great diagnostic tool for troubleshooting the IR communication port.

Next, the required kernel modules were loaded. In a terminal window the following commands were typed:


modprobe irda 

modprobe irtty

The proper tty port was established by using the hwinfo command. In a terminal window the following command was typed:


hwinfo | grep tty 

Some ports named /dev/ttyS1 or /dev/ttyS2 showed up toward the bottom of the list, near some irda text. The one that worked with my machine was /dev/ttyS2.

Next the IR device was attached to the IR service with:


irattach /dev/ttyS2 -s 1  

I wanted to have the IR port come up automagically when I booted my laptop so I just set the IR hardware parameters in YAST2 (SuSE 7.3). I could have manually set the IRDA_START parameter in /etc/rc.config to 'yes'. I also would have had to set the IRDA_PORT parameter to '/dev/ttyS2'.

The irdadump command was then used to see if my Linux laptop recognized the CPEN:


irdadump  

Sure enough, various lines scrolled by with an occasional line that showed the CPEN and that it was a PDA type device.

You'll need to download and compile the Open OBEX driver from http://openobex.sourceforge.net. I used openobex-0.9.8-1.i386.rpm. Expand the source RPM with:


rpm xvf openobex-0.9.8-1.i386.rpm  

Running the rpm file built a directory with the source and most .h files that were will needed to build the driver. When I built my laptop with SuSE 7.3, I had loaded the basic C development package. The Open OBEX driver package needed a file named glib.h. It took me a while to figure out that I had to specifically load the glib headers package to get the glib.h file. Make sure it's loaded or you won't be able to compile the Open OBEX binaries.

Next, I went into the Open OBEX directory and ran the following commands:


./configure 
       
make 
       
make install 

That completed the IR hardware setup. The next thing to get working were the applications to move data back and forth between the CPEN and the Linux laptop.

Sitemap | Contact Us