Science Daily: Uranus
- NASA's Hubble, New Horizons team up for a simultaneous look at Uranus October 11, 2024
- Key to rapid planet formation August 1, 2024
Well, in the past couple of days I got both a pleasant surprise and a bit of a let-down.
First, I discovered that sometime in the past year or two, the gphoto2 folks have been very busy with Canon DSLRs. They’re reasonably well supported (in spite of what appears to be a lack of any real support from Canon; it looks like they’ve been busy reverse engineering the USB commands). I can connect to my Canon Digital Rebel XT (aka 350D) and change its configuration settings. I can download images from the camera (well, okay, I could do that before via the mass storage interface, but now it works as a camera not a USB drive).
I also discovered it was pretty trivial to get my serial port cable to control two cameras independently with a little Perl:
#!/usr/bin/perl
=head1 NAME - cable-release.pl
Use a serial port to control the Canon EOS cable release.
=head1 SYNOPSIS
canon-release.pl [--port=DEVICE] [--expose=SECONDS]
[--verbose|-v] [--quiet|-q] [--version|-V] [--help|-h]
=head1 DESCRIPTION
Some Canon EOS DSLRs use a cable release separate from the USB camera
control. Among these are the Canon 300D and 350D. Instruction may be
found on the internet for making these.
=cut
use Device::SerialPort;
use Getopt::Long qw(:config bundling noignore_case);
use Pod::Usage;
use constant DEF_MIRROR_LOCK => 2;
=head1 OPTIONS
=over 4
=item --port=DEVICE
Name of serial device for cable release. Defaults to /dev/ttyS0.
=item --mirror-lock[=SECONDS]
Assume mirror lock is enabled in camera. If specified, delay of
SECONDS will be allowed for mirror settling. Minimum delay is 2
seconds.
=item --expose=SECONDS
Expose for SECONDS. Default is 1 second.
=item --version
Print version information and exit.
=item --verbose
Increase verbosity (placeholder).
=item --quiet
Decrease verbosity (placeholder).
=item --help
Display documentation and exit.
=back
=cut
my $VERSION = 0.1;
my %opt;
$opt{port} = '/dev/ttyS0';
$opt{expose} = 1;
GetOptions('port=s' => \$opt{port},
'mirror-lock:i' => sub { $opt{mirror} = DEF_MIRROR_LOCK
if ($opt{mirror} <= DEF_MIRROR_LOCK); },
'expose=i' => \$opt{expose},
'version|V' => sub { print(&basename($0), " version $VERSION\n");
exit 0; },
'verbose|v' => sub { $opt{verbose}++; },
'quiet|q' => sub { $opt{verbose}--; },
'help|h' => sub { pod2usage(-exitstatus => 0, -verbose => 3); },
) or &pod2usage(-verbose => 0, -exitstatus => 1);
# Minimum mirror lock is really 2-seconds. Maybe less will work if I
# use usleep from Time::HiRes, but is is at least tens of
# milliseconds.
if (exists($opt{mirror})) {
$opt{mirror} = DEF_MIRROR_LOCK if (!$opt{mirror});
if ($opt{mirror} < 2) {
$opt{mirror} = 2;
}
}
my $port = new Device::SerialPort($opt{port}, $quiet)
or die("can't open $port: $!");
$port->rts_active(F);
$port->rts_active(T);
if ($opt{mirror}) {
sleep($opt{mirror}-1);
$port->rts_active(F);
sleep(1);
$port->rts_active(T);
}
sleep($opt{expose});
$port->rts_active(F);
I’ve got the home-made cables connected to a Keyspan 4-port USB-to-serial box which works just fine.
Alas, I’ve discovered two small issues that make this a less than perfect world. First, gphoto –capture-image always gives an error. The capture works just fine, but the error still happens. Since I would be using the cable release, that’s not really a big deal. But second, you can’t talk to two cameras simultaneously attached to the computer, even if they are different USB busses. The commands from gphoto2 always seem to go to the camera most recently attached. If you detach it, then they go back to the first (and only) camera. This is a showstopper for completely automated control of multiple cameras.
In the good news category, this is at least no worse than using Canon’s EOS Capture utility since it can only control one camera at a time, also.
Written by Roland Roberts
Search
.Archives
- October 2024 (1)
- May 2024 (2)
- April 2024 (3)
- September 2022 (5)
- April 2022 (1)
- January 2022 (3)
- December 2021 (4)
- September 2021 (3)
- July 2021 (1)
- January 2021 (1)
- November 2020 (2)
- October 2020 (2)
- September 2020 (2)
- August 2020 (5)
- July 2020 (1)
- November 2019 (2)
- September 2019 (1)
- August 2019 (2)
- September 2017 (1)
- August 2017 (1)
- September 2015 (3)
- August 2015 (2)
- June 2015 (5)
- May 2015 (3)
- May 2013 (2)
- January 2013 (1)
- December 2012 (2)
- September 2012 (1)
- June 2012 (1)
- May 2012 (1)
- October 2011 (2)
- September 2011 (2)
- April 2011 (2)
- March 2011 (10)
- January 2011 (8)
- November 2010 (2)
- October 2010 (1)
- September 2010 (3)
- August 2010 (2)
- July 2010 (1)
- June 2010 (1)
- April 2010 (3)
- February 2010 (3)
- January 2010 (3)
- December 2009 (6)
- November 2009 (3)
- October 2009 (7)
- September 2009 (8)
- August 2009 (4)
- July 2009 (1)
- June 2009 (2)
- May 2009 (2)
- April 2009 (7)
- March 2009 (1)
- February 2009 (6)
- January 2009 (4)
- December 2008 (4)
- November 2008 (3)
- October 2008 (11)
- September 2008 (4)
- August 2008 (5)
- July 2008 (5)
- June 2008 (2)
- April 2008 (4)
- March 2008 (18)
- February 2008 (9)
- November 2007 (1)
- October 2007 (3)
- July 2007 (3)
- April 2007 (1)
- March 2007 (6)
- February 2007 (3)
- December 2006 (3)
- October 2006 (4)
- September 2006 (1)
- July 2006 (5)
- May 2006 (10)
- April 2006 (9)