Setting up photo-card access
This file documents the procedure to set up access to the photo-card readers
on hpoj-supported models with this functionality, including the PhotoSmart
printers and several OfficeJet- and PSC-branded products.
There are two possible methods you can use for photo-card access, depending
on what model you have:
- mtools
command-line utilities and the
ptal-photod daemon provided as part
of the hpoj software. Works on more models, but is slower and can't be
mounted as a file system.
- Standard USB-mass-storage interface. Technically, this method does not
have any interaction with the hpoj software. Works on fewer models, but is
faster and is mounted as a file system, meaning you can use standard Unix
file management tools to access the photo card.
See the hpoj
Supported devices page
for the most up-to-date list of which models support photo-card access using
which of the above possible methods.
In case of difficulty
If something goes wrong with these instructions, then refer to
both of the following separate documents for more information:
mtools
method
Initial setup
Be sure to follow the instructions to compile
and install the hpoj software and set up
basic device connectivity if you haven't already.
When "ptal-init setup" adds a new
device, it probes the device for photo-card reader support and arranges
for ptal-photod to be started
automatically.
Place the following lines in /etc/mtools.conf (for all users)
or ~/.mtoolsrc (for individual users):
mtools_skip_check=1
drive p: file=":0" remote
If you have more than one hpoj-managed device with photo-card readers,
then add as many additional lines as needed, incrementing the
"drive" letter and "file" number each time as follows:
drive q: file=":1" remote
drive r: file=":2" remote
drive s: file=":3" remote
The drive letters are how you refer to the device with the
mtools
commands, and the numbers specified by the file=":0" keyword are
used to match the drive letter with a specific instance of
ptal-photod.
Important: Look through the rest of the configuration file to make sure
you aren't re-using a drive letter that is already defined. If you are, then
use different drive letter(s), and/or comment out drive definitions that you
don't need. Also, try running mtoolstest to see if it detects
any configuration file problems.
Accessing photo cards
The following
mtools
commands are useful for manipulating files
and directories on the currently inserted photo card. For more information,
refer to the manual pages for each command and the general mtools
manual page.
- mdir -- lists directory contents (as in ls)
- mcopy, mren, mmove -- copies, renames, or moves
files or directories (as in cp or mv)
- mdel, mdeltree -- deletes individual files or entire
directory trees (as in rm or "rm -r")
- mmd, mrd -- creates or removes directories
- mcd -- sets the default drive letter and current working
directory (as in cd)
- mtype -- lists file contents to standard output (as in
cat)
- mdu -- lists disk space usage of directory trees and their files
(as in du)
Examples:
- mdir p:
Lists the directory of drive P.
- mcopy p:/hp500_01/\*.jpg .
Copies all *.jpg files from the /hp500_01 directory
on drive P into the Unix current working directory. Note the use of
forward slashes for path delimiters and a backslash before the asterisk
to prevent the shell from interpreting it.
- mcopy p:/hp500_01/\*.jpg q:/foodir
Copies all *.jpg files from the /hp500_01 directory
on drive P into the foodir directory on drive Q.
USB-mass-storage interface method
Follow this procedure as root to set this up:
- Create a "mount point" for the file system (for example,
"/photos"):
mkdir /photos
- Make sure the "usb-storage" kernel module is loaded:
/sbin/lsmod
/sbin/modprobe usb-storage # If it's not already loaded
- Look in the syslog file (probably /var/log/messages) for
messages relating to usb-storage or "USB Mass Storage". Depending
on your kernel version, there should be a message saying something like
"Attached scsi removable disk sda at scsi1, channel 0, id 0, lun
0". (If you don't see any such messages, then try running
"/sbin/rmmod usb-storage ; /sbin/modprobe usb-storage" and check
for the messages again.)
- Insert the photo card if it isn't already inserted.
- Mount the file system:
mount -t vfat /dev/sda1 /photos
Substitute for sda the drive name you found in the log
message above, but append "1" after it. Also, specify
the actual mount point you created if it's not "/photos".
- You can now use /photos as you would any other mounted
file system:
cd /photos
ls
ee foo.jpg
cp foo.jpg ~/saved_photos/
- Important: Before removing the photo card or disconnecting
or powering off the device, cd out of the /photos file
system, close any applications that are accessing files on the device,
and unmount the file system:
cd
umount /photos
- If you'd like to simplify the mount command above to
something like "mount /photos", then add the following line
to /etc/fstab (again, adjusting "sda" and/or
"/photos" as needed):
/dev/sda1 /photos vfat defaults,noauto,user 0 0
This line allows any user to mount the file system; remove ",user"
if you want only root to be able to do that.
In general, this procedure should work on any USB device which, according
to usbview or
/proc/bus/usb/devices, has a non-print interface with a
class/subclass/protocol ID of 08/06/50 (USB mass-storage).
If you have multiple SCSI (including USB mass-storage) devices, beware that
the device numbers you used above could change, resulting in incorrectly
mapped mount points, if you add or remove devices, or depending on what
order you connect or power them on.
If you experience problems with this functionality on an older kernel version,
then you may need to upgrade to the latest stable kernel version.
In case of difficulty
If something goes wrong with these instructions, then refer to
both of the following separate documents for more information:
Next steps
You may now set up printing and/or
scanning (depending on your model)
if you haven't already, or return to the index.