Using a PDA with Linux, Part 2: Cards and Conversions
File Transfer to/from Expansion Cards
If you followed the procedures in part 1 of this series, your Linux Palm desktop and your PDA are finally speaking to each other via Linux USB serial protocols. Now you’ll want to be able to transfer documents back and forth.
Working with the expansion card uses USB mass storage connection methods. There are three ways to transfer files to/from the expansion card:
- Use an external card reader.
- Use a Palm file manager, such as FileZ.
- Use Card Export II to make the external card emulate a USB mass storage device.
With an external card reader, you can add/change/delete files you want on your Palm by using the card from your workstation. This method is convenient if you already have an external card reader, but with time I think that you’ll find this approach to be an increasing nuisance.
Using Card Export II
Card Export II, shown in Figure 1, turns your Palm external memory into a mountable drive, making the external card emulate a USB mass storage device. Install it to your Palm and then push the "connect to desktop" button. If your distribution doesn’t automatically mount it and put it on your desktop as an icon, you can mount it as you would a camera or thumb drive. Card Export II is a proprietary app and costs $14.95, but it’s the best way I’ve found to get easy access to an external card from Linux. If you don’t want to spend the money, I recommend downloading the software anyway and using it as a time-limited demo; it’s a lot easier to create new directories and move files around via point-and-click with a Linux GUI file manager than by using a Palm file manager such as FileZ.
With a Linux file manager, you can deal with files in groups; for example, you can highlight, copy, and paste a stack of files. Card Export II provides direct access to your hard drive, so you can work with your Linux file managers by using your workstation display, keyboard, and mouse to manipulate files.
Figure 1 Card Export II.
Follow these steps:
- Plug the Palm USB cable into the computer, with the Palm connected to the other end.
- Open Card Export II on the Palm and push the Connect to Desktop button.
- If a desktop icon for the drive appears, see whether you can access the directories by double-clicking the icon to open them, including reading files and putting files into the directories. If the drive is mounted automatically, you don’t need to create the scripts described in the next section. However, check to make sure that everything works before deciding whether automatic mounting is a good idea or not.
- The Palm should unmount automatically when you hit Disconnect on Card Export II, but check for directory corruption if you do it that way. I had to reformat the card from the Palm several times while I was trying to work all of this out.
What if the desktop doesn’t automatically mount your expansion card as a drive? You need to add some script files so you can easily mount and unmount the "drive." The following section provides the scripts you’ll need.
Scripts for Connecting and Disconnecting an External Card
- Open a terminal window and log in as root:
su – root
- Open a text editor as root from the command line. Copy the following lines
from this page and paste them into the text editor:
#!/bin/sh # /usr/local/bin/palmopen.sh # if you have a stability problem, delete "-0 noatime" from the command line below echo Palm expansion card mounting script mount -o noatime /dev/sda1 /mnt/palm
- Save the file to the following path:
- Close the text editor.
- Reopen the text editor as root. Then copy the following lines from this
page and paste them into the text editor:
C: #!/bin/sh # /usr/local/bin/palmclose.sh echo Palm expansion card mounting script echo You have 5 seconds to shut off Card Export on Palm sleep 5 umount /dev/sda1 /mnt/palm
- Save the file to the following path:
- Close the text editor.
Working with the Palm Expansion Card
Since you’ll probably need to create directories on your memory card once you have access to it, knowing what you should create is helpful, particularly since this isn’t necessarily the same on all Palm PDAs. My recommendations in the rest of this article are based on my Palm Zire 31; your directory setup might be different. Let’s find out for sure with the Card Directories Palm program.
- Open Card Directories on your Palm PDA by choosing Preferences > Card
Directories (it’s at the bottom of the Preferences screen under Other).
You’ll find a list of file types versus directories like the one shown
in Figure 2. These directories may not exist on your PDA’s external
card; if not, you need to create them.
Figure 2 Card Directories Palm utility.
- Write down the directory names and file associations for at least the MP3, AVI, PRC, and JPG file types. Then close Card Directories.
- Open Card Export II on the Palm and hit the Connect to Desktop button.
- Run the following command:
# sh palmopen.sh
This command opens the expansion card.
- Choose Start > System Tools > More System Tools > Superuser File Manager to open the Superuser File Manager. Point/click your way to /mnt/palm.
- Create these directories if they don’t already exist in /mnt/palm:
- Change to the /mnt/palm/palm directory.
- Create a Programs directory if it doesn’t already exist. Create any other directories that Card Directories showed but you don’t have on the expansion card.
- Once you’re done, exit the Palm directory tree.
- Copy the files from the computer that you were planning to put on the expansion card and put them where Card Directories said they were supposed to go. Put MP3s and other audio files in audio; put images/video in dcim.
- Run the following command to disconnect Card Export II:
# sh palmclose.sh
- Unplug the USB cable from the PDA.
Limited Card Access via pilot-link
Before the very latest version, pilot-link simply didn’t see external memory cards. pilot-link-0.12.0-pre4 has limited support for external cards. The limitation is that you can install and probably delete files as you please, but you can’t add/remove directories working from within the Palm PDA, or get a real-time view of what’s on the card. You can supplement this lack by using the FileZ file manager running on the Palm PDA, and do any of these operations.
The -D command allows specifying a file on the Palm card. Here’s how the command works, in general form:
pilot-xfer -p /dev/pilot -i File.prc -D /Palm/Launcher
Here’s an example of how it works in practice (everything after –I is program output):
[root@terrarium root]# pilot-xfer -p usb: -i /home/alizard/win/baen_books/honorverse/The_Short_Victorious_War/The_Short_Victorious_War.pdb -D /Palm/Launcher Listening for incoming connection on usb:... connected! Installing ’The_Short_Victorious_War.pdb’ ... (690526 bytes) 674 KiB total. Thank you for using pilot-link.
Figure 3 shows a directory tree from the FileZ Palm file manager utility.
Figure 3 FileZ directory tree display.
What if you put the file in the wrong place? Remember that Card Export II only provides access to the external memory card. You’ll need something else to deal with files within the Palm itself, especially if you don’t realize that you have a problem until after you’re away from your computer.
Use FileZ as you would any file manager. Note that the most important file formats you’ll work with are files with the .prc extension(applications) and .pdb extension (documents).