Jump to content
Sign in to follow this  
corosplat

controlling camera through USB

Recommended Posts

Hi,

at the risk of exposing my ignorance, I want to throw an idea out for discussion:

I have been thinking a lot about the possibility of controlling a camera through the USB port with a pic-chip or similar remote switch to avoid opening it up and soldering to the switch traces. I lurked a bit on the USB developers forum but notice that whenever anyone asks a question like this, they get ridiculed for their lack of understanding of USB and taken out back and flogged with the 300-page USB protocol manual :huh: .

OK so now I understand that the USB spec does not allow for devices to talk to eachother directly, there must be a host on the bus to manage the data flow. The protocol stack is way too heavy to implement on a simple microcontroller, and the physical layer must be handled in hardware.

But I still wonder how hard can it be to trick a camera into *thinking* it is connected to a host computer and send it the command blocks to do simple things like trigger the shutter? I'm not talking about a USB compliant plug-and-play thing... this is a pure hack to control the camera. Maybe you could use a USB-enabled PIC chip to handle the physical layer with all its timing complexities. You can probably even discard most of the data that the camera sends back.

Some smart guys with USB-sniffers and a lot of time have already figured out the command sequences for canon cameras here: http://www.graphics.cornell.edu/~westin/ca...anon/index.html

and the Gphoto project has more than 400 cameras listed http://www.gphoto.org/

the challenge would be to get the camera to think it is talking to a host computer and send the command blocks in the right way. I am not sure if there is some fundamental reason why this wouldn't be possible. Is there a difference between a host-side and device USB controller for example.

any thoughts?

cheers,

Share this post


Link to post
Share on other sites
I understand that the USB spec does not allow for devices to talk to each other directly...

That is changing. The new OTG protocol, available on the latest portable gadgets, allows for that. But it is still a serious challenge to implement this enhanced protocol.

But I still wonder how hard can it be to trick a camera into *thinking* it is connected to a host computer and send it the command blocks to do simple things like trigger the shutter?

I tried to find a way to capitalize on that angle too. The issue is that *if* the USB product is truly observing the USB spec, then the host's interface hardware and software hardships do not go away. USB is not your Father's RS-232. ;)

You can probably even discard most of the data that the camera sends back.

I agree. But there are many responses that your pseudo-host will need to acknowledge in an intelligent way (timing critical). So, a fully dumbed down interface is not really possible.

You are where I was a couple years ago. I figured that there might be a way to trick a low end camera into operation from a simple unidirectional USB host interface. I figured a 40Mhz PIC could scream out the bit patterns and I could just ignore the device's responses.

After some serious review of the USB 1.x spec, I decided that if it worked it would only be because the camera designers totally violated the USB specs. Anything is possible, but finding a possible dumbed-down solution would have been like winning the state lottery. I am not saying that what you want to do is impossible. But, I can say the probability of success looks grim.

I HIGHLY recommend that you buy Jan Axelson's USB book. It is commonly believed that the USB spec was written by aliens with an attitude. Jan brings the entire subject down to our earthly level. Once you read up on what is necessary, you might see why the newsgroupies razz such ideas.

But, keep on trying -- where there is a will there is a way! Especially since I suspect that a integrated PIC or Atmel USB Host enabled micro might show up one day. Again, anything is possible.

Share this post


Link to post
Share on other sites

Thanks, there are some host controller chips for embedded systems listed here http://www.lvr.com/usb.htm#HostSoftware with the full protocol stacks implemented, but that solution seems a bit overkill for a simple camera controller.

I agree, a fake host probably has a low chance of success, and it would be difficult to debug such a project.

I'm sure things will get better when this USB on-the-go protocol gets going. You could make quite a handy little gadget for controlling all sorts of camera functions. I'll keep it in the back of my mind and watch for developments.

cheers

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×