Getting a USB Visor (and an Olympus camera) to work with Mandrake

41
By Stephen Uitti

It was my wife who insisted on getting a Palm Pilot. She’s not terribly technical, she just wanted a calendar, address, book, and such. This was interpreted to mean a personal digital assistant (PDA) that runs the Palm OS. I insisted that we get two. I had never used a Palm before, and I refused to perform tech support on a system that I’d never seen and didn’t have. (I’ve been down this road before.)

There are several companies that sell Palm OS machines. My research suggested that all Palm OS machines are about the same. In particular, software for one runs on any.

Palm OS PDAs differ, however, along these lines:

  • RAM. They have from 4 MB to 16 MB internal RAM.
    Nearly all are expandable, but they may require different
    hardware to achieve it.

  • Some have built-in cell phones. These often have a slightly
    smaller screen.

  • Color or gray scale. Color is expensive. Often the color
    screens are smaller. Smaller screens are harder to read.

  • CPU speed. Faster should be better, but it mostly doesn’t matter.
  • Battery type. Standard batteries or lithium ion battery packs.

I settled on Handspring Platinum Visors. These are gray scale with 8 MB RAM, and are pretty fast. They use two standard AAA batteries. I use NiMH rechargeables — $11 for a set of four. Spares are cheap. They cost about a half cent per charge cycle.
So, I read books downloaded from Project Gutenberg (http://promo.net/pg/) in the dark with the back-light; there was no reason not to. The host side software for the USB interface
is different for Handspring and Palm; more on this later.

I was running an old Slackware distribution on my primary machine (a PII/350)
at home, and it didn’t support USB of any kind. My motherboard sports a pair of USB ports. I had an Epson printer with an USB port, but just ran it with parallel.
I looked at several distributions such as Peanut, Storm, Debian, Red Hat, Slackware, and Mandrake. I had a spare disk drive and installed each of these for evaluation.
Mandrake stood out by mentioning support for USB hot syncing.
Besides, it understood my sound card and video card without much hassle.

My Mandrake 8.2 (beta) distribution install included basically everything.
Modern hard disks are huge (including my 3-year-old IDE drive).
A full install is about 3.2 GB. I created a 4.8 GB root partition, and installed everything there. I never used to do it this way. I’d have at least /, /usr, swap and some sort of /home, if not /var, and /usr/local. But life is too short to guess at how big these things need to be, and it just doesn’t seem to matter any more. All system stuff goes into /, and everything else goes into the big partition. There’s also a 1 GB swap partition. It’s overkill. I probably don’t need any swap with 650 MB RAM.

I configured X windows to use my Matrox card and 14-inch monitor.
I tested the sound card. I tested the printer. It worked the first time.
I brought up GNOME, then the J-Pilot user interface for the PDA.
It didn’t work. I fooled around with it. Eventually, I bought a serial interface. This was partly inspired by documentation in /usr/share/doc/jpilot-0.99.1,
which talked about setting it up. This nearly worked, but took forever,
and was unreliable. After a couple hours of performing a backup,
it would hang for no reason.

Then, I looked up the Visor project on SourceForge
(http://sourceforge.net/projects/usbvisor/). There is a link to a FAQ, which has a link to a trouble shooting tips page:
http://www.linuxpda.com/visor/howto/v0.5/x350.html. It says that for USB, you need to have the kernel modules visor, usbserial, usbcore;
and one of the following: usb-uhci or ohci.
This choice is determined by what kind of USB interface your computer has.
I didn’t really care too much about this, because Mandrake Linux figured out what I had, and installed the right module automatically. If you want to know more about this, you can go to linux-usb.org.
For me, this is usb-uhci. By the time my kernel is booted up,
all I need is usbserial and visor. So, all I needed to do was become root, and say: insmod usbserial

insmod visor
.

Now, when one clicks the sync button in jpilot, it says to tap
the hot sync button on the cradle. This is too late. One must tap
the hot sync button first. When this is done, jpilot still does not generally finish a backup, even with USB. However, it fails much faster. Further digging suggested
that I attempt to use another utility. I downloaded coldsync,
www.coldsync.org,
configured it, compiled it, and installed it. The command

coldsync -F -mb newdir

creates a complete backup in the existing directory newdir.
It’s reasonably reliable and reasonably fast. The -F flag tells it
to go fast. The documentation suggests that this should only be used
if you know what you are doing. I don’t know what that means.
It works for me.

To restore a complete backup, which I did on another machine after
my visor screen broke, the command is:

coldsync -F -mr newdir
.

This is also a way to install new stuff. Just put it into a directory,
and run the above command. It gets added to the PDA. Applications can be updated with this technique. It replaces just the application and/or data.

This would be the end of it, but I wanted painless backups.
So I wrote this script:

#!/bin/sh
D=$HOME/Visor/Backup.'date +%Y%m%d%H%M%S'
mkdir $D
coldsync -F -mb $D

This creates a new directory using the backup date/time in the name.
Everything is copied from the Visor to the new directory. Even a full
Visor with 8 MB of stuff requires 125 backups to fill a gigabyte of
hard disk. Eighty-one backups fit on a CD.

But then, I broke my screen. How did I break it? It’s easy enough. I did it in my sleep.
Really. I had it on my night stand, after putting myself to sleep
reading a
novel.
At about 2:57 a.m., local time, I rolled over and my elbow
sent it flying. It would likely have survived if I had the cover on,
or had it in the case.


Summary

End users should not have to deal with arcane incantations
to get stuff to work. And, it should work the first time, every
time. If arcane incantations are required, then there should
somewhere exist a simple list of instructions for the impatient.

To say that the Mandrake documentation was poor is an understatement.
It was out of date, since it discussed using a serial interface only.
It was incomplete even there.
The referenced trouble shooting tips page is excellent: short
and to the point.

My guess is that jpilot works with a Palm from Palm.
It’s very likely that Mandrake tested it.

On the positive side, I did not have to reconfigure or recompile
my Mandrake kernel. I did not have to reboot the machine for
any of these installs. Had I known what to do in advance, it
would have simply worked.

Addendum

In the mean time, my point and shoot film camera’s flash died, relegating
it to outdoor shots. I decided to pick up a cheap point-and-shoot
digital camera to replace it. I didn’t check hardware compatibility
first — I figured if I couldn’t get it to work, I’d return it.

The Olympus D-370
was offered at close-out prices for $130 at
Office Max.
It’s a 1.3 megapixel camera with minimal optics (no zoom).
It has a little internal RAM, and can store four highest quality (1280 by 960) images, and up to nine 640 by 480 images, or even 10 seconds or so of Quicktime video (no sound).
It uses Smartmedia cards, and 64 MB gives 100 high quality images,
900 640×480, and maybe 5 minutes of video.
It has a USB interface.

Naturally, I couldn’t get it to work right away with Linux.
That’s why God invented search engines.
And a page
at Raubacapeu.net
describing a Linux box talking to a Sony DSC P1 camera set me straight.
The required kernel modules are:
usb-uhci, usb-storage, usbcore, scsi_mod,
and sd_mod.
Of course, you might need ohci instead of usb-uhci,
if that’s the kind of USB hardware you have on your motherboard.
But for me, all I need to do after boot is:
insmod usb-storage, and the others are all there.

The camera appears as a file system on the SCSI bus.
Well, I have a SCSI bus, but it appears that this is not required.
In any case, I added this line to my /etc/fstab file, and created a /olympus directory.
/dev/sda1 /olympus msdos defaults,noauto,user
.

Then, I can just say mount /olympus,
and the image files appear in a subdirectory of /olympus.

That would be the end of it, but I wanted something to quickly download
all images to my hard disk.
The subdirectory is the same every time.
I wanted to dump the images to a new image directory named
for the download date/time. So, I wrote the following script:

#!/bin/sh
# Remember:
# modprobe usb-storage
mount /olympus
H=$HOME/Images
D=`date +%Y%m%d%H`
mkdir $H/$D
cd $H/$D
cp /olympus/dcim/100olymp/* .
echo `ls -1 | wc -l` images copied to $H/$D
chmod -x *
umount /olympus

The script tells you where it put the images. Because
xmovie and broadcast 2000 can both show Quicktime videos,
I’ve started experimenting with video clips.
The fun never ends.