|
CPEN and Linux: Techno-Tools for the Techno-Cool
Like a Kid at Christmas: Checking Out the CPENCPEN is a 75-Mhz StrongArm processor jammed with a little OCR (Optical Character Recognition) module into a package the size of a pudgy dry erase marker. It has 8 MB of RAM, an address book, calendar application, dictionary, tiny little 7 line LCD and can scan most text either right to left or left to right. With all the applications loaded there's about 3.5 MB of space available for scanned text. That's a lot of text! Did I mention that it recognizes graffiti style letters as you draw them, will scan bar codes and can store binary files, too? It will even trade files with other PDAs. Plus, no connecting wires and it works with Linux. Are light bulbs going off yet? The CPEN also blows away every other device on the market for attention getting and boosting your techno cool factor. Put it together with Linux and you will have truly cutting edge technology at your fingertips. Just run a CPEN over a page of text for a couple of minutes around any decent sized group of people. Guaranteed, they will stop what they are doing and watch you. Try to be low key about it. I hope you can handle the interruptions and gawking. At some point, some brave soul will ask you what the heck you are doing. You can then proceed to show them how all the features work and maybe meet a new client for your business. People have stopped me in restaurants, the mall and in meetings as I've used the CPEN to take notes, look up phone numbers and check my calendar. The most expensive model is around $200, but if you use one steadily for a week, your scope of new contacts and friends will be well worth the cash. I think the 600C model goes for about $99. If you just happen to have your Linux laptop there too, it's a great opportunity to enlighten your new friends about the merits of Open Source software, as well. All jokes about improving geek status aside, I typically use my CPEN and my Linux laptop with the IR port for managing business contact information, collecting web sites, and as an aid for article research. Considering the rate at which Linux is adding applications and moving into all kinds of businesses, it's no surprise that niche applications for something like a CPEN would be a little slim. I'm happy to say that the basic functionality of moving information from the CPEN to Linux apps is out there. Fortunately, since the irOBEX protocol is used for transfers, the CPEN operating system knows what type of files are being transferred and simply makes them available to the correct CPEN applications. To make it work, for example, you just make sure the file extensions are correct, beam the file, and poof, your new contact comes up in the CPEN address book. It's simple! The Open OBEX software used to send and receive files with the CPEN is available at SourceForge. As for writing software on a Linux machine that will run on the CPEN, there's a SDK that is available for download from CPEN. Unfortunately, it's Windows-based. I looked at the source code a year ago and it looked like C++. The application would probably require extensive modification, but it might serve as a starting point to get going on some CPEN/Linux application development.
Lines of CommunicationI 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.
Working with CPEN and LinuxAll that techno coolness meant nothing if it couldn't be put to good use. Here's how the applications were installed and configured. The Open OBEX application setup was virtually identical to the installation of the driver software. You'll need to download and compile Openobex-apps from its SourceForge site. I used openobex-apps-0.9.8-1.i386.rpm. The RPM was expanded with: rpm xvf openobex-apps-0.9.8-1.i386.rpm Running the rpm file built a directory with the source and most .h files that were needed to build the basic file transfer applications. Just so you aren't disappointed, these applications aren't very sophisticated or comprehensive. They were executed within an X-term and simply move the files back and forth between the CPEN and my computer. Just as before, I went into the Openobex-apps directory and ran the following commands:
./configure
make
make install
What I ended up with was a program in the Openobex-apps directory called irxfer. I switched to a normal user account and executed the irxfer command. The ixfer program is executed in an X-term and simply waits for a file to be beamed from the CPEN. I picked a name out of the address book on the CPEN and beamed it over. As expected, the irxfer program showed the transfer taking place and when it completed it simply returned to the command prompt. Note: The file did show up in the /tmp directory. There were a couple of other programs that did various other functions, but irxfer is the main one. A similar operation worked from the laptop to the CPEN. This time a filename (rob.txt) was added to the irxfer command. Lo and behold, the CPEN beeped and asked if I wanted to save the file on its little LCD screen. Looking in the main notepad directory on the CPEN showed that the rob.txt file had been successfully moved over. I tried it with a .vcf (vcard file) and the file transferred right over to the address book on the CPEN. I could pull up the new name and address in the address book without problem. I realize this doesn't sound like much, but think of the possibilities.
Wrapping UpThe CPEN 800 is a remarkable little device. It has a camera in one end that scans and recognizes text, and has 8 MB of RAM, a note pad, address book, calendar, dictionary--and the whole thing fits snugly in your hand. I've found it to be a great aid to collecting web addresses, taking notes ,and acting as a PDA. Through the magic of IR the CPEN and move data back and forth to your Linux laptop. There are lots of possiblities to develop applications that would work well in the Linux environment. I think the open architecture, sophistication, and practicality of the CPEN perfectly compliments the Linux lifestyle. Rob Reilly is a technology consultant who writes and speaks about Linux, business integration, innovation and automotive design. He has 16 years experience in the technology, manufacturing and utilities industries. He is always 'on-the-lookout' for stories and projects that focus on Linux, business and the cutting edge. Send him a note or visit his web site at http://home.cfl.rr.com/rreilly.
|