Setting up a Linux to access the Canon EOS 300D (kiss digital rebel)

The Canon EOS 300D is a digital SLR camera with a USB connection.

EOS 300D is also known as the digital rebel (USA) and the kiss digital (Japan).

The software that comes with the camera is geared towards MS and, reflecting its pro-sumer market, the MAC.

This document details the set-up I have got to work. In other words I have not tested any alternative methods.

Packages and configuration

The latest gphoto2 and hotplug packages are required and gphoto2 should be done first as it is required to finalise the configuration of hotplug.

  1. gphoto2/libgphoto2

    The Canon EOS 300D is supported by gphoto2 from 2.1.3 onwards, thus download the latest from gphoto org if required. Version 2.1.4 has bug fixes relating to the Canon and PTP dirvers. So it would be better to get at least version 2.1.4

    The latest packages are currently only available in source tarballs and so they will need compiling (Unless the distro's have since updated the packages).

    cd libgphoto2-2.1.4
    ./configure --with-drivers=ptp2,canon
    make
    su -c make install
    cd ..

    cd gphoto2-2.1.4
    ./configure
    make
    su -c make install
    cd ..

    N.b. for versions 1.2.3 and 2.1.4 I had to edit gphoto2/Makefile, adding -I/usr/local/include/gphoto2 to the AA_CFLAGS definition, in order to compile ghoto2.

    When compiling and installing the packages make sure that you are subsequently using the newly installed packages and not any previous installations. Simplest way to achieve this would be to remove any existing gphoto2 packages prior to starting.

  2. hotplug

    Having kernel 2.6.1 installed requires the latest linux-hotplug package which supports 2.6 kernels. Rpm packages should exist for this. E.g.: -

    rpm -Uvh hotplug-2004_01_05-1.noarch.rpm

    To complete the hotplug installation requires the creation of the permissions handling script /etc/hotplug/usbcam, and the configuration of the /etc/hotplug/usb.usermap file.

    • /etc/hotplug/usbcam

      This file will be run by the hotplug package on detection of usb connection events for devices defined in the usb.usermap file as requiring the usb module usbcam. It is run as root and is used to grant permisions to users requiring access to hotplugged USB devices.

      cp /usr/local/share/doc/libgphoto2/linux-hotplug/usbcam.group /etc/hotplug/usbcam
      chmod 755 /etc/hotplug/usbcam
      groupadd camera

      Then add your list of 'allowed' users to the camera group in the /etc/group file.


    • /etc/hotplug/usb.usermap

      The file contains the mappings of device id codes to the above usb module 'usbcam'. Thus it requires entries which map the 300D to the usbcam script. The print-usb-usermap utility from the libgphoto2 package prints, in usb.usermap format, the complete list of digital cameras it currently understands. So to create a tailored usb.usermap file: -

      /usr/local/lib/libgphoto2/print-usb-usermap > tmap
      egrep -e '(300D|Digital Rebel|Kiss Digital)' -a1 tmap >> /etc/hotplug/usb.usermap

      If, like me, you have access to more than one digital camera repeat the egrep step with the appropriate expressions for your cameras until all are defined. E.g. I also have acces to an HP photosmart 812: -

      egrep -e 'PhotoSmart 812' -a1 tmap >> /etc/hotplug/usb.usermap

      Don't forget to include the relevant drivers in the 'with-drivers' option of the libgphoto2 build.


    When hotplug is correctly configured, connecting the 300D, should result in an entry below /proc/bus/usb/ being group owned by camera.E.g.

    #ls -l /proc/bus/usb/002
    total 0 -rw-r--r-- 1 root root 43 2004-01-14 08:06 001 -rwxrw---- 1 root camera 43 2004-01-14 10:52 002

    Thus the 300D is currently detected and attached to /proc/bus/usb/002/002 with read-write group permissions to the group camera. /proc/bus/usb/002/002 is the 2nd usb port, device 2. Disconnecting and re-connecting the 300D will, invariably, increment the device number e.g /proc/bus/usb/002/003


  3. ptp/normal

    There seems to exist a firmware (upto and including version 1.1.1 from powershot) bug with the 300D which, when in the PTP communications mode, prevents the listing/downloading of pictures the camera holds. This applies to Windows XP aswell ! (I wasted so much time assuming this was a linux-usb, hotplug or gphoto2 problem ! That'll teach me !) The workarounds are either:

    • follow the suggestions described in the appropriate gphoto2 bug report ,
    • or
    • to use the 'Normal' mode of communication (See page 30 of the instruction manual).

Front-ends

Various front-ends to gphoto2 exist for those who do not like CLIs. The list below is not in the slightest complete, it is the ones I have to hand and confirmed that the basic functionality (connect, download) works.


Dean Darlison
Last modified: Thu Oct 21 13:19:39 BST 2004