Posts

Arduino-based controller for Canon EOS cameras

Arduino Camera Controller

Arduino Camera Controller

Today, I’m writing about two more pieces of digital camera control firmware that have being posted to PTP gihHub repository. Alex Gluschenko, the author of PTP library for Arduino, developed two sketches, one called EOSRemote and the other EOSCamController to demonstrate PTP library capabilities. The code allows requesting camera settings, such as shutter speed, aperture, ISO, etc., change them, as well as take shots. It supports Canon EOS cameras and was tested on EOS 400D, 450D, and 7D; other cameras with similar command set ( see my collection of PTP device info dumps ) may work as well.

This is how the code works: when connection is established, camera sends back an initial packet with all its current settings along with a list of all possible values for each setting. Possible values depend on a camera model as well as lens that are mounted. For example, some cameras may have exposure compensation range from -2 to +2, others from -5 to +5; some lens have max.aperture 1.4, others – 3.5, an so on. The list of values received from the camera is placed in built-in EEPROM of Arduino microcontroller. After that, values are used in setting (called “property” in PTP lingo) change commands sent to the camera. When camera mode, such as Av, Tv, or lens is changed, camera sends initial packet again. The Arduino code tracks changes and updates the list stored in EEPROM.

Hardware requirements for both controllers are pretty standard. The EOSRemote sketch uses Arduino serial port facility for I/O, and the only hardware necessary is Arduino Duemilanove, Uno, or compatible clone, as well as USB Host Shield. User interface is designed with simple terminal emulator program in mind. It can be used with a PC connected to Arduino directly or over some distance utilizing a pair of serial to RF converters, such as ever-popular Xbee. The following screenshot shows top-level menu with camera connected and recognized.

Camcontroller screenshot

The second controller has been designed for field operations. It uses HD44780-compatible character LCD display, rotary encoder with push switch, and one extra button. Here is controller’s schematic. Title picture shows the implementation and picture on the right shows main components. The controller uses 3.3V Arduino Pro from Sparkfun, “Minimal” variant of USB Host Shield and 3.3V LCD display. LCD, encoder and switch are mounted on a small prototype PCB which plugs directly into USB Host Shield’s GPIO pins.

Camera controller parts

Camera controller parts

In addition to setting/displaying shooting parameters and taking shots this controller works as intervalometer with extended bracketing. If desired, a self-timer can be set up before the first shot in series. Also, each shot can be bracketed as wide and granular as camera exposure compensation range and step allows. For example, on 7D it is possible to set bracketing from -5 to +5 with 1/3 step between shots – more than enough for good HDR.

Let’s talk about the code. To compile the sketches, current versions of Arduino_Camera_Control and USB Host Shield libraries are necessary. Additionally, Time library from Arduino Playground has to be installed. Also, the code uses Quantum Leaps QP framework – a compact and robust open source implementation of UML state machines. Miro Samek is currently working on Arduino port of QP framework; in the mean time, I’ll show how to make Arduino-compatible setup from source code. Only QEP component of the framework is used and installation is simple.

First, create a directory under arduino-00xx/libraries/, call it. let’s say, ‘qep’. Then download the QP/C++ from SourceForge. Unzip the archive somewhere else, navigate the directory tree to qcpp_x.xx/qep/source and copy all files to Arduino library directory. After that, go to qcpp_x.xx/include directory and copy qassert_.h, qep.h, qevent.h and qs_dummy.h header files to the same Arduino library directory. Now, download AVR port, unzip it, navigate to ports/avr/qk/gnu and copy qep_port.h to Arduino library directory. Finally, in Arduino library directory, open qassert.h in text editor and insert line #define Q_NASSERT before the line containing #ifdef Q_NASSERT (line 47 as of ver.4.1.01 of QDKCPP-AVR-GNU). Save the file. The sketches should now compile – try it with your camera and let me know if you have any problems.

Finally, I want to talk about hardware variants. Camera controllers described here can be built using “standard” Arduino (Duemilanove or Uno) plus “Simple” USB Host shield. This setup is easy to work with and troubleshoot. However, it is not as easy to power such setup – usually you would need 4xAA batteries, which is somewhat bulky. On the other hand, 3.3V setup can be powered from a single LiPo so 3.3V Arduino Pro/”Minimal” USB Host Shield setup is preferable for a portable controller. It is also possible to build a controller with 3.3V Arduino Pro Mini/USB Host Mini – the tiny form factor makes building more difficult but the resulting controller is going to be much smaller and also quite a bit cheaper. The code is compatible with any of hardware variants described above.

I’m planning to continue camera control code development – next milestone is Canon Powershot command set support, and it is very close to release. I’m also planning on making a small controller for Canon DSLR video mode. Stay tuned!

Oleg.

184 comments to Arduino-based controller for Canon EOS cameras

  • Great job!
    Can arduino write down raw’s to SD card via ethernet shield ? It can be awesome mobile solution for timelapses )

  • Dmitry

    Hello Oleg!

    I still can’t stop to thank you for this little helpful shield.

    have you tried to set AEB in manual mode? if yes – could you please share the code sample?

    thanks, Dmitry.

    • Exposure compensation doesn’t work in manual mode.

      • Dmitry

        but that could be? I am absolutely sure that I can set it in manual mode in the camera menu – AEB/Exposure compensation?
        it that some hardware limitations?

        • Dmitry

          found!
          here is a code sample:

          #define EOS_DPC_AEB 0xD1D9

          ...

          Eos.SetProperty(EOS_DPC_BracketMode, 1);
          delay(200);

          Eos.SetProperty(EOS_DPC_AEB, 0x18);
          delay(200);

          the available values for EOS_DPC_AEB are the positive shift values from the exposure compensation values list. I’ve found it in the canon sdk document.
          for example – 0x18 is equal to +3, 0x10 to +2 and so on.

          however, my 7D(1.2.2) sometimes don’t allow me to set AEB in manual mode. I can’t find the reason, but if I swith to another mode (Av,Tv,P) and then set AEB then is appears in M mode. that looks like a bug in a firmware, but I don’t know how to reproduce in in 100% cases.

          • This is how I interpret this: the exposure compensation setting affects exposure meter in the camera. The exposure meter is visible in the viewfinder ( a scale at the bottom ). In one of the auto modes exposure meter also sets exposure of the shot. in manual mode exposure meter is disconnected – you can still see it but if won’t set the exposure of the shot.

            To summarize: if you can’t see the exposure meter scale (as is often the case of remote camera control via PTP) setting Ev in manual mode makes no sense.

      • Jan van Bodegraven

        Exposure compensation and exposure bracketing are two different things.

        Bracketing will work in Manual, normally through varying exposure time.

        • Bracketing is supported in the library, the property name is EOS_DPC_BracketMode. The camera will take 3 shots. Ev method, used in this controller, is more flexible – you set margins (like +/- 6) and step (like 1/3), and controller sets each Ev value and takes a shot.

  • Rogier

    Hi

    This sound pretty cool!
    I am looking for a way to read the filename of tge lasten taken picture
    Is this possible with this program?
    Or is there an example with it?

    THANKS!

    • In PTP, files are called objects. The object is accessed by its ‘handle’. There are examples of getting list of handles an getting object info. Since files are big and can’t be buffered in Arduino memory, getting the object itself is application-specific. You start by using GetObject(), then write a parser which will be called on receiving each USB packet from the camera.

      • rogier

        Thanks!

        But first off all i am still fighting to make it compiling
        In the EOS bulb example i get the error “usb does not name a type”
        And in the eventlab i get the error expected ) before * token

        I did all that you describe above….

  • rogier

    Nope exactly the same errors like i have with 1.0….

    • rogier

      It is running now, the problem was that i did not install the usb library

      So now up to find out what Oleg means by
      “In PTP, files are called objects. The object is accessed by its ‘handle’. There are examples of getting list of handles an getting object info. Since files are big and can’t be buffered in Arduino memory, getting the object itself is application-specific. You start by using GetObject(), then write a parser which will be called on receiving each USB packet from the camera.”

      I am totaly no programmer…. so lets go google and we will see 😉

  • ysw925

    Hello Oleg!

    I have been able to set EOS Camera ISO,But now I want to get EOS Camera ISO.
    I should use what functionS and with what parameter?

    THANKS!

  • ysw925

    Oleg,Thank you!
    I can get the current ISO now.
    I have other question.Could you help me, please?
    I want to get EOS Camera current FOCUS.
    what functionS should I use ?

    THANKS!

    • You can’t get focus position from the EOS. You won’t even know whether it moved or not when you send MoveFocus(). Moving focus is completely open-loop.

  • ysw925

    Hello Oleg!
    I want to move focus box up\down\left\right,what functionS should do that?
    what functions should do screen zoom 1X\5X\10X?

    THANKS!

  • Dmitriy

    Hello, Oleg!
    Unfortunately I can’t get to work any Arduino Camera Control sketch. A bunch of errors appears when I trying to compile the code. I found solution here: USB Host Shield library needed, but I already dowloaded and extracted it into library directory from github (as described above). It doesn’t change anything. Hope for your help.

    ERRORS:
    In file included from C:\Users\DS\Desktop\arduino-1.0.2-windows\libraries\Arduino_Camera_Control/ptp.h:28,
    from EOSCapture.pde:11:
    C:\Users\DS\Desktop\arduino-1.0.2-windows\libraries\Arduino_Camera_Control/ptpcallback.h:22:22: error: WProgram.h: No such file or directory
    In file included from C:\Users\DS\Desktop\arduino-1.0.2-windows\libraries\Arduino_Camera_Control/ptp.h:28,
    from EOSCapture.pde:11:
    C:\Users\DS\Desktop\arduino-1.0.2-windows\libraries\Arduino_Camera_Control/ptpcallback.h: In constructor ‘MultiByteValueParser::MultiByteValueParser()’:
    C:\Users\DS\Desktop\arduino-1.0.2-windows\libraries\Arduino_Camera_Control/ptpcallback.h:44: error: ‘NULL’ was not declared in this scope
    C:\Users\DS\Desktop\arduino-1.0.2-windows\libraries\Arduino_Camera_Control/ptpcallback.h: In constructor ‘ByteSkipper::ByteSkipper()’:
    C:\Users\DS\Desktop\arduino-1.0.2-windows\libraries\Arduino_Camera_Control/ptpcallback.h:64: error: ‘NULL’ was not declared in this scope
    C:\Users\DS\Desktop\arduino-1.0.2-windows\libraries\Arduino_Camera_Control/ptpcallback.h: At global scope:
    C:\Users\DS\Desktop\arduino-1.0.2-windows\libraries\Arduino_Camera_Control/ptpcallback.h:147: error: ‘NULL’ was not declared in this scope
    C:\Users\DS\Desktop\arduino-1.0.2-windows\libraries\Arduino_Camera_Control/ptpcallback.h: In constructor ‘PTPListParser::PTPListParser()’:
    C:\Users\DS\Desktop\arduino-1.0.2-windows\libraries\Arduino_Camera_Control/ptpcallback.h:116: error: ‘NULL’ was not declared in this scope
    In file included from C:\Users\DS\Desktop\arduino-1.0.2-windows\libraries\Arduino_Camera_Control/ptp.h:29,
    from EOSCapture.pde:11:
    C:\Users\DS\Desktop\arduino-1.0.2-windows\libraries\Arduino_Camera_Control/ptpdebug.h: In function ‘void PrintHex(T)’:
    C:\Users\DS\Desktop\arduino-1.0.2-windows\libraries\Arduino_Camera_Control/ptpdebug.h:35: error: ‘Serial’ was not declared in this scope
    C:\Users\DS\Desktop\arduino-1.0.2-windows\libraries\Arduino_Camera_Control/ptpdebug.h:39: error: ‘Serial’ was not declared in this scope
    C:\Users\DS\Desktop\arduino-1.0.2-windows\libraries\Arduino_Camera_Control/ptpdebug.h:39: error: ‘HEX’ was not declared in this scope
    C:\Users\DS\Desktop\arduino-1.0.2-windows\libraries\Arduino_Camera_Control/ptpdebug.h: At global scope:
    C:\Users\DS\Desktop\arduino-1.0.2-windows\libraries\Arduino_Camera_Control/ptpdebug.h:43: error: variable or field ‘PrintHex2’ declared void
    C:\Users\DS\Desktop\arduino-1.0.2-windows\libraries\Arduino_Camera_Control/ptpdebug.h:43: error: ‘Print’ was not declared in this scope
    C:\Users\DS\Desktop\arduino-1.0.2-windows\libraries\Arduino_Camera_Control/ptpdebug.h:43: error: ‘prn’ was not declared in this scope
    C:\Users\DS\Desktop\arduino-1.0.2-windows\libraries\Arduino_Camera_Control/ptpdebug.h:43: error: expected primary-expression before ‘val’
    In file included from EOSCapture.pde:11:
    C:\Users\DS\Desktop\arduino-1.0.2-windows\libraries\Arduino_Camera_Control/ptp.h:77: error: ‘MAX3421E’ does not name a type
    C:\Users\DS\Desktop\arduino-1.0.2-windows\libraries\Arduino_Camera_Control/ptp.h:78: error: ‘USB’ does not name a type
    C:\Users\DS\Desktop\arduino-1.0.2-windows\libraries\Arduino_Camera_Control/ptp.h:86: error: ‘EP_RECORD’ does not name a type
    C:\Users\DS\Desktop\arduino-1.0.2-windows\libraries\Arduino_Camera_Control/ptp.h:116: error: ISO C++ forbids declaration of ‘MAX3421E’ with no type
    C:\Users\DS\Desktop\arduino-1.0.2-windows\libraries\Arduino_Camera_Control/ptp.h:116: error: expected ‘;’ before ‘*’ token
    C:\Users\DS\Desktop\arduino-1.0.2-windows\libraries\Arduino_Camera_Control/ptp.h:117: error: ISO C++ forbids declaration of ‘USB’ with no type
    C:\Users\DS\Desktop\arduino-1.0.2-windows\libraries\Arduino_Camera_Control/ptp.h:117: error: expected ‘;’ before ‘*’ token
    C:\Users\DS\Desktop\arduino-1.0.2-windows\libraries\Arduino_Camera_Control/ptp.h:171: error: ‘byte’ has not been declared
    C:\Users\DS\Desktop\arduino-1.0.2-windows\libraries\Arduino_Camera_Control/ptp.h:171: error: ‘byte’ has not been declared
    C:\Users\DS\Desktop\arduino-1.0.2-windows\libraries\Arduino_Camera_Control/ptp.h:128: error: ‘NULL’ was not declared in this scope
    C:\Users\DS\Desktop\arduino-1.0.2-windows\libraries\Arduino_Camera_Control/ptp.h: In member function ‘void PTP::Setup()’:
    C:\Users\DS\Desktop\arduino-1.0.2-windows\libraries\Arduino_Camera_Control/ptp.h:124: error: ‘Max’ was not declared in this scope

  • Dmitriy

    Hello, Oleg!
    Can’t compile your sketch (http://www.circuitsathome.com/canon-eos-cameras-principles-of-interfacing-and-library-description)
    Please, help me to figure out why.

    Errors:

    every5sec_capture_pde:21: error: expected class-name before ‘{‘ token
    every5sec_capture_pde:25: error: ‘PTP’ has not been declared
    every5sec_capture_pde:26: error: ‘PTP’ has not been declared
    every5sec_capture_pde:29: error: ‘CanonEOS’ does not name a type
    every5sec_capture_pde:31: error: variable or field ‘OnDeviceDisconnectedState’ declared void
    every5sec_capture_pde:31: error: ‘PTP’ was not declared in this scope
    every5sec_capture_pde:31: error: ‘ptp’ was not declared in this scope

  • Dmitriy

    Thanks! One step forward and new problem:
    Serial monitor:
    Start
    OSC did not start.

    I’m trying to connect eos 50d using arduino nano and usb host shield nano.

  • Dmitriy

    OMG! Thanks.

  • Rob

    I’m using arduino 1.0.3 and have tried everything to get this to compile. I can compile EOS bulb, ESO capture, eos dual capture, eos eventlab, eosfocus, and yams_ptp20 but I can not compile EOScameracontroller, EOChdrcapture or EOSremote. I have tried installing the usb1 and camera controls with no luck. I also tried usb2 and ptp2. I have tried many different revisions of the qep downloads. Here is the errors I get from EOScamera controller.

    Any help would be great.

    In file included from EOSCamController.pde:25:
    hdrcapture.h:21: error: ‘Q_USER_SIG’ was not declared in this scope
    hdrcapture.h:35: error: expected class-name before ‘{‘ token
    hdrcapture.h:41: error: expected class-name before ‘{‘ token
    hdrcapture.h:46: error: expected class-name before ‘{‘ token
    hdrcapture.h:53: error: expected class-name before ‘{‘ token
    hdrcapture.h:58: error: expected class-name before ‘{‘ token
    hdrcapture.h:74: error: ‘QEvt’ does not name a type
    hdrcapture.h:76: error: ‘QStateHandler’ does not name a type
    hdrcapture.h:78: error: ‘QEvt’ was not declared in this scope
    hdrcapture.h:78: error: template argument 1 is invalid
    hdrcapture.h:99: error: ‘QEvt’ has not been declared
    hdrcapture.h:112: error: ‘QState’ does not name a type
    hdrcapture.h:113: error: ‘QState’ does not name a type
    hdrcapture.h:114: error: ‘QState’ does not name a type
    hdrcapture.h:115: error: ‘QState’ does not name a type
    hdrcapture.h:116: error: ‘QState’ does not name a type
    hdrcapture.h:117: error: ‘QState’ does not name a type
    hdrcapture.h:118: error: ‘QState’ does not name a type
    hdrcapture.h:119: error: ‘QState’ does not name a type
    hdrcapture.h:120: error: ‘QState’ does not name a type
    hdrcapture.h:121: error: ‘QState’ does not name a type
    hdrcapture.h:122: error: ‘QState’ does not name a type
    /hdrcapture.h: In constructor ‘HDRCapture::HDRCapture(CanonEOS&)’:
    hdrcapture.h:82: error: class ‘HDRCapture’ does not have any field named ‘QHsm’
    hdrcapture.h:82: error: ‘QStateHandler’ was not declared in this scope
    hdrcapture.h:82: error: ‘Initial’ is not a member of ‘HDRCapture’
    hdrcapture.h:94: error: class ‘HDRCapture’ does not have any field named ‘activeHistory’
    hdrcapture.h:96: error: ‘struct SetTimeoutEvt’ has no member named ‘sig’
    hdrcapture.h:97: error: ‘struct PTP_RC_Evt’ has no member named ‘sig’
    /hdrcapture.h: In member function ‘void HDRCapture::PostEvent(int*)’:
    hdrcapture.h:101: error: request for member ‘Push’ in ‘((HDRCapture*)this)->HDRCapture::theQueue’, which is of non-class type ‘int’
    /hdrcapture.h: In member function ‘void HDRCapture::Run()’:
    hdrcapture.h:105: error: ‘QEvt’ was not declared in this scope
    hdrcapture.h:105: error: ‘e’ was not declared in this scope
    hdrcapture.h:107: error: request for member ‘Pop’ in ‘((HDRCapture*)this)->HDRCapture::theQueue’, which is of non-class type ‘int’
    hdrcapture.h:108: error: ‘dispatch’ was not declared in this scope
    EOSCamController.pde: At global scope:
    EOSCamController:88: error: ‘QEvt’ does not name a type
    EOSCamController.pde: In function ‘void MenuRunAbort()’:
    EOSCamController:424: error: ‘evtAbort’ was not declared in this scope
    EOSCamController.pde: In function ‘void MenuRun()’:
    EOSCamController:446: error: ‘struct SetEvt’ has no member named ‘sig’
    EOSCamController:449: error: ‘class CamHDRCapture’ has no member named ‘dispatch’
    EOSCamController:451: error: ‘struct SetEvt’ has no member named ‘sig’
    EOSCamController:454: error: ‘class CamHDRCapture’ has no member named ‘dispatch’
    EOSCamController:456: error: ‘struct SetEvt’ has no member named ‘sig’
    EOSCamController:459: error: ‘class CamHDRCapture’ has no member named ‘dispatch’
    EOSCamController:462: error: ‘struct SetBktEvt’ has no member named ‘sig’
    EOSCamController:467: error: ‘class CamHDRCapture’ has no member named ‘dispatch’
    EOSCamController:471: error: ‘struct SetEvt’ has no member named ‘sig’
    EOSCamController:472: error: ‘class CamHDRCapture’ has no member named ‘dispatch’
    EOSCamController.pde: In member function ‘virtual void CamStateHandlers::OnDeviceInitializedState(PTP*)’:
    EOSCamController:529: error: ‘evtTick’ was not declared in this scope
    EOSCamController:536: error: cannot declare variable ‘hnd’ to be of abstract type ‘EosEventHandlers’
    /eoseventhandler.h:13: note: because the following virtual functions are pure within ‘EosEventHandlers’:
    C:\all\downloads\arduino\arduino-1.0.3-windows\arduino-1.0.3\libraries\PTP/eoseventparser.h:37: note: virtual void EOSEventHandlers::OnObjectCreated(const EOSEvent*)
    EOSCamController.pde: In function ‘void setup()’:
    EOSCamController:582: error: ‘evtTick’ was not declared in this scope
    EOSCamController:583: error: ‘evtAbort’ was not declared in this scope
    EOSCamController:584: error: ‘class CamHDRCapture’ has no member named ‘init’

    Thanks so much

  • Rob

    Tonight I’m going to try arduino 1.0.2

  • Rob

    arduino 1.0.2 did the same thing. I must have one of the wrong rev files eithe the time, ptp, usb, avr ot qp.

  • Rob

    I looked at all the old posts. I think I can get this working. I need download pre 1.0 ide and use before 4.3

  • Axel

    Hi Oleg,

    I’m having difficulty compiling EOSRemote example. Please see the errors below. I’m using Arduino UNO, USB Host Shield 2.0, PTP 2.0 and USB Host 2.0 libraries. And Canon EOS 5D mk2. I’ve also put together the qep library as you instructed. Thanks.

    In file included from EOSConsole.cpp:1:
    eosconsole.h:18: error: ‘Q_USER_SIG’ was not declared in this scope
    eosconsole.h:23: error: expected class-name before ‘{‘ token
    eosconsole.h:28: error: expected class-name before ‘{‘ token
    eosconsole.h:33: error: expected class-name before ‘{‘ token
    eosconsole.h:44: error: ‘QState’ does not name a type
    eosconsole.h:45: error: ‘QState’ does not name a type
    eosconsole.h:46: error: ‘QState’ does not name a type
    eosconsole.h:47: error: ‘QState’ does not name a type
    eosconsole.h:48: error: ‘QState’ does not name a type
    eosconsole.h:49: error: ‘QState’ does not name a type
    eosconsole.h:50: error: ‘QState’ does not name a type
    eosconsole.h:51: error: ‘QState’ does not name a type
    eosconsole.h:52: error: ‘QState’ does not name a type
    eosconsole.h:53: error: ‘QState’ does not name a type
    eosconsole.h:54: error: ‘QState’ does not name a type
    eosconsole.h: In constructor ‘EOSConsole::EOSConsole()’:
    eosconsole.h:39: error: class ‘EOSConsole’ does not have any field named ‘QHsm’
    eosconsole.h:39: error: ‘QStateHandler’ was not declared in this scope
    eosconsole.h:39: error: ‘Initial’ is not a member of ‘EOSConsole’
    EOSConsole.cpp: At global scope:
    EOSConsole.cpp:47: error: ‘QState’ does not name a type
    EOSConsole.cpp:52: error: ‘QState’ does not name a type
    EOSConsole.cpp:62: error: ‘QState’ does not name a type
    EOSConsole.cpp:90: error: ‘QState’ does not name a type
    EOSConsole.cpp:119: error: ‘QState’ does not name a type
    EOSConsole.cpp:151: error: ‘QState’ does not name a type
    EOSConsole.cpp:187: error: ‘QState’ does not name a type
    EOSConsole.cpp:223: error: ‘QState’ does not name a type
    EOSConsole.cpp:259: error: ‘QState’ does not name a type
    EOSConsole.cpp:295: error: ‘QState’ does not name a type
    EOSConsole.cpp:331: error: ‘QState’ does not name a type

    • There is something strange with current QP and Arduino. Try to use older versions.

      • Axel

        Thanks, but it doesn’t seem to matter which version I try: 4.5.0.3, 4.1.0.7. 4.1.0.1, 3.4.0.1, I’m getting the same initial error. I’m on a mac downloading the zip files.

  • Rob

    Here is an update for my progress. I think I’m getting close.

    I’m using a windows XP Service Pack 3 Dell Laptop.

    1. I downloaded Arduino 0022 IDE from http://arduino.cc/en/main/software and then installed it.

    2. I then downloaded USB_Host_Shield_2.0-master from https://github.com/felis/USB_Host_Shield_2.0

    3. I then downloaded PTP_2.0-master from https://github.com/felis/PTP_2.0

    4. For the above two files in step 2 and 3 I clicked on the zip button on the page and downloaded the full zip file.

    5. I then unziped the two files to the \arduino-0022\libraries directory

    6. I renamed USB_Host_Shield_2.0-master directory to USBHost

    7. I renamed PTP_2.0-master to PTP

    8. Steps 6 and 7 were needed because the Arduino IDE did not like their names.

    9. I downloaded the time.zip file from http://playground.arduino.cc/Code/Time I had to click on The download to get the file.

    10. I unzipped time.zip to the \arduino-0022\libraries directory. This created the following 3 directories:

    DS1307RTC
    Time
    TimeAlarms

    11. I then downloaded the file qpcpp_4.1.05.exe from http://sourceforge.net/projects/qpc/files/QP_C%2B%2B/4.1.05/ directory.

    12. I installed this to c:\qep directory.

    13. I make a new directory \arduino-0022\libraries\qep

    14. I copied all the files from C:\qep\qep\source to \arduino-0022\libraries\qep

    15. I copied the following 4 files from C:\qep\include to \arduino-0022\libraries\qep

    qassert.h
    qep.h
    qevent.h
    qs_dummy.h

    16. I downloaded qdkcpp_avr-gnu_4.1.01.zip from http://www.circuitsathome.com/camera-control/arduino-based-controller-for-canon-eos-cameras by clicking the blue words download AVR port

    17. I unzipped the file to c:\avr

    18. I copied the file qep_port.h from C:\avr\ports\avr\qk\gnu to \arduino-0022\libraries\qep

    19. I then opened qassert.h from the \arduino-0022\libraries\qep directory and added the line #define Q_NASSERT just before #ifdef Q_NASSERT

    20. I started the Arduino IDE opened the PTP EOSCamController

    I got the same errors again

    EOSCamController.cpp:16:21: error: qp_port.h: No such file or directory
    In file included from EOSCamController.cpp:25:
    hdrcapture.h:20: error: ‘Q_USER_SIG’ was not declared in this scope
    hdrcapture.h:34: error: expected class-name before ‘{‘ token
    hdrcapture.h:40: error: expected class-name before ‘{‘ token
    hdrcapture.h:45: error: expected class-name before ‘{‘ token
    hdrcapture.h:52: error: expected class-name before ‘{‘ token
    hdrcapture.h:57: error: expected class-name before ‘{‘ token
    hdrcapture.h:73: error: ‘QEvent’ does not name a type
    hdrcapture.h:75: error: ‘QStateHandler’ does not name a type
    hdrcapture.h:77: error: ‘QEvent’ was not declared in this scope
    hdrcapture.h:77: error: template argument 1 is invalid
    hdrcapture.h:98: error: ‘QEvent’ has not been declared
    hdrcapture.h:111: error: ‘QState’ does not name a type
    hdrcapture.h:112: error: ‘QState’ does not name a type
    hdrcapture.h:113: error: ‘QState’ does not name a type
    hdrcapture.h:114: error: ‘QState’ does not name a type
    hdrcapture.h:115: error: ‘QState’ does not name a type
    hdrcapture.h:116: error: ‘QState’ does not name a type
    hdrcapture.h:117: error: ‘QState’ does not name a type
    hdrcapture.h:118: error: ‘QState’ does not name a type
    hdrcapture.h:119: error: ‘QState’ does not name a type
    hdrcapture.h:120: error: ‘QState’ does not name a type
    hdrcapture.h:121: error: ‘QState’ does not name a type
    /hdrcapture.h: In constructor ‘HDRCapture::HDRCapture(CanonEOS&)’:
    hdrcapture.h:81: error: class ‘HDRCapture’ does not have any field named ‘QHsm’
    hdrcapture.h:81: error: ‘QStateHandler’ was not declared in this scope
    hdrcapture.h:81: error: ‘Initial’ is not a member of ‘HDRCapture’
    hdrcapture.h:93: error: class ‘HDRCapture’ does not have any field named ‘activeHistory’
    hdrcapture.h:95: error: ‘struct SetTimeoutEvt’ has no member named ‘sig’
    hdrcapture.h:96: error: ‘struct PTP_RC_Evt’ has no member named ‘sig’
    /hdrcapture.h: In member function ‘void HDRCapture::PostEvent(int*)’:
    hdrcapture.h:100: error: request for member ‘Push’ in ‘((HDRCapture*)this)->HDRCapture::theQueue’, which is of non-class type ‘int’
    /hdrcapture.h: In member function ‘void HDRCapture::Run()’:
    hdrcapture.h:104: error: ‘QEvent’ was not declared in this scope
    hdrcapture.h:104: error: ‘e’ was not declared in this scope
    hdrcapture.h:106: error: request for member ‘Pop’ in ‘((HDRCapture*)this)->HDRCapture::theQueue’, which is of non-class type ‘int’
    hdrcapture.h:107: error: ‘dispatch’ was not declared in this scope
    EOSCamController.cpp: At global scope:
    EOSCamController:87: error: ‘QEvent’ does not name a type
    EOSCamController.cpp: In function ‘void MenuRunAbort()’:
    EOSCamController:423: error: ‘evtAbort’ was not declared in this scope
    EOSCamController.cpp: In function ‘void MenuRun()’:
    EOSCamController:445: error: ‘struct SetEvt’ has no member named ‘sig’
    EOSCamController:448: error: ‘class CamHDRCapture’ has no member named ‘dispatch’
    EOSCamController:450: error: ‘struct SetEvt’ has no member named ‘sig’
    EOSCamController:453: error: ‘class CamHDRCapture’ has no member named ‘dispatch’
    EOSCamController:455: error: ‘struct SetEvt’ has no member named ‘sig’
    EOSCamController:458: error: ‘class CamHDRCapture’ has no member named ‘dispatch’
    EOSCamController:461: error: ‘struct SetBktEvt’ has no member named ‘sig’
    EOSCamController:466: error: ‘class CamHDRCapture’ has no member named ‘dispatch’
    EOSCamController:470: error: ‘struct SetEvt’ has no member named ‘sig’
    EOSCamController:471: error: ‘class CamHDRCapture’ has no member named ‘dispatch’
    EOSCamController.cpp: In member function ‘virtual void CamStateHandlers::OnDeviceInitializedState(PTP*)’:
    EOSCamController:528: error: ‘evtTick’ was not declared in this scope
    EOSCamController:535: error: cannot declare variable ‘hnd’ to be of abstract type ‘EosEventHandlers’
    /eoseventhandler.h:13: note: because the following virtual functions are pure within ‘EosEventHandlers’:
    C:\all\downloads\arduino\arduino-0022\libraries\PTP/eoseventparser.h:37: note: virtual void EOSEventHandlers::OnObjectCreated(const EOSEvent*)
    EOSCamController.cpp: In function ‘void setup()’:
    EOSCamController:581: error: ‘evtTick’ was not declared in this scope
    EOSCamController:582: error: ‘evtAbort’ was not declared in this scope
    EOSCamController:583: error: ‘class CamHDRCapture’ has no member named ‘init’

    This is the same errors when I used the Arduino 1.0.3 and 1.0.2 IDE’s

    All my errors have been with no Arduino hardware connected to the computer.

    I’m really excited about using the with my Canon 450D camera. I have the USB board coming in the mail on 1/16/2013. I have just got the XRF usb transmitter and receiver.

    All my errors have been with no Arduino hardware connected to the computer.

    I then tried to use the usb1 and camera control files

    21. I deleted the directory C:\all\downloads\arduino\arduino-0022\libraries\USBHost and C:\all\downloads\arduino\arduino-0022\libraries\PTP

    22. I downloaded the file Arduino_Camera_Control-master.zip from https://github.com/felis/Arduino_Camera_Control

    23. I downloaded the file USB_Host_Shield-master.zip from https://github.com/felis/USB_Host_Shield

    24. I unzipped them both to the \arduino-0022\libraries directory

    25. I renamed them so that Arduino would like them

    This time all would compile except for the following:

    PTPDeviceInfo

    In file included from devinfoparser.cpp:1:
    /devinfoparser.h:6:29: error: ../ptp/ptpconst.h: No such file or directory
    /devinfoparser.h:7:29: error: ../ptp/mtpconst.h: No such file or directory
    /devinfoparser.h:8:24: error: ../ptp/ptp.h: No such file or directory
    In file included from devinfoparser.cpp:1:
    devinfoparser.h:237: error: expected class-name before ‘{‘ token
    devinfoparser.cpp: In member function ‘bool DevInfoParser::PrintFunctMode(uint8_t**, uint16_t&)’:
    devinfoparser.cpp:194: error: ‘Notify’ was not declared in this scope
    devinfoparser.cpp:194: error: ‘Serial’ was not declared in this scope
    devinfoparser.cpp:194: error: ‘HEX’ was not declared in this scope
    devinfoparser.cpp: In member function ‘void DevInfoParser::PrintOperation(uint16_t)’:
    devinfoparser.cpp:202: error: ‘Serial’ was not declared in this scope
    devinfoparser.cpp:202: error: ‘HEX’ was not declared in this scope
    devinfoparser.cpp:203: error: ‘Notify’ was not declared in this scope
    devinfoparser.cpp:216: error: ‘PTP_VENDOR_MICROSOFT’ was not declared in this scope
    devinfoparser.cpp:217: error: ‘PTP_VENDOR_CANON’ was not declared in this scope
    devinfoparser.cpp: In member function ‘bool DevInfoParser::PrintPTPOperation(uint16_t)’:
    devinfoparser.cpp:234: error: ‘PTP_OC_InitiateOpenCapture’ was not declared in this scope
    devinfoparser.cpp:236: error: ‘Notify’ was not declared in this scope
    devinfoparser.cpp: In member function ‘bool DevInfoParser::PrintMTPOperation(uint16_t)’:
    devinfoparser.cpp:244: error: ‘MTP_OC_SendObjectPropList’ was not declared in this scope
    devinfoparser.cpp:245: error: ‘Notify’ was not declared in this scope
    devinfoparser.cpp:250: error: ‘MTP_OC_GetObjectReferences’ was not declared in this scope
    devinfoparser.cpp:251: error: ‘Notify’ was not declared in this scope
    devinfoparser.cpp:253: error: ‘MTP_OC_SetObjectReferences’ was not declared in this scope
    devinfoparser.cpp:256: error: ‘MTP_OC_Skip’ was not declared in this scope
    devinfoparser.cpp: In member function ‘bool DevInfoParser::PrintPSOperation(uint16_t)’:
    devinfoparser.cpp:317: error: ‘Notify’ was not declared in this scope
    devinfoparser.cpp: In member function ‘bool DevInfoParser::PrintEOSOperation(uint16_t)’:
    devinfoparser.cpp:365: error: ‘Notify’ was not declared in this scope
    devinfoparser.cpp: In member function ‘void DevInfoParser::PrintEvent(uint16_t)’:
    devinfoparser.cpp:371: error: ‘Serial’ was not declared in this scope
    devinfoparser.cpp:371: error: ‘HEX’ was not declared in this scope
    devinfoparser.cpp:372: error: ‘Notify’ was not declared in this scope
    devinfoparser.cpp:374: error: ‘PTP_EC_UnreportedStatus’ was not declared in this scope
    devinfoparser.cpp:377: error: ‘MTP_EC_ObjectReferencesChanged’ was not declared in this scope
    devinfoparser.cpp: In member function ‘void DevInfoParser::PrintDevProp(uint16_t)’:
    devinfoparser.cpp:386: error: ‘Serial’ was not declared in this scope
    devinfoparser.cpp:386: error: ‘HEX’ was not declared in this scope
    devinfoparser.cpp:387: error: ‘Notify’ was not declared in this scope
    devinfoparser.cpp:389: error: ‘PTP_DPC_CopyrightInfo’ was not declared in this scope
    devinfoparser.cpp:394: error: ‘MTP_DPC_Perceived_Device_Type’ was not declared in this scope
    devinfoparser.cpp:400: error: ‘MTP_DPC_Playback_Rate’ was not declared in this scope
    devinfoparser.cpp:403: error: ‘MTP_DPC_Playback_Object’ was not declared in this scope
    devinfoparser.cpp:406: error: ‘MTP_DPC_Playback_Container’ was not declared in this scope
    devinfoparser.cpp: In member function ‘void DevInfoParser::PrintFormat(uint16_t)’:
    devinfoparser.cpp:422: error: ‘Serial’ was not declared in this scope
    devinfoparser.cpp:422: error: ‘HEX’ was not declared in this scope
    devinfoparser.cpp:423: error: ‘Notify’ was not declared in this scope
    devinfoparser.cpp:425: error: ‘PTP_OFC_QT’ was not declared in this scope
    devinfoparser.cpp:428: error: ‘PTP_OFC_JPX’ was not declared in this scope
    devinfoparser.cpp:434: error: ‘MTP_OFC_Undefined_Firmware’ was not declared in this scope
    devinfoparser.cpp:437: error: ‘MTP_OFC_Windows_Image_Format’ was not declared in this scope
    devinfoparser.cpp:440: error: ‘MTP_OFC_Undefined_Audio’ was not declared in this scope
    devinfoparser.cpp:443: error: ‘MTP_OFC_WMA’ was not declared in this scope
    devinfoparser.cpp:446: error: ‘MTP_OFC_OGG’ was not declared in this scope
    devinfoparser.cpp:449: error: ‘MTP_OFC_AAC’ was not declared in this scope
    devinfoparser.cpp:452: error: ‘MTP_OFC_Audible’ was not declared in this scope
    devinfoparser.cpp:455: error: ‘MTP_OFC_FLAC’ was not declared in this scope
    devinfoparser.cpp:458: error: ‘MTP_OFC_Undefined_Video’ was not declared in this scope
    devinfoparser.cpp:461: error: ‘MTP_OFC_WMV’ was not declared in this scope
    devinfoparser.cpp:464: error: ‘MTP_OFC_MP4_Container’ was not declared in this scope
    devinfoparser.cpp:467: error: ‘MTP_OFC_MP2’ was not declared in this scope
    devinfoparser.cpp:470: error: ‘MTP_OFC_3GP_Container’ was not declared in this scope
    devinfoparser.cpp: In member function ‘bool DevInfoParser::PrintVendor(uint8_t**, uint16_t&)’:
    devinfoparser.cpp:482: error: ‘Notify’ was not declared in this scope
    devinfoparser.cpp:483: error: ‘Serial’ was not declared in this scope
    devinfoparser.cpp:483: error: ‘HEX’ was not declared in this scope
    devinfoparser.cpp:487: error: ‘PTP_VENDOR_EASTMAN_KODAK’ was not declared in this scope
    devinfoparser.cpp:490: error: ‘PTP_VENDOR_SEIKO_EPSON’ was not declared in this scope
    devinfoparser.cpp:493: error: ‘PTP_VENDOR_AGILENT’ was not declared in this scope
    devinfoparser.cpp:496: error: ‘PTP_VENDOR_POLAROID’ was not declared in this scope
    devinfoparser.cpp:499: error: ‘PTP_VENDOR_AGFA_GEVAERT’ was not declared in this scope
    devinfoparser.cpp:502: error: ‘PTP_VENDOR_MICROSOFT’ was not declared in this scope
    devinfoparser.cpp:505: error: ‘PTP_VENDOR_EQUINOX’ was not declared in this scope
    devinfoparser.cpp:508: error: ‘PTP_VENDOR_VIEWQUEST’ was not declared in this scope
    devinfoparser.cpp:511: error: ‘PTP_VENDOR_STMICROELECTRONICS’ was not declared in this scope
    devinfoparser.cpp:514: error: ‘PTP_VENDOR_NIKON’ was not declared in this scope
    devinfoparser.cpp:517: error: ‘PTP_VENDOR_CANON’ was not declared in this scope
    devinfoparser.cpp:520: error: ‘PTP_VENDOR_FOTONATION’ was not declared in this scope
    devinfoparser.cpp:523: error: ‘PTP_VENDOR_PENTAX’ was not declared in this scope
    devinfoparser.cpp:526: error: ‘PTP_VENDOR_FUJI’ was not declared in this scope
    devinfoparser.cpp: In member function ‘bool DevInfoParser::PrintString(uint8_t**, uint16_t&)’:
    devinfoparser.cpp:558: error: ‘Serial’ was not declared in this scope
    devinfoparser.cpp: At global scope:
    devinfoparser.cpp:563: error: ‘NULL’ was not declared in this scope
    devinfoparser.cpp: In member function ‘bool DevInfoParser::PrintWordArray(uint8_t**, uint16_t&, void (DevInfoParser::*)(uint16_t))’:
    devinfoparser.cpp:590: error: ‘Serial’ was not declared in this scope
    devinfoparser.cpp:590: error: ‘HEX’ was not declared in this scope
    devinfoparser.cpp: In member function ‘virtual void DevInfoParser::Parse(uint16_t, const uint8_t*, const uint32_t&)’:
    devinfoparser.cpp:614: error: ‘Notify’ was not declared in this scope
    devinfoparser.cpp:614: error: ‘Serial’ was not declared in this scope
    devinfoparser.cpp:614: error: ‘DEC’ was not declared in this scope
    devinfoparser.cpp:620: error: ‘HEX’ was not declared in this scope

    PSDevProp

    In file included from devpropparser.cpp:1:
    /devpropparser.h:6:29: error: ../ptp/ptpconst.h: No such file or directory
    /devpropparser.h:7:24: error: ../ptp/ptp.h: No such file or directory
    In file included from devpropparser.cpp:1:
    devpropparser.h:68: error: expected class-name before ‘{‘ token
    devpropparser.h:78: error: ‘MultiValueBuffer’ does not name a type
    devpropparser.h:83: error: ‘MultiByteValueParser’ does not name a type
    devpropparser.h:94: error: expected ‘,’ or ‘…’ before ‘*’ token
    devpropparser.h:94: error: ISO C++ forbids declaration of ‘MultiValueBuffer’ with no type
    devpropparser.h:99: error: expected ‘,’ or ‘…’ before ‘*’ token
    devpropparser.h:99: error: ISO C++ forbids declaration of ‘MultiValueBuffer’ with no type
    devpropparser.h:105: error: expected ‘,’ or ‘…’ before ‘*’ token
    devpropparser.h:105: error: ISO C++ forbids declaration of ‘MultiValueBuffer’ with no type
    devpropparser.h:111: error: expected ‘,’ or ‘…’ before ‘*’ token
    devpropparser.h:111: error: ISO C++ forbids declaration of ‘MultiValueBuffer’ with no type
    devpropparser.h:117: error: expected ‘,’ or ‘…’ before ‘*’ token
    devpropparser.h:117: error: ISO C++ forbids declaration of ‘MultiValueBuffer’ with no type
    devpropparser.h:124: error: expected ‘,’ or ‘…’ before ‘*’ token
    devpropparser.h:124: error: ISO C++ forbids declaration of ‘MultiValueBuffer’ with no type
    devpropparser.h:147: error: ‘PTPListParser’ does not name a type
    /devpropparser.h: In static member function ‘static void DevPropParser::PrintChar(int)’:
    devpropparser.h:96: error: ‘p’ was not declared in this scope
    devpropparser.h:97: error: ‘Serial’ was not declared in this scope
    /devpropparser.h: In static member function ‘static void DevPropParser::PrintByte(int)’:
    devpropparser.h:101: error: ‘count’ was not declared in this scope
    devpropparser.h:102: error: ‘Notify’ was not declared in this scope
    devpropparser.h:103: error: ‘PrintHex’ was not declared in this scope
    devpropparser.h:103: error: expected primary-expression before ‘>’ token
    devpropparser.h:103: error: ‘p’ was not declared in this scope
    /devpropparser.h: In static member function ‘static void DevPropParser::PrintTwoBytes(int)’:
    devpropparser.h:107: error: ‘count’ was not declared in this scope
    devpropparser.h:108: error: ‘Notify’ was not declared in this scope
    devpropparser.h:109: error: ‘PrintHex’ was not declared in this scope
    devpropparser.h:109: error: expected primary-expression before ‘>’ token
    devpropparser.h:109: error: ‘p’ was not declared in this scope
    /devpropparser.h: In static member function ‘static void DevPropParser::PrintFourBytes(int)’:
    devpropparser.h:113: error: ‘count’ was not declared in this scope
    devpropparser.h:114: error: ‘Notify’ was not declared in this scope
    devpropparser.h:115: error: ‘PrintHex’ was not declared in this scope
    devpropparser.h:115: error: expected primary-expression before ‘>’ token
    devpropparser.h:115: error: ‘p’ was not declared in this scope
    /devpropparser.h: In static member function ‘static void DevPropParser::PrintEightBytes(int)’:
    devpropparser.h:119: error: ‘count’ was not declared in this scope
    devpropparser.h:120: error: ‘Notify’ was not declared in this scope
    devpropparser.h:121: error: ‘p’ was not declared in this scope
    devpropparser.h:122: error: ‘PrintHex’ was not declared in this scope
    devpropparser.h:122: error: expected primary-expression before ‘>’ token
    /devpropparser.h: In static member function ‘static void DevPropParser::PrintEnumValue(int)’:
    devpropparser.h:126: error: ‘count’ was not declared in this scope
    devpropparser.h:127: error: ‘Serial’ was not declared in this scope
    devpropparser.h:129: error: expected primary-expression before ‘)’ token
    devpropparser.h:129: error: expected `)’ before ‘p’
    devpropparser.h:144: error: expected `)’ before ‘count’
    /devpropparser.h: In constructor ‘DevPropParser::DevPropParser()’:
    devpropparser.h:161: error: ‘theBuffer’ was not declared in this scope
    devpropparser.cpp: In member function ‘void DevPropParser::PrintDataType(uint8_t**, uint16_t*)’:
    devpropparser.cpp:73: error: ‘Notify’ was not declared in this scope
    devpropparser.cpp:78: error: ‘PTP_DTC_UINT128’ was not declared in this scope
    devpropparser.cpp:82: error: ‘PTP_DTC_AUINT128’ was not declared in this scope
    devpropparser.cpp: In member function ‘void DevPropParser::PrintDevProp(uint8_t**, uint16_t*)’:
    devpropparser.cpp:100: error: ‘Notify’ was not declared in this scope
    devpropparser.cpp:102: error: ‘PTP_DPC_CopyrightInfo’ was not declared in this scope
    devpropparser.cpp:104: error: ‘PrintHex’ was not declared in this scope
    devpropparser.cpp:104: error: expected primary-expression before ‘>’ token
    devpropparser.cpp:111: error: ‘PrintHex’ was not declared in this scope
    devpropparser.cpp:111: error: expected primary-expression before ‘>’ token
    devpropparser.cpp: In member function ‘void DevPropParser::PrintGetSet(uint8_t**, uint16_t*)’:
    devpropparser.cpp:120: error: ‘Notify’ was not declared in this scope
    devpropparser.cpp: In member function ‘uint8_t DevPropParser::GetDataSize()’:
    devpropparser.cpp:130: error: ‘PTP_DTC_INT8’ was not declared in this scope
    devpropparser.cpp:131: error: ‘PTP_DTC_UINT8’ was not declared in this scope
    devpropparser.cpp:134: error: ‘PTP_DTC_AINT8’ was not declared in this scope
    devpropparser.cpp:135: error: ‘PTP_DTC_AUINT8’ was not declared in this scope
    devpropparser.cpp:137: error: ‘enumParser’ was not declared in this scope
    devpropparser.cpp:137: error: ‘theBuffer’ was not declared in this scope
    devpropparser.cpp:139: error: ‘PTP_DTC_INT16’ was not declared in this scope
    devpropparser.cpp:140: error: ‘PTP_DTC_UINT16’ was not declared in this scope
    devpropparser.cpp:144: error: ‘PTP_DTC_AINT16’ was not declared in this scope
    devpropparser.cpp:145: error: ‘PTP_DTC_AUINT16’ was not declared in this scope
    devpropparser.cpp:148: error: ‘PTP_DTC_STR’ was not declared in this scope
    devpropparser.cpp:152: error: ‘PTP_DTC_INT32’ was not declared in this scope
    devpropparser.cpp:153: error: ‘PTP_DTC_UINT32’ was not declared in this scope
    devpropparser.cpp:156: error: ‘PTP_DTC_AINT32’ was not declared in this scope
    devpropparser.cpp:157: error: ‘PTP_DTC_AUINT32’ was not declared in this scope
    devpropparser.cpp:161: error: ‘PTP_DTC_INT64’ was not declared in this scope
    devpropparser.cpp:162: error: ‘PTP_DTC_UINT64’ was not declared in this scope
    devpropparser.cpp:165: error: ‘PTP_DTC_AINT64’ was not declared in this scope
    devpropparser.cpp:166: error: ‘PTP_DTC_AUINT64’ was not declared in this scope
    devpropparser.cpp:170: error: ‘PTP_DTC_INT128’ was not declared in this scope
    devpropparser.cpp:171: error: ‘PTP_DTC_UINT128’ was not declared in this scope
    devpropparser.cpp:174: error: ‘PTP_DTC_AINT128’ was not declared in this scope
    devpropparser.cpp:175: error: ‘PTP_DTC_AUINT128’ was not declared in this scope
    devpropparser.cpp: In member function ‘bool DevPropParser::PrintValue(uint8_t**, uint16_t*)’:
    devpropparser.cpp:187: error: ‘PTP_DTC_INT8’ was not declared in this scope
    devpropparser.cpp:188: error: ‘PTP_DTC_UINT8’ was not declared in this scope
    devpropparser.cpp:189: error: ‘PrintHex’ was not declared in this scope
    devpropparser.cpp:189: error: expected primary-expression before ‘>’ token
    devpropparser.cpp:193: error: ‘PTP_DTC_AINT8’ was not declared in this scope
    devpropparser.cpp:194: error: ‘PTP_DTC_AUINT8’ was not declared in this scope
    devpropparser.cpp:195: error: ‘enumParser’ was not declared in this scope
    devpropparser.cpp:195: error: ‘PTP_ARRAY_EL_FUNC’ was not declared in this scope
    devpropparser.cpp:198: error: ‘PTP_DTC_INT16’ was not declared in this scope
    devpropparser.cpp:199: error: ‘PTP_DTC_UINT16’ was not declared in this scope
    devpropparser.cpp:200: error: expected primary-expression before ‘>’ token
    devpropparser.cpp:204: error: ‘PTP_DTC_AINT16’ was not declared in this scope
    devpropparser.cpp:205: error: ‘PTP_DTC_AUINT16’ was not declared in this scope
    devpropparser.cpp:206: error: ‘enumParser’ was not declared in this scope
    devpropparser.cpp:206: error: ‘PTP_ARRAY_EL_FUNC’ was not declared in this scope
    devpropparser.cpp:209: error: ‘PTP_DTC_INT32’ was not declared in this scope
    devpropparser.cpp:210: error: ‘PTP_DTC_UINT32’ was not declared in this scope
    devpropparser.cpp:211: error: expected primary-expression before ‘>’ token
    devpropparser.cpp:215: error: ‘PTP_DTC_AINT32’ was not declared in this scope
    devpropparser.cpp:216: error: ‘PTP_DTC_AUINT32’ was not declared in this scope
    devpropparser.cpp:217: error: ‘enumParser’ was not declared in this scope
    devpropparser.cpp:217: error: ‘PTP_ARRAY_EL_FUNC’ was not declared in this scope
    devpropparser.cpp:220: error: ‘PTP_DTC_INT64’ was not declared in this scope
    devpropparser.cpp:221: error: ‘PTP_DTC_UINT64’ was not declared in this scope
    devpropparser.cpp:225: error: ‘PTP_DTC_AINT64’ was not declared in this scope
    devpropparser.cpp:226: error: ‘PTP_DTC_AUINT64’ was not declared in this scope
    devpropparser.cpp:227: error: ‘enumParser’ was not declared in this scope
    devpropparser.cpp:227: error: ‘PTP_ARRAY_EL_FUNC’ was not declared in this scope
    devpropparser.cpp:230: error: ‘PTP_DTC_INT128’ was not declared in this scope
    devpropparser.cpp:231: error: ‘PTP_DTC_UINT128’ was not declared in this scope
    devpropparser.cpp:235: error: ‘PTP_DTC_AINT128’ was not declared in this scope
    devpropparser.cpp:236: error: ‘PTP_DTC_AUINT128’ was not declared in this scope
    devpropparser.cpp:237: error: ‘enumParser’ was not declared in this scope
    devpropparser.cpp:237: error: ‘NULL’ was not declared in this scope
    devpropparser.cpp:240: error: ‘PTP_DTC_STR’ was not declared in this scope
    devpropparser.cpp:241: error: ‘enumParser’ was not declared in this scope
    devpropparser.cpp:241: error: ‘PTP_ARRAY_EL_FUNC’ was not declared in this scope
    devpropparser.cpp: In member function ‘bool DevPropParser::ParseEnumArray(uint8_t**, uint16_t*)’:
    devpropparser.cpp:261: error: ‘theBuffer’ was not declared in this scope
    devpropparser.cpp:262: error: ‘valParser’ was not declared in this scope
    devpropparser.cpp:270: error: ‘enumParser’ was not declared in this scope
    devpropparser.cpp:275: error: ‘PTP_ARRAY_EL_FUNC’ was not declared in this scope
    devpropparser.cpp:275: error: ‘PTPListParser’ has not been declared
    devpropparser.cpp:278: error: ‘Notify’ was not declared in this scope
    devpropparser.cpp: In member function ‘bool DevPropParser::ParseEnumSingle(uint8_t**, uint16_t*)’:
    devpropparser.cpp:291: error: ‘enumParser’ was not declared in this scope
    devpropparser.cpp:291: error: ‘theBuffer’ was not declared in this scope
    devpropparser.cpp:295: error: ‘PTP_ARRAY_EL_FUNC’ was not declared in this scope
    devpropparser.cpp: In member function ‘virtual void DevPropParser::Parse(uint16_t, const uint8_t*, const uint32_t&)’:
    devpropparser.cpp:323: error: ‘Notify’ was not declared in this scope
    devpropparser.cpp:347: error: ‘enumParser’ was not declared in this scope
    devpropparser.cpp:347: error: ‘theBuffer’ was not declared in this scope
    devpropparser.cpp:347: error: ‘PTPListParser’ has not been declared
    devpropparser.cpp:354: error: ‘enumParser’ was not declared in this scope
    devpropparser.cpp:354: error: ‘PTP_ARRAY_EL_FUNC’ was not declared in this scope

    EOSCapture

    EOSCapture.cpp:14:24: error: MemoryFree.h: No such file or directory

  • Rob

    I got EOSCapture to compile by removing the line #include

    I’m not sure if that will affect the operation when I try to use it.

  • Rob

    I did it. They all compile now. I got the PTPDeviceInfo and PSDevProp files to compile by renaming the arduino-0022\libraries \Arduino_Camera_Control directory to arduino-0022\libraries \ptp.

  • Rob

    Here are the 20 steps I took to get all the camera files to compile. I hope this helps others.

    I’m using a windows XP Service Pack 3 Dell Laptop.

    1. I downloaded Arduino 0022 IDE from http://arduino.cc/en/main/software and then installed it.

    2. I downloaded the file USB_Host_Shield-master.zip from https://github.com/felis/USB_Host_Shield

    3. I then downloaded PTP_2.0-master from I downloaded the file Arduino_Camera_Control-master.zip from https://github.com/felis/Arduino_Camera_Control

    4. For the above two files in step 2 and 3 I clicked on the zip button on the page and downloaded the full zip file.

    5. I then unziped the two files to the \arduino-0022\libraries directory

    6. I renamed USB_Host_Shield-master directory to USBHost

    7. I renamed arduino_camera_Control-master to ptp

    8. Steps 6 and 7 were needed because the Arduino IDE did not like their names and ptp is used in some of the sketches.

    9. I downloaded the time.zip file from http://playground.arduino.cc/Code/Time I had to click on The download to get the file.

    10. I unzipped time.zip to the \arduino-0022\libraries directory. This created the following 3 directories:

    DS1307RTC
    Time
    TimeAlarms

    11. I then downloaded the file qpcpp_4.1.05.exe from http://sourceforge.net/projects/qpc/files/QP_C%2B%2B/4.1.05/ directory.

    12. I installed this to c:\qep directory.

    13. I make a new directory \arduino-0022\libraries\qep

    14. I copied all the files from C:\qep\qep\source to \arduino-0022\libraries\qep

    15. I copied the following 4 files from C:\qep\include to \arduino-0022\libraries\qep

    qassert.h
    qep.h
    qevent.h
    qs_dummy.h

    16. I downloaded qdkcpp_avr-gnu_4.1.01.zip from http://www.circuitsathome.com/camera-control/arduino-based-controller-for-canon-eos-cameras by clicking the blue words download AVR port

    17. I unzipped the file to c:\avr

    18. I copied the file qep_port.h from C:\avr\ports\avr\qk\gnu to \arduino-0022\libraries\qep

    19. I then opened qassert.h from the \arduino-0022\libraries\qep directory and added the line #define Q_NASSERT just before #ifdef Q_NASSERT

    All compile except for EOSCapture

    20. I got EOSCapture to compile by removing the line #include

    I’m not sure if that will affect the operation when I try to use it.

    • Thanks for sharing!

    • John

      Thanks Rob for sharing this solution. It did work for me. After a bit of poking around I did find a solution to make this work with the Arduino 1.0.5 IDE.

      The main thing that I found is that WProgram.h has been updated to Arduino.h. I had to make changes to:
      – canoneos.h
      – ptpcallback.h
      – simpletimer.h
      – scheduler.h

      After addressing those, I was getting an error about BYTE not being defined in the scope for the ptp.cpp. A quick google search, relieved that Serial.print may have also changed. I modified line 107 of the ptp.cpp file. It is now, Serial.print(c,HEX); instead of Serial.print(c,BYTE);

      Oleg,

      I wanted to thank you for your work with this, I am very great full and love the USB host shield. Thanks again, and I hope that the above will help further development.

      • Jonib Maredia

        Hey John,
        I am using canon EOS 7D and arduino 1.0.5 IDE. Can you give me all the changes you made to the code.
        Thanks

    • Thank you, Rob.
      I follow your steps, now I can compile and upload.

    • joyo

      Thank you a lot.

      It is alive !!!

      Thanks

  • Rob

    20. I got EOSCapture to compile by removing the line
    #include

  • Rob

    20. I got EOSCapture to compile by removing the line #include MemoryFree.h

  • Rob

    I got the usb shield today soldered the pins on and connected the camera 450D loaded EOSRemote and it works great. Thank you so much! Great code. Now I have to try to understand it a little more. Thanks Again Oleg

  • Rob

    I made a small visual basic app the used you ptp rev 1 CanonEOSRemote example code. Here is a link to a screen shot and the VB app. I added the extra files the need to be in the same directory to get it to run. It need lots of work. I have the source for VB 4.0

    http:\\sirenxoom.no-ip.org:8080\canoneos.html

  • Axel

    Does anyone know how to get information from the lens: (1) Focal length – if the lens is zoomed to 35mm, 65 mm, etc and (2) what the focus distance of the lens is – 6″, 3’4″, etc.

    All help would be greatly appreciated. Thanks.

  • Rob

    Hi Oleg, I was wondering if you have time could you please add an additional feature to your EOSRemote sketch for me? I’m using the rev 1 version I could not get the PTP2 or USB_Host2 to compile.

    Right now your main menu looks like this:

    0.
    1. Capture
    2. View Settings
    3. Change Setting

    Could you change it to:

    0.
    1. Capture
    2. Capture & Download Thumbnail
    3. Capture & Download Image
    4. View Settings
    5. Change Setting

    I noticed your post to peter on another page where you have the example code to get the image objects handle and you said that you can use the handle with GetObject() or GetThumb() but I can not seem to make them work.

    If you have time to do this I might also need help receiving the image at the computer. I know you can open a com port for a serial read to a file but I already have the port open so that I can get to the Arduino and your code that is running. I currently using a small visual basic app that opens the com port using MSComm1. I’m using a RichTextBox to display your menu from the EOSRemote.

    (See http://sirenxoom.no-ip.org:8080/canoneos.html for a screen caputre of the VB app)

    I have this working wirelessly with a XRF Xbee clone. So far the range is way better than I thought but I can not see the images until I go to the camera.

    The only other thing I noticed is that if I restart either the Arduino serial monitor or the VB app I only get start on my screen. I have to go out to the camera and turn it off and then back on again to get camera connected on my screen. The communication to the camera does not work unless I cycle the power on the camera. It would be nice if the camera was already connected that the code in the Arduino could notice it.

    What I asking for may not be possible. I do not have anywhere the experience you do with the camera and Arduino.

    I have used Gphoto to do this a few years ago but the Wifi or wireless UBS device range is very short. I gave up on that a few years ago.

    Any help with this would be great.

    Thanks

    Rob

    • How do you download a file via a serial terminal?

      • Rob

        I’m not using a serial terminal. I’m using a Visual basic application to talk to the arduino over the serial com port. Can the camera send the image file via the Arduino to the PC com port as a stream of bytes?

      • Rob

        Hi Oleg, I was thinking that you guys had found a way to transfer pictures from the camera to the computer with the PTP code. I looked at all of the examples but none of them transfer the pictures from the camera. The name Picture Transfer Protocol (PTP) leads you to thing that you could transfer a picture. It has been years since I have used classes in my programming. I have started relearning them. I never had much use for them but you professional programmers use them a lot. They must be really useful. I’m going to have to try writing some simple classes just the get a feel for them again. Sorry if I was asking for too much that can’t be done. I printed out the EOSRemote code and all of the supporting header files. It is over 100 pages in 8 font. This is really a long complicated program.

        Rob

      • Rob

        I use the camera for astro images. Either on a scope or for just wide field star and milkyway images. I can remotely control the mount to reposition the direction the camera/scope is pointed. I live in northeast Ohio and use dew heaters to keep the scope and lens clear from dew or frost. Some of the clearest nights here it is very cold outside. It would be very nice to look at a thumbnail after I reposition the mount just to center the image. After the imager is centered I could take all the long exposures required to complete the image. So a few minute wait to transfer the image would be way better than going out into the dark and cold out to the pier a 5 to 6 hundred feet from my home. My web site has some of the images I’ve taken. Most are for expensive CCD cooled cameras. I an little new to the DSLR imaging but the images should be as good if not better then the ones on my web site. http://sirenxoom.no-ip.org:8080/

        Rob

      • Rob

        I got the EOSRemote to connect to the camera with out having to cycle the cameras power. This is so very hard. Its going to take months to figure out this code. Oleg very good project you have made. Its forcing me to do a lot of oop studding that I should have done when I was younger.

  • Rob

    I’m using a Visual basic app that reads the data from the com port and display it in a text box. If I know I picture is comming I think I can write the code to put the code into a file and then display it in a image control.

  • Rob

    I made the VB app just for your code. It was very easy and the code is very short. Look at the link I have the exe file there too. I only program as a hobby and have very little experence with classes. I mostly use Visual Basic these days.

    After your code is in the Arduino Uno I only run the VB app to see your menu take picture and view and change the camera settings.

    I’m thinking that after the VB app has the image data that I can then put it into a file and add .jpg

    I might have to read up on the format of tha JPG file. My vb app gets all the handle info from the ptpobjectpaser example.

  • Rob

    To get the VB app working you have to enter the com port and the Baud rate then press the connect button.

    there is no error checking so you just have to get it right for it to work.

    The VB app then opens the com port and waits for data from the com port.

    When data is available it displays it in the richtextbox.

    normally I see start with the Arduino connected.

    When I turn on the camera I get camera connected.

    The buttons on the side 0, 1, 2, .. 6 When you press then just send that number to the com port.

    If you press 1 then a 1 is sent to the com port and the arduino makes the camera tak a picture.

    I’m thinking if you modify the code for 2 = caprute and download thumbnail then When I press the 2 button on the VB app I will have the VB app expecting to get an image back from the arduino and modify/save the data as needed to make a real jpg file.

  • Rob

    You could try to receive an image with the VB app as it is written. You should see the data in the textbox. There is be timing issues. The VB app waits for data from the com port if it see some data it grabs it and displays it in the textbox. If a long string of data comes into the com port I think the vb app will display some of it then clear out the textbox and show the next part of it and continue until all the data is read from the com port. The last data displayed right now would be the end of the image data.

  • Axel

    So it’s not possible to get the focus position from the lens but is it possible to get the focal length from a L series zoom lens? ie, the lens zoomed to 33mm? Thanks.

    • There is a property for focal length, see here -> https://github.com/alexdu/piggyphoto/blob/master/piggyphoto/ptp.h I’ve never tried to read it though. AFAIK focus position doesn’t exist; the camera always returns OK to move focus command, even when lens has reached end of the travel and can’t move anymore.

      • Etienne

        Hi Oleg, first thank you for your amazing work.
        For my application I also need to get the focal length from the lens.

        I took a look at this link -> https://github.com/alexdu/piggyphoto/blob/master/piggyphoto/ptp.h Using a EOS 650d and the sketch EOSEventLab, I can find the codes corresponding to all the properties listed in the “/* From EOS 400D trace. */” section from ptp.h but I can’t find the code corresponding to the focal length (0x5008). Do you have any leads how I can read the focal length value ?

        If it’s not possible using EOSEventLab maybe it’s possible to know the focal length by taking a picture and then reading its EXIF. In that case do you know which command I have to use ?

        Many thanks.

        • I’m not sure this is possible. You may want to change it manually and see if you can see corresponding events in the Event Lab. As far as EXIF, the command to take a picture is called a ‘capture’ and the actual processing is up to the application.

          • Etienne

            Thanks for the quick answer!
            Yes I already tried to move the zoom ring to see if it creates an event in EOSEventLab but it doesn’t…
            I have just seen you posted a recent message on this thread: http://www.circuitsathome.com/camera-control/ptp-support-for-usb-host-shield-library-2-0-released

            I’m not aware of the way to get the focal length apart from taking a picture and reading EXIF (on certain models of cams/lenses).

            Maybe I wasn’t clear in my last message but this is exactly what I was thinking about. Therefore do you know which command I have to use in order to read the EXIF of the last taken picture (after having used the ‘capture’ command) ? I was thinking about using GetObjectInfo but it doesn’t seem to return EXIF data.

          • The PTP library only supports simple, low-level functions; there is no EXIF processing code.

  • Knut

    Hi Oleg,
    first of all thank you for developing. I want to build this camera controller but have a few questions about the bracketing options before i do.

    In a post above you wrote:
    “Bracketing is supported in the library, the property name is EOS_DPC_BracketMode. The camera will take 3 shots. Ev method, used in this controller, is more flexible – you set margins (like +/- 6) and step (like 1/3), and controller sets each Ev value and takes a shot.”

    1. How long is the delay between shots?
    2. Can i change the delay.
    3. What is a “save” value for the delay on my 550D?

  • victor

    Hi Oleg

    By any change do you have the poor sony PTP commands?

    A have a alpha99 it cames with some software really limitated, a asume that the PTP is universal.

    A only need the shutter, focus, aperture and shutter speed….?

    Am intent to build the controler using the arduino

    Regrads

  • Hi Oleg,

    I have been trying to compile this code for a couple of days and I have searched for solutions everywhere, but I still cannot get the EOSCameraControl to compile. I am pretty new to Arduino but I have worked on a few projects, usually I would put the libraries into my ‘libraries’ folder in my sketches folder. However I have read a post that has told me to do the following:

    Use Arduino IDE 0022
    Download PTP_2.0
    USB_Host_Shield_2.0
    Create the QEP folder as per your instructions (from pre 4.3 version) Add the AVR Port H file.
    Add the ‘Time’ Library.

    Place all of the whole folders in the libraries folder, so Arduino_0022\libraries\PTP
    Arduino_0022\libraries\USB_Host_Shield_2
    Arduino_0022\libraries\QEP
    Arduino_0022\libraries\Time

    Then open Arduino_0022 and run the EOS CameraControl by navigating to: File-Examples-PTP-Canon EOS-EOSCamController.

    When I attempt to compile this code I get errors:


    EOSCamController.cpp:16:21: error: qp_port.h: No such file or directory
    In file included from EOSCamController.cpp:25:
    hdrcapture.h:20: error: 'Q_USER_SIG' was not declared in this scope
    hdrcapture.h:34: error: expected class-name before '{' token
    hdrcapture.h:40: error: expected class-name before '{' token

    Please could you point me in the right direction, I am eager to get this working and to see if I can eventually add XBee comms.

    Thanks in advance for any help

  • Hi Oleg,

    Thank you very much for your advice, between that and the forums I have compiled and uploaded EOSCamController.

    My next issue is that I am trying to use an LCD Keypad Shield http://www.linkspritedirect.com/product_info.php?products_id=179

    Any help with getting this to work would be excellent, I know the buttons are all on Analog A0. But I’m not sure where to change the code and also the shield library needs to be added I guess. Or I can just get a standalone LCD if that would be much easier.

    Ultimately I am trying to get the controller working over XBee’s to a remote camera. I would be happy to build a gui in flash for example to control it but I really liked the idea of the remote. I would also like to have video start/stop control.

    I would be happy to pay for some time for you to look at this if you were interested, or if you know of anywhere a similar project is posted.

    Thanks Again, look forward to your thoughts.

  • Hello Again Oleg,

    I’m actually going to say thanks for not getting to the question above (Iknow you are busy) as I have persevered and I am almost there!

    I am having a little difficulty adding the Xbee’s to the EOSRemote, I’ve tried a search on this for help but I am unable to find anything relevant. Are you aware of any such support? I am constantly getting connection issues ‘avrdude: stk500_getsync(): not in sync: resp=0x00’ for example and I think this is down to the XBee shield I am using with the USB Host Shield at the same time.

    As before I would really appreciate your help or advice, a point in the right direction.

    Many thanks

  • Andy

    Hi All,

    I am still having problems getting the EOSRemote to work over Xbee’s. I have configured and tested the Xbee’s I have changed the baud rate to 57600, I have changed the baud rate of the sketch to 57600. But when I add the USB Host shield and xbee shield I am unable to get the serial comms to work.

    I am sure that I need to use SoftwareSerial or a Mega 2560 with extra rx/tx.

    But I am unable to find any information about how to get this working with the EOSRemote.

    Please, please can anyone offer advice on this. The EOSREMOTE is excellent but I really need to get it working wirelessly for my project.

    Many thanks in advance

  • Steve P.

    I was wondering if this has been tested on an 1100D (T3)?

  • farseerri

    HI,Mr oleg.I wanted to try to zoom the evf screen,But I can’t find that function. Can you tell me how to zoom or zoompositon?

  • chris

    Hi I recently bought the USB 2 shield from Circuits@Home and I am trying to get it to work with the PTP_2 and USB_HOST_2. I have downloaded and installed the libraries but cannot get the PTPDevInfo Sketch to complile. I get the following error:

    devinfoparser.cpp:3: error: variable ‘DevInfoParser::ptpopNames’ must be const in order to be put into read-only section by means of ‘__attribute__((progmem))’

    const char* DevInfoParser::ptpopNames[] PROGMEM =

    has anyone got this to work? I am trying to use with a Nikon D5500 camera

  • Tim O.

    I am looking to Arduino to solve a particular problem with twin cameras for shooting stereo. This code looks promising in allowing the settings on one camera to be immediately transferred to a second identical camera. Would this be possible? I have done nothing with Arduino before so I will have to learn from scratch, but if I know it will work, it is worth learning for me.

  • Nikolay

    Try it:

    const char* const PTPObjInfoParser::acNames[] PROGMEM =
    {
    msgUndefined,
    ……….
    };

    class PTPObjInfoParser : public PTPReadParser
    {
    static const char* const acNames[];
    ……………
    };