Photo-card access details and troubleshooting

This file provides more detailed information about setting up photo-card access with the hpoj software, including possible troubleshooting steps in case something goes wrong.

Additional information may be found in the separate document pertaining to ptal-photod.

Question: What is the significance of the the X-Windows-style "display numbers" specified in /etc/mtools.conf or ~/.mtoolsrc?

The original intention behind mtools's "remote" feature was that you could run floppyd (the floppy-disk-drive daemon) on your local system, log into a remote system, set your DISPLAY back to your local system for purposes of running remote X-Windows applications, and use mtools commands on the remote system to access the floppy drive (for example) on your local system. Typically you would be using a single drive in this manner and using display number ":0" on your local system. For security purposes, the remote mtools instance would look for X authentication information for the display name/number corresponding to the remote drive letter, and pass that back to the local floppyd instance, which would validate it before granting remote access to the drive.

The hpoj ptal-photod-based photo-card access method stretches somewhat this floppyd concept. In this case, the user is presumed to be logged into the same local system on which ptal-photod is running, and it's possible to have more than one photo-card-capable device. As a result, the "display name/number" specified in /etc/mtools.conf or ~/.mtoolsrc doesn't necessarily have anything to do with that of the X server or the DISPLAY environment variable, but is merely used to connect a particular mtools drive letter to a particular instance of ptal-photod. However, due to the mtools historical bias towards the original X-Windows-based floppyd concept, the mtools client utilities still expect to find something that looks like an X authentication token for the drive letter's "display name/number", even though ptal-photod makes no use of it.

Problem: I got an "authentication failed" error message.

If an mtools command gives an error message such as:
	Permission denied, authentication failed!
	Auth failed: X-Cookie doesn't match!
	Can't open :2: No such file or directory
	Cannot initialize 'R:'
then try running the following command:
	xauth add :2 . 00
Substitute for ":2" the display name/number specified in /etc/mtools.conf or ~/.mtoolsrc which is being complained about.

Caution: Don't do this otherwise (i.e. on an display name/number on which you have an active X session), or you may break your X session.

Although mtools requires an xauth token in order to connect to ptal-photod, ptal-photod ignores any authentication information passed to it. Therefore, it's not actually necessary to be running X Windows on the specified display name/number, or even at all, as long as mtools can find an xauth token (valid or not) for the specified display name/number in the user's .Xauthority file.

Problem: I can't access the photo-card readers on the OfficeJet D series through an LIO JetDirect.

ptal-photod doesn't work with the OfficeJet D series via an LIO JetDirect connection. This is a limitation in the device, not ptal-photod or the LIO JetDirect. Use a parallel or USB connection instead, which can be connected either directly to your computer or to an hpoj-supported external JetDirect print server. Note that with the OfficeJet D series, you can still otherwise use your LIO JetDirect even if you're also using the USB port.

Question: How can I make ptal-photod accessible to other computers on the network?

Add the ptal-photod -bindto or -bindtoall switch to the "init.photod.append+=" line in the device configuration file in /usr/local/etc/ptal, but make sure you have an appropriate firewall set up to prevent access by untrusted clients. Then change /etc/mtools.conf or ~/.mtoolsrc to use something like file="other.machine.com:0" and try it out (this hasn't been tested as of the time of this writing).

Question: Do I really need to set "mtools_skip_check=1"?

The "mtools_skip_check=1" line is needed for photo cards formatted with certain digital cameras and relaxes some of mtools's sanity checks on the photo-card's file system. It's safe to remove it if it turns out you don't need it for your photo card(s).

Question: How do I format a brand-new photo card so mtools can access it?

It is recommended to format it using your digital camera if possible.

There is an mformat command which might work, but this has not been tested, so proceed with caution. If you do try it, then let us know on the hpoj-devel mailing list if it worked or not.

Question: I want to copy files from one type of photo card to another. Can I insert both cards and do a direct copy?

No. Even though your device may have multiple slots for different card types, only one card may be inserted and accessed at a time.

If you want to copy files from one card to another, then you can copy them to your hard disk as an intermediate step. Alternatively, if you have more than one hpoj-supported device with card readers, then each one can have its own mtools drive letter, and you can copy from one drive letter directly to another using a single mcopy command.

Problem: I inserted a photo card, and the device asked me if I wanted to save photos to my PC. I selected "Yes", but nothing happened.

This method of saving photos to your PC is not currently supported by the hpoj software. Use the mtools commands instead.

Question: Can I use gPhoto with hpoj?

Currently no.

Question: Why can't I just mount the photo card as a file system and use standard Unix file-manipulation commands?

That would require writing a non-portable kernel-mode block-device driver, which would be complicated by the fact that it would have to access a user-mode I/O protocol stack (libptal, ptal-mlcd, etc.).

There is also FUSD (Framework for User-Space Devices). Currently it only supports proxying of character devices. Once FUSD is able to proxy block devices, it may be possible to add FUSD support to ptal-photod and allow photo cards to be mounted as a file system.

It might be possibile to develop a kernel-mode block-device driver that implements the mtools "floppyd" client network protocol to talk to ptal-photod, assuming it's possible to use TCP/IP client sockets from kernel space.

Question: If usbview indicates my device provides a USB mass-storage interface, can I then mount it as a file system?

Yes, but you may need to upgrade to the latest stable kernel version if you have problems with this functionality on an older kernel version.

See the hpoj Supported devices page for information on which models provide this functionality. If usbview or /proc/bus/usb/devices indicates that your device has a non-print interface with a class/subclass/protocol ID of 08/06/50, or you see kernel log messages about USB mass-storage support when powering on or connecting the device, then you can probably take advantage of this feature as an alternative to the mtools-based photo-card access solution normally used with hpoj-supported devices.

Follow this procedure as root to set this up (this should actually work on any USB mass-storage device):

  1. Create a "mount point" for the file system (for example, "/photos"):
    	mkdir /photos
    

  2. Make sure the "usb-storage" kernel module is loaded:
    	/sbin/lsmod
    	/sbin/modprobe usb-storage	# If it's not already loaded
    

  3. Check the syslog file (probably /var/log/messages) or /proc/scsi/scsi to find out what SCSI device number is mapped to the USB mass storage interface. It's probably scsi0 if there are no other SCSI or USB mass-storage devices in the system.

  4. Insert the photo card if it isn't already inserted.

  5. Mount the file system:
    	mount -t vfat /dev/sda1 /photos
    
    If your card reader was mapped to a number other than scsi0, then substitute for "sda" above the appropriate device (sdb for scsi1, sdc for scsi2, etc.). Also, specify the actual mount point you created if it's not "/photos".

    If the mount command fails, then try it again several more times (at least twice).

  6. You can now use /photos as you would any other mounted file system:
    	cd /photos
    	ls
    

  7. Important: Before removing the photo card or disconnecting or powering off the device, cd out of the /photos file system and unmount the file system:
    	cd
    	umount /photos
    

  8. 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.

Question: Are HP PhotoSmart cameras supported using ptal-photod?

No. Some PhotoSmart cameras work using a standard USB mass-storage interface, where you can mount the photo card as a file system (see the previous question for information on how to set this up). Others work using gPhoto, using a PTP (Picture Transfer Protocol) or other backend driver. Others may not work with Linux at all.

Next steps

Use the Back button on your browser to return to the previous document, or click here to return to the index.