Canon PowerShot SD20 with Linux

As of 4 Dec 2004

Below are initial results of trying out the remote capture capability of the Canon PowerShot SD20. Several different methods were attempted:


Using Mac OS X Image Capture API to Verify Capabilities

Because Mac OS X has a much more well-developed set of digital camera drivers (and an excellent Image Capture API, and frankly I trust it working more), the first experiments were with OS X.

On a Mac, after downloading the Image Capture API, plug the camera in, and run the 'CapabilitiesSample' sample application. There are two device capabilities displayed 'del1' and 'ccni', for "Delete one image" and "Capture new image". I believe these are the two PTP abilities exposed that aren't the same as a USB Mass Storage device. Click on 'ccni' and click 'Issue Command'. The camera will take a picture. Also check out the 'Tools/Camera Check' program that's part of the API.


Using gphoto2 : Canon proprietary mode

So with the knowledge that it's possible for a computer to trigger image captures on the SD20, can we do it on Linux?

Recently, the SD20 was added as a recognized camera to gphoto, but in the 'canon' driver and not the 'ptp2' driver. I think this means that it's using the Canon protocol and not PTP, at least that driver file doesn't seem to be doing PTP-like things when commanding the camera.

So after building and installing gphoto from CVS, let's see what we can do.

Summary of commands run


% sudo gphoto2 --list-cameras
% sudo gphoto2 --camera 'Canon PowerShot SD20 (normal mode)'  --abilities
% sudo gphoto2 --camera 'Canon PowerShot SD20 (normal mode)'  --summary
% sudo gphoto2 --camera 'Canon PowerShot SD20 (normal mode)'  --capture-image
% sudo gphoto2 --camera 'Canon PowerShot SD20 (normal mode)'  --list-files
% sudo gphoto2 --camera 'Canon PowerShot SD20 (normal mode)'  --get-all-files

Output of commands

(not all output shown yet)

% sudo gphoto2 --camera 'Canon PowerShot SD20 (normal mode)'  --abilities
Abilities for camera             : Canon PowerShot SD20 (normal mode)          
Serial port support              : no
USB support                      : yes
Capture choices                  :
                                 : Image
                                 : Preview
Configuration support            : yes
Delete files on camera support   : yes
File preview (thumbnail) support : yes
File upload support              : no

% sudo gphoto2 --camera 'Canon PowerShot SD20 (normal mode)'  --summary
Detected a 'Canon:PowerShot SD20 (normal mode)'.                               
Camera summary:

Camera identification:
  Model: Canon:PowerShot SD20 (normal mode)
  Owner: 

Power status: on battery (power bad)

Flash disk information:
  Drive D:
       30'352 bytes total
       26'400 bytes available

Time: 2004-12-04 11:32:09 (host time +0 seconds)


Using gphoto2 : PTP mode

If this works, it should just require a small patch to add the USB vendor/product ids to camlibs/ptp2/library.c, but with a couple potential gotchas:

[TBD, but the patch for gphoto is something like:]


% diff -cr library.c library.c.patched
*** library.c   Sat Dec  4 16:00:34 2004
--- library.c.patched   Sat Dec  4 16:01:07 2004
***************
*** 386,391 ****
--- 386,392 ----
        {"Canon:PowerShot S410 (PTP mode)",     0x04a9, 0x30ba},
        {"Canon:PowerShot A95 (PTP mode)",      0x04a9, 0x30bb},
        {"Canon:Digital IXUS 40 (PTP mode)",    0x04a9, 0x30bf},
+       {"Canon:PowerShot SD20 (PTP mode)",     0x04a9, 0x30c4},
        {"Canon:EOS 1D Mark II (PTP mode)",     0x04a9, 0x30ea},
        {"Canon:EOS 20D (PTP mode)",            0x04a9, 0x30ec},


Using ptpcam

First, get libptp2 from CVS, build and install it:

% cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/libptp login 
% cvs -z 3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/libptp co libptp2
% ./autogen
% ./configure --prefix=/usr/local
% make
% sudo make install

Now try out some commands:

% sudo ptpcam --list-devices

Listing devices...
bus/dev vendorID/prodID device model
001/007 0x04A9/0x30C4   Canon PowerShot SD20

%



Using ptpcanon

From http://jalkapallo.org/superkolik/canon.html