Simple, embedded USB host for digital camera control

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
Hello, World!

I want to remotely control a digital camera (Canon Powershot S60, and
maybe others) for use in aerial photography (with kites, blimps, etc.)


*SHORT STORY*
=============

Any suggestions of how I can do this via USB? Do you think it is
feasible with an Atmel AT90USB1287? Or would I need a AT43USB380, or
other? For me, the simpler the better...


*LONG STORY*
============

I can send radio commands to a controller connected to the camera and
trigger it (with a servo motor, IR emitter, USB host, ...) , but I also
want control over the camera settings. A USB host seems to be the best
solution, as:

- A single servo motor can be used for triggering, but not much else.
Several could be used to access other buttons, but this would be a
kludge (not to mention the added weight, which is a serious issue for
me).

- The camera's IR port is used only for a couple of functions (you
can't change settings like ISO, exposure, etc. this way). I could try
to implement IR access to more functions if I had a firmware to hack,
but AFAIK, there's no firmware dump available for neither this nor
several other Canon models...

- I could open the camera and wire connections to simulate the pressing
of all buttons on the camera body. It would probably work, but it's not
an elegant solution to say the least (and I don't want to void any
camera warranty if possible).

Another good points for a remote control via USB:

+ Canon have a PC remote control software via USB for the camera, and
it works great: you have total control over all camera settings.

+ I could sniff the USB data from that program, but the Canon USB
protocol was already reversed engineered and documented by the folks
who wrote a Linux driver for it.

I have some experience with electronics, but I'm really a programmer (C
/ assembly on several platforms). I'm already reading the USB specs and
some Atmel datasheets, but I'd love to read the opinions of someone who
already underwent a similar project.

Thank you!


Re: Simple, embedded USB host for digital camera control
Quoted text here. Click to load it

I'm actually considering doing the exact same thing (for the exact same
purpose !).

I've looked at the AT90USB1287 and it seems like it would do the job.
The Atmel USBKey evaluation circuit is only $30 so I bought one in the
hopes of finding the time to experiment with this part.  The most
daunting aspect is the implementation of the proprietary Canon USB
protocol (even though most of the hard work has already been done by the
Linux driver guys).

Scott

Re: Simple, embedded USB host for digital camera control

Quoted text here. Click to load it

I assume you will not be too upset if you lose this camera in a hard
landing, or that you need the resolution or other capability that a $20
digital (or even several of them with different focal lengths to
replace the zoom function) wouldn't give you in a lower mass.
 
 
Quoted text here. Click to load it

Apparently, being a USB host is a lot harder than being a client (or
whatever terminology is used in the USB world).  And the
microcontrollers are host only.  

(I could be wrong about this.)

Quoted text here. Click to load it

A servo pushing the button is probably harder than wiring a remotely
operated switch to the trigger release, given that you're a programmer.
(Who stereotypically would merely destroy anything he tried to modify
electronically, but would cause himself gross bodily harm trying to do
anything mechanical.)

--
David M. Palmer   snipped-for-privacy@email.com (formerly @clark.net, @ematic.com)

Re: Simple, embedded USB host for digital camera control
Quoted text here. Click to load it

The terminology is host/device which is essentially master/slave,
as the host/master is responsible for directing the communication
over the bus.

A USB host software stack is non-trivial, but I have heard of
others doing a minimal implementation that may work for static
one-host-one-device systems. If you are so inclined, usb.org
is your friend for documentation.


--
Michael N. Moran           (h) 770 516 7918
5009 Old Field Ct.         (c) 678 521 5460
We've slightly trimmed the long signature. Click to see the full one.
Re: Simple, embedded USB host for digital camera control
Quoted text here. Click to load it

I'm someone that has created his own minimal USB host stack, in this case
for a UHCI controller.

In my case, it's a one host to multiple device setup, but because the
exact devices are known, I was able to use a static configuration table
for the USB network.

However, it's still quite a bit of work to write even a minimal USB host
stack and I would not recommend it unless the person attempting this is
very familiar with system/kernel level programming concepts.

I had a quick look at the AT90USB64/128 datasheet and it appears that things
have been simplified in this controller, but it appears there's still quite
a bit of the housekeeping to do that you would have to do in a stack for a
more general purpose controller. Does Atmel provide a sample USB host stack
for it's microcontrollers ?

BTW, I briefly considered porting the Linux or FreeBSD USB stacks, but
decided that it was just as easy to write my own minimal stack (and as it
was part of a embedded hobbyist project, much more fun. :-) )

Before buying hardware, the OP (if he has not done it already) should read
through his intended USB host controller datasheets, the usb.org documents
and the datasheets for his intended USB device(s) in order to get an idea
of how much work is involved.

Simon.

PS: And before anyone asks, no, my code is not available. :-)

--
Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
If Google's motto is "don't be evil", then how did we get Google Groups 2 ?

Re: Simple, embedded USB host for digital camera control
Hi, Simon!

Quoted text here. Click to load it

I need to control just one exact device, so there's even (a bit) less
work.

Quoted text here. Click to load it

Some software is available for the AT90USBKey demonstration board on
Atmel's site, but I'm still waiting for a reply from them to be able to
check the sources (they are on ZIP archives with passwords).

Quoted text here. Click to load it

That's where I am right now.

Quoted text here. Click to load it

Ouch! :-(

Not even with a pretty pretty please, with lots of sugar on top? I can
change the sugar for Xylitol, if you want...


Re: Simple, embedded USB host for digital camera control
Quoted text here. Click to load it

Hello.


I'm sorry, but although the code works just fine, the documentation (and
to a lesser extent, the code) would need a significant cleanup before it
would be something that I would be comfortable releasing. The code is also
tied closely to the UHCI controller specification and my requirements. Don't
forget that this was a hobbyist project, not something intended for public
release.

There's also the fact that you would need to learn the USB 1.1 specifications
to understand the code anyway, at which point you are probably better off
looking at something like the FreeBSD USB code base to resolve any remaining
questions.

If you don't have access to a FreeBSD system, then the FreeBSD source code
is available in cvsweb format at the FreeBSD website. I suggest that you
start at http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/dev/usb/ if you are
interested in looking at it.

Simon.

--
Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
If Google's motto is "don't be evil", then how did we get Google Groups 2 ?

Re: Simple, embedded USB host for digital camera control
Quoted text here. Click to load it

Yes.
The AT43USB380 will be simpler to use though, since the complete host stack
is running
on chip, and it presents a high level API to the micro.
Basically, no need to know anything about USB.

Quoted text here. Click to load it

The U-boot boot monitor has a USB stack which can access USB Mass Storage
devices.

Quoted text here. Click to load it



--
Best Regards,
Ulf Samuelsson
We've slightly trimmed the long signature. Click to see the full one.
Re: Simple, embedded USB host for digital camera control
Hello, Ulf!

Quoted text here. Click to load it


But is this true for the AT90USB family? I couldn't find any USB host
stack sample on Atmel's web site (I only found sample sources for USB
devices)...

Is such stack available upon request?

Quoted text here. Click to load it

OTOH, the AT90USBKey is much more affordable than the AT43DK380 dev.
kit... ;-)  And the AT43USB380 seems to be a bit overkill for my
application.


Re: Simple, embedded USB host for digital camera control
Hi, David!

Quoted text here. Click to load it

Actually, I want to usa a Canon camera (hardly $20), and I would be
very upset if I loose it! I already did several KAP sessions and got
several hundreds of pictures in total, with about a hundred of
excellent or very good ones.

Quoted text here. Click to load it

The implementation of a USB host is more complex than the
implementation of a USB device (aka USB function), but the Atmel
AT90USB1287 is a "USB On-The-Go (OTG) Microcontroller".


Re: Simple, embedded USB host for digital camera control

Quoted text here. Click to load it
I did something like that with a cheap pencam usb camera. But the USB
stuff is overkill. I simply opened the camera and made an external
connection to the camera buttons.
My setup simply used a micro to "press the buttons" every 30 or 60
seconds. After bringing the kite down I transfer the images to a
laptop over USB.

There are older type digital cameras that also have a serial interface
(option), but these tend to be on the heavy side to get them airborne
when there is not a lot of wind.

Joop

Re: Simple, embedded USB host for digital camera control
Hi Joop!

Quoted text here. Click to load it

At first, I was also planning to do the same, but I want good quality
images and resolution, using a good compact camera (or even a SLR). And
I really don't want to void warranty nor deface a good looking,
expensive camera. ;-)

[]s!


Re: Simple, embedded USB host for digital camera control

Quoted text here. Click to load it
The other thing you can do is use the Canon remote control. A quick
search shows it can be had for $30. You could rig the buttons on this
remote. Then your camera is still in one piece.

Re: Simple, embedded USB host for digital camera control

Quoted text here. Click to load it

It was my first idea, but the remote control is very limited. As I
stated previously, I don't want just a triggering system. With Canon's
remote control you can't change shooting parameters as I want to (on
some camera/remote models you can't even control the zoom)...

[]s!


Site Timeline