My daughter was born in early 2007. Around that time, my wife and I shopped and decided on a Canon A640. At 10 megapixels, 4x zoom and articulating lcd viewing screen, it’s been an amazing camera for everything we’ve needed. So when I wanted to try my hand at some time lapse photography, I thought I’d give the A640 a try.
Unfortunately, the A640, and most other point-and-shoot cameras I’ve seen, don’t include any controls which allow you to set up timed or scheduled shutter releases. Canon, however, does include software with the camera which allows you to release the shutter at a set interval. Being the fan of Linux that I am, I hunted around a little and found that some nice folks have written some wonderful open-source software for controlling a whole host of different cameras. “gphoto2″ allows remotely capturing from the camera and many other functions, as long as they are written into the camera’s SDK.
A project sprung up at work where I thought this might be useful. A building project was just beginning and I sold my employer on setting up the camera for time lapse for some later marketing material. Using an older PC, I installed Fedora 10 and installed the latest release of gphoto2 and the necessary requisite files. Then I wrote a small perl script for capturing from the camera every half hour during the workday.
It’s still pretty rough but here it is if you’re interested…
#!/usr/bin/perl -w
#
# Program to capture an image from the camera and save it to local drive
# then upload it to specified folder on web/ftp server
# written by Paul Cushing
# pcushing@gmail.com
use Net::FTP;
use POSIX qw/strftime/;
########################################################################
# Set variable here for script use
$ftp_server = "ftp.myserver.com";
$ftp_username = "joesixpack";
$ftp_password = "********";
$archive_dir = "htdocs/lapsephotos";
$htmllogfile = "lapselog.html";
$local_dir = "./";
########################################################################
########################################################################
# Capture image from attached camera using gphoto2 and store it to
# local image archive, naming it using the date/time
$photoname = strftime('%Y%m%d%H%M',localtime); # create name from date
$photofile = "$photoname.jpg"; # add jpg extension
# use gphoto2 to grab image from camera
system("gphoto2 --capture-image-and-download --filename \"$photofile\"");
########################################################################
########################################################################
# Upload photo to server via FTP
$ftp = Net::FTP->new("$ftp_server", Debug => 1)
or die "Cannot connect to hostname: $@";
$ftp->login("$ftp_username", "$ftp_password")
or die "Cannot login ", $ftp->message;
$ftp->cwd("$archive_dir")
or die "Cannot change working directory ", $ftp->message;
$ftp->binary();
$ftp->put("$photofile")
or die "Cannot upload $photofile", $ftp->message;
$ftp->quit();
########################################################################
The one problem I did run into, should you try something with a similar setup, is the usb automount in KDE. When I insert the usb in the PC and turn on the camera, it initiates the automount for the camera which doesn’t allow the script to access the camera. The solution was just to unmount the camera using the desktop icon before running the scripts.
I would have liked to pick up another A640 for the project but they seem to no longer be available. Looking through Canon’s SDK listings, I found another camera that seemed to fit the bill. The SX110IS is a 9 megapixel with a great 10x zoom lens and a beautiful three inch LCD screen. The camera works with the script perfectly and the picture quality is great.
Unfortunately, that project has fallen through, but I’m sure we’ll use the setup on another project soon. In the mean time, I love this camera for taking little shots here and there. The 10x zoom is especially nice. My recent photos posted, the spider, and the cloud pictures were taken with the SX110IS.