Gphoto, Canon PowerShot cameras & USB

This page is an attempt to summarize what is needed to access Canon PowerShot digital still cameras via the USB interface.

Please note that this is what worked for me with a PowerShot S20 on SuSE 6.4 with the 2.2.16 kernel, other cameras and/or systems may or may not work. However I hope that it will provide a useful starting point.

Most of the software listed here is included in recent distributions, so things are a lot simpler than they were when I first wrote this page.

Why

What do you need

Steps

Most of these steps should no-longer be needed on a modern distribution as all of the software you need should be packaged for you so you just need to install it, and configure it. So unless you are using a really old distribution skip to the notes on Using it

Kernel

This description assumes that you have built and installed a custom kernel before, if you haven't then you should consult the documentation for your distribution and ensure you are comfortable with what you are doing before attempting to do things with experimental code. It is also specific to the older 2.2 kernels; late 2.2 kernels and 2.4 kernels do not need patching, and distributions based on these generally enable all the stuff you need by default.

If you are using a 2.2 series kernel you will need to apply the usb patch (save the current kernel source tree first):

      cd /usr/src/linux
      gunzip -c
      ../usb-2.4.0-test2-pre2-for-2.2.16-v3.diff.gz | patch -p1
            
When configuring (use make menuconfig or make xconfig unless you are really fond of fiddling with kernel configurations manually) select USB support and usbdevfs support (I also have usb-serial support enabled but I don't think it's actually needed). You will probably need to enable "Prompt for experimental drivers" in the configuration in order to get at the USB options.

Build and install the kernel.

Add the following line to your /etc/fstab:

      none            /proc/bus/usb   usbdevfs defaults       0       0
    

then reboot or run (as root) the command:

    mount -t usbdevfs   /proc/bus/usb
    
Now you should have a directory /proc/bus/usb/001 which will contain a file called 001, when you connect the camera via its USB cable you should then see 002 appear in the directory. (This of course assumes that you have only one USB bus and no other USB devices connected).

libusb

The current version is 0.1.5, if your distribution doesn't have it, you can get it from libusb.sourceforge.net.

gphoto2

Is now released and packaged. If not, get it from www.gphoto.org.

gtKam

If you don't have a pre-built package available, it is obtainable from the gphoto site.

Using it

OK so far so good, you got a nice shiny new suite of software sitting on your PC, what do you do with it?

Firstly, connect the camera to a USB socket in your PC, and switch it to "talk to PC" mode. I know that seems obvious but if you been experimenting with the interface and have both cables emerging from the computer, it's very easy to be plugged into the wrong one and wonder why nothing works.

To verify that everything is installed correctly try:

gphoto2 --list-cameras
you should then see something like:
       Number of supported cameras: 8
       Supported cameras:
        "Canon Digital IXUS"
        "Canon PowerShot A5"
        "Canon PowerShot A5 Zoom"
        "Canon PowerShot A50"
        "Canon PowerShot Pro70"
        "Canon PowerShot S10"
        "Canon PowerShot S100"
        "Canon PowerShot S20"
      
If you are using a pre-compiled version from your distribution you'll see loads of others as well and
gphoto2 --list-ports
which should produce:
      Devices found: 5
      Path                             Description
      --------------------------------------------------------------
      /dev/ttyS0                       Serial Port 0
      /dev/ttyS1                       Serial Port 1
      /dev/ttyS2                       Serial Port 2
      /dev/ttyS3                       Serial Port 3
      usb                              Universal Serial Bus
      
If you want to access the camera as a normal user, you will need to make the device world-writable by doing:
      su -c 'chmod a+w /proc/bus/usb/001/002'
      
assuming that the camera turned up as device 2. This can be done automatically using the hotplug package. Since the documentation for setting up hotplug for user-space devices is far from clear, here are some quick notes.

You can now try other gphoto2 commands (the --help option lists the available commands).

If you built the gtk interface, then that can be accessed via the gtkam command. When it starts up you will need to select a camera via the camera->select camera menu. Choose the appropriate model and select USB interface. If you are using the gimp plugin, it shows up under the "Acquire" menu from the main gimp control panel.

ENJOY.


This page last modified Sun Aug 25 13:44:51 BST 2002 by James Tappin