Main Site Documentation

USB PTP Protocol Driver


#1

I’m going to buy a FEZ Domino ('m a Software Engineer working with C# for 8yrs and WPF for 3yrs) with the plan of building a number of projects, primarily though a timelapse rig. I have pro nikon cameras that i want to control over USB to set exposure and fire.

In the GIH forum there is an archived post which says they have implemented PTP on some of their other products however i couldn’t find any info on whether it was implemented on the USBizi or not.

I’ve been searching the net to find some code or even just a technical document that implements PTP for controlling a camera but am having a few troubles finding something. I’ve found a few Arduino projects that do it with a USB host controller however haven’t found their source code.


#2

I’m interested in this as well from the Canon side of the “great divide.” :slight_smile:

The stock answer to writing USB drivers in general, and PTP in particular is “it’s hard.” I’ve been working through the USB stuff in my (extremely limited) spare time, and haven’t really gotten anywhere beyond a limited FEZ version of the Windows USBView utility (which I plan on posting if/when I get it cleaned up).

Have you seen this?

http://www.circuitsathome.com/mcu/programming/digital-camera-control-using-arduino-usb-host-shield-part-1-basics

Their source code is on github here:

http://github.com/felis/Arduino_Camera_Control

I’ve got an Arduino and a USB host shield, and it sort of works (not very robustly, but that might be an issue with my physical components). I switched to the Domino for the integrated USB host, but as I mentioned, haven’t gotten too far.

I’ve seen that GHI forum post as well, and would love to see that source…


#3

We have implemented PTP in the past but after finishing PTP and starting to test some cameras, we realized that all cameras we tested use vendor specific commands. What does this mean? It means that even if we have PTP, which is very complicated by the way, you will still not be able to control the camera the way you have in mind, simply because the makers are selecting to use vendor specific commands instead of built in commands!

So, after all the hard work we did to implement PTP, we decided to drop it.

Now, we provide you with USB host raw access so you can easily implement PTP. I say easily because the extreme hard work is in the low level USB Host but PTP itself still need at least a month of work to get it all right. This is also assumes you are very familiar with the internals of USB.

As for us, we are currently too busy to consider PTP and we we had the time then we would work on video class instead…everyone will love the idea of adding $15 webcam to FEZ :slight_smile:

Maybe the easiest way is to contacts the guys who wrote the drivers in the link above and see if they would port the code to C#? I am sure i can get them a free FEZ if they are interested :wink:


#4

Dave, i used to be a Canon shooter, but when looking for a new camera sold everything and switched to the clearly superior Nikon (hahaha). It was better for my requirements but in general i’m brand agnostic. I’d like to get a 5dII just for the video (too high noise for my still needs).

I’ve written a number of windows USB drivers before so i know all about the ‘its hard’ part.

I have 6 nikon DSLR’s i can test code on and access to friend’s Canon’s (although i use the word ‘friend’ lightly when it comes to dirty Canon users :stuck_out_tongue: ). I can probably get access to every Canon/Nikon/Pentax current model for testing purposes as i’m very friendly with the managers of the (the one and only) pro camera shop in my city. I’d be able to test with all of their rental, demo, and second hand stock.

Gus, in your research did you come across brand specific information in your travels? I assume your PTP code was in C?

If i port the arduino code over to C# do i get a free FEZ? lol


#5

I didn’t do it myself but I remember it was near impossible to fins camera-specific info and this the main reason we didn’t move on. You can do all that with reverse engineering though.

Absolutely yes. You are new on these forums so you do not know that we give a way a lot of FEZes regularly so the idea is not new :wink:


#6

See this:
http://www.i3a.org/technologies/image-formats/ptp/

Search google for PIMA 15740 in 2000 for specs.