Background

I've been running a webcam for the last couple years looking out into the parking lot in front of my apartment. It's served pretty well but it was a low resolution NTSC camera connected to a Brooktree 848 capture card. I began a search for a high resolution USB webcam. Unfortunately there is a great disconnect between what webcam marketing thinks is high resolution and what I think high resolution is. I was looking for something around 4 megapixels (and at least 3 megapixels). Froogling for high resolution webcam leads to a bunch of crappy 640x480 USB webcams (640x480 was high resolution last century).

gPhoto 2 to the rescue. Besides being able to just download images, gPhoto 2 also has the capability to remote control certain types of cameras. I found a person who had a Canon PowerShot S410 with a broken LCD, they couldn't use it and I didn't need the LCD as gPhoto handled the whole interface. The Canon supports two types of connection protocols, their proprietary one that is referred to just as "Normal Mode" by gPhoto 2 and "PTP2 mode" which is a standardized protocol. In addition, the remote control functionality is only available in PTP mode.

Equipment

  • $40 - Canon PowerShot S410 (Digital Elph)
  • 99¢ - Canon ACK500 AC Adapter

If you are budget conscious, I highly recommend just asking around and seeing if your friends have an old Canon/Nikon/Olympus and seeing if it is a model that supports remote capture. Most AC adapters don't come with the camera so I recommend eBay. I bought mine from eBay for 99¢ + $7 shipping (as opposed to buying it new from Canon for $75 + $10 shipping).

Software: gPhoto 2

I only have the Canon and a slow 200 MHz Pentium so I removed all the shared library drivers from /usr/local/lib/libgphoto2/2.4.5 except for the Canon and PTP2 drivers (the remote control functionality is through the PTP2 drivers though). This greatly speeds up the startup of gPhoto 2.

Put the camera in playback mode and check dmesg to ensure the camera is detected. This is the message from an OpenBSD 4.5 box:

ugen0 at uhub1 port 2 "Canon Inc. Canon Digital Camera" rev 1.10/0.01 addr 2

Then check to see if gPhoto can detect the camera.

-bash-3.2$ gphoto2 --auto-detect 
Model                          Port                                            
----------------------------------------------------------
Canon Digital IXUS 430 (normal mode) usb:

You'll need to work fairly quickly as the camera, even when powered from the external AC power supply the camera will fall into power save mode (there may be a way to disable or increase the timeout in the camera's preferences, but I've no way to know as the LCD is dead).

bash-3.2# gphoto2 --camera "Canon Digital IXUS 430 (PTP mode)" --port usb: --set-config capture=on 
 value on, t 1

That should instruct the camera to extract the lens and will allow you to list the configuration (Canon's are a bit unusual that they don't seem to allow you to list the configuration without first extracting the lens). In addition, the camera will no longer fall into power save mode.

Taking Time Lapse Pictures (Finally!)

This following command will take pictures every thirty seconds until you instruct it otherwise. The pictures are downloaded immediately to the computer and not saved to the camera.

gphoto2 --camera "Canon Digital IXUS 430 (PTP mode)" --port usb: -F 0 -I 30 --capture-image --get-all-files --filename "%f.jpg"

Setting up as a webcam

TBD...