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

  • Oleg you are a friggin genius ! ๐Ÿ™‚ When I grow up I wanna be like you ! ๐Ÿ™‚

    I am only a photographer but would sooooo much be able to build one of these little things.

    Are you available to assemble one for a fee ?

    Thanks and happy XMas
    Robert

  • Kay

    Hi Oleg!

    Why didn’t I find this page before?
    I just started researching for pretty much the same project, controlling a DSLR (7D in my case, but eventually I’d like to make it general purpose enough) for timelapse and high-speed photography without having to carry around a laptop, since that poses problems mainly related to power supply for timelapse (think sitting around for 8+ hours).

    I’ll start looking around what you have so far, and then get the necessary parts together to get to a point where I can make it do something useful. Please feel free to contact me if you have stuff you’d like to offload/discuss etc.

    Thanks for the work and posts so far!

    cheers,
    -k

  • Ribeiro Santos

    Hi,
    First of all thanks by sharing your great work!

    I have one Canon 60D, which hasn’t available micro focus in the cameraยดs menu, but it’s available by using the EOS Utility (in PC).

    My question: can you help me if is possible to use “micro focus” using your “Arduino-based controller”?

    Thanks again,
    Ribeiro Santos

    • I’m not familiar with 60D; if micro-focusing means analyzing liveview image, Arduino may not have enough resources to handle it.

      • Ribeiro Santos

        Hi, Micro-focusing (to me) means that I can command the motor lens to go step up or down (like manual focus, but with more precision).

        • If you can move focus with EOS Utility, your camera most likely supports it via PTP – take a look at the source code in the PTP library to see what’s involved.

  • Tom

    Thanks for all the great info!

    I’m trying to find a way of powering an atmega32u2 with 3.3v directly from the camera, perhaps using the hot shoe connector, the usb port or the remote port – does anyone have any ideas for what might work?

  • Renee

    Thank you so much for everything, I know my Photo class is going to love this!

    I had a small issue compiling though. In the qep_port.h file the line “#include ” needed to be switched to #include .

  • Renee

    Oops, I guess comments don’t accept that kind of code. Just watch out for #include avr/pgmspace.h , the original line had a \ instead of /

  • karsten

    Hello Oleg,

    after my browser crashed, I dropped my comment to the wrong blog entry, so here my request again,

    Would it be possible to obtain a kind of a minimal shopping list to get a clone of your controller?

  • ianlpowell

    Hi Oleg,
    I have lashed up a board and am controlling my EOS 1d mk IV from it. I am mainly interested in focus stacking, however although the focus controls works OK in live mode, when a capture is done the camera does an autofocus which is not very helpful. I noticed that in Canonโ€™s EOS Utility there is a switch for AF to MF which switches to โ€œRemote Manualโ€. Do you know what or where I can find the command/property value for this?

    • karsten

      Hello ian,

      I’d suggest to take a linux or mac os box and run “gphoto2 –summary” and “gphoto2 –list-config” on the cam, here you should find all ptp-supported options. On a Mac you have to kill ptpcamera via activity monitor first.

  • Razek

    Hello, Oleg!
    Is USB host shield mini compatible with the Arduino Nano v4?

    • I can’t see v4 on Arduino site, the latest rev listed is 3. It’s 5V board, you probably can make it work, but in my opinion it’s not worth it. Get yourself Sparkfun’s Arduino Pro Mini.

      • Razek

        Yes, it is my mistake, Iam to confuse with carduino v4, it is arduino v3 with the small changes.

        USB Host Shield for Arduino 5v is for USB devices without self power,
        3.3v the version for devices with own power? Right?
        And what of difference between simple/minimum versions?

        Do u ship to Russia?

        • 5V is for Arduinos which don’t have 3.3V on-board. 3.3V generates 5V so it’s good if you want to run bus-powered device and only have 3.3V. Simple is compatible with standard Arduinos which have both 5V and 3.3V, minimal runs off of 3.3V and don’t generate 5V, so it’s useful when you use self-powered device, such as digital camera.

          I do ship to Russia.

  • Fernando

    Oleg,

    Thanks again for putting this information together. I’m planning to build one based on your schematic, but I haven’t found any small 16×2 LCD (3.3 volts) that fits my enclosure, the only one is this, but is 5 volts:

    http://cgi.ebay.com/Ultra-tiny-1-5-mini-LCD-1602-w-FPC-Connector-Backlight-/270651814877?pt=LH_DefaultDomain_0&hash=item3f041af3dd

    How I can make it work?

    Thanks

  • ianlpowell

    Hi karsten,

    Thank you for your suggestion. I have since my last comment had a look at the USB traffic whilst using the Canon Utility program. I found that operation 0x9128 and 0x9129 were key, but the problem was the camera was trying to upload an Image to the Arduino which caused hang-ups.

    Further investigation found that CaptureDestination property controls where the images go.
    Ie 2 sends it on the camera and 4 sends it to the USB so 6 sends it to both.

    I have so far determined the code below works with live view turned off, but is far from optimum, so more work needs to be done.

    uint32_t params[2];
    Eos.SetProperty(EOS_DPC_CaptureDestination, 2);

    params[0] = (uint32_t) 1;
    params[1] = (uint32_t) 1;
    Eos.Operation(0x9128, 2, params);
    delay(500);
    params[0] = (uint32_t) 2;
    params[1] = (uint32_t) 1;
    Eos.Operation(0x9128, 2, params);
    delay(500);
    params[0] = (uint32_t) 2;
    delay(500);
    Eos.Operation(0x9129, 1, params);
    params[0] = (uint32_t) 1;
    Eos.Operation(0x9129, 1, params);

  • kengu

    oleg:
    This is very cool.
    Can I use “Arudino mini pro 328” and “Usb Host Mini” to run your program ?

  • kengu

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

    what’s wrong ? where is MemoryFree.h ????

    somebody help…

  • kengu

    MemoryFree.h error is OKใ€‚Thanks,Oleg.
    But I have a new error,When I compilling EOSCamController program:
    Fatal error: can’t create CanonEOS\ptp.cpp.o: No such file or directory. Please……

  • kengu

    Thans.I will check it.
    Oleg, about Canon DSLR video mode,Your progress?Haha…

  • M

    I’m getting “Setup packet error: D” when using my 40D. Any suggestions?

  • Adam

    I want to purchase the necessary gear to play with these codes, I see the Arduino is readily available, but the USB Host Shield is retired. Are there any forms of the Arduino with this built in now, or a different version available?

  • Adam

    I have tried compiling the EOSFOCUS code for an Arduino UNO, but am prompted with a ton of errors, is the UNO compatible with your code base? if it is compatible, is there an updated code? I can send you a screenshot if you like.

    • The code is the same for all Arduinos. Post your errors here (not all of them, first 5-10 will suffice).

      • Adam

        First it tells me:

        ptp.h:24:22: error: Max3421e.h: No Such file or directory
        And it repeats this for every file from the code package.

        Then it states:
        ptp.h:76: error: ‘MAX3421E’ does not name a type
        This is also repeated for ‘USB’ and ‘EP_RECORD’

        And just as many errors appear stating that ‘PTPReadParser’ has not been declared.

        Any thoughts?

  • kengu

    I always unable to connect to the 5D mark II camera.
    Use Arduino Nano3.0,MiniUSB to camera,Power is two peices of Lipro 3.7V battery,running the “EOSFOCUS” or other sample program.
    The camera must turn on “AF” at the lens. isn’t ?
    What exactly is wrong? I am sad.

    • 2 things are wrong:
      1. The power is too high. MAX3421E is 3.3V part, it won’t recognize device connection when powered from 7.4V. It actually can be damaged by this voltage.

      2. Arduino Nano 3.0 is 5V device, it is not compatible with this shield. You need 3.3V Arduino, for example this one -> http://www.sparkfun.com/products/9220

  • kengu

    I haven’t received orders of your usb host mini. Now, I understand, your sample program must be made to establish MAX3421E of “USB HOST MINI” ARDUIO with USB communication between cameras. is’t?

  • kengu

    Please forgive my foolishness. Thanks for your help.
    I continue to wait your Usb-HOST-MINI.Thanks.

  • I need help… I developed all the necessary to drive the internal focusing motors of the otpics, all it’s okay, I drive it with an encoder. Now I need to find the property to start/stop Movie mode. I know that the property for capture is: 0x910f … domeone can help me? I am not able to understand whic are the properties to start movie. thanks – Fulvio

  • Fernando

    Hi Oleg,

    I just finished testing the OLEG_Timer_HDR_Do-it-all_Intervalometer_Awesome_Remote-Control_Thing you’ve created and I’m very HAPPY and impressed.

    First, your instructions are very clear and simple to follow, for first time I compiled and uploaded a pde without any issues.

    As far as the hardware goes, I was lucky enough not to have any problems. I used the mini LCD (I mentioned above from ebay) and the LiPower to bump the voltage from 3 to 5V. I used your schematics and added a on-off switch for backlight control (trying to save some battery).

    The menu is very intuitive to use, I was able to shoot with it right away. Having all the options (SELF timer, FRaMeS, BracKeTing, INTervalometer) is very handy.

    Why BKT is not working in manual mode and how I have to set it to use mirror lockup when bracketing?

    Thanks a lot for sharing your knowledge…

    Fernando

    • This is very cool! Are you going to post your project – if yes, send me a link, please?

      In this controller, bracketing works just like in the camera, i.e., by changing Ev compensation value. You can set the end value(s) and step and controller will shoot each step from Ev- to Ev+. Ev comp is not available in Manual mode, that’s why it isn’t working. Manual mode bracketing can be implemented but I can’t come up with a good interface – the operator would have to set actual shutter speeds for the end values and then number of steps would be either un-configurable (just shoot all speeds between min and max), or very inflexible – you won’t be able to set arbitrary step, the number of possible steps should be divisible by set step (i.e., if you have 5 speed values distance between min and max, you won’t be able to set 2,3, or 4, but only 1 or 5). That being said, if you have a good idea about how manual bracketing interface shoul look like, share it and I’ll make it happen ๐Ÿ™‚

      I’m working on the next revision of this controller with many extra features and mirror lockup is on the list.

  • karsten

    Hello Oleg,

    for my HDR Controller I plan to implement the EV Comp approach as well. For the manual mode, I’d take the metered shutter speed and double, half, quarter etc. By setting an EV value one could find the desired shutter speed, selecting the closest available value to the calculated one from the cam. Here another problem comes in, for a night hdr, the 30s maximum shutter speed most cameras offer is not sufficient, so one needs the bulb mode bracketing and an extra shutter cable, as shutter speeds above 30s can not be triggered by usb (okay, the latest Canon cams can, but no Nikon cameras). The shutter cable would greatly speed up shooting as well, as triggering by the shutter cable is much easier than via usb and the camera fires instantly. Set the desired settings via usb, shoot via shutter cable. One drawback would be, that those shutter cables can be camera specific.

    • Shutter cable release is not instant. There is a delay from contact closing to shutter open and then another one from contact open to shutter closing. See this thread -> http://timescapes.org/phpBB3/viewtopic.php?f=28&t=1893 Actually, USB is faster, but for precise time intervals a flash sync signal must still be monitored. I’m playing with idea to add cable release interface to this cam.controller for long exposures and also bulb ramping. The interface for Canons and Nikons should be the same.

      • karsten

        okay, my fault, as my impression from a promote control was the “speed up” with a shutter cable.

        • It may be firmware-specific. PTP code actually gives lesser delay than cable since de-bouncing is not necessary. But we are talking about times in the range of tens of milliseconds; practically, there is no difference.

          • karsten

            ๐Ÿ™‚ i soldered a srew shield from sparkfun today to have no issues with the wiring, so i’m looking forward to have my cam controller at the weekend up and running, first with your code version. I hope i can alter it to be working with my nikon as well. then i want to add the bulb mode triggering.

  • Raf

    Hi all,
    I have two Canon 5D Mark-II and I’m trying to build a stereo system. For this I need to focus both cameras at the same distance, and shoot them simultaneously. This could be done with Canon’s SDK but ONLY in LiveView (that is, with the mirror up). Then, when you shoot using the SDK, both mirrors go down, take the picture, and then the mirror goes up again to refocus to the next distance. This is too slow.
    I have a simple question: does your Arduino-based controller allow to focus WITHOUT being in LiveView mode? If so, I’d be great. And congratulations for the project!

    • This is not specific to SDK – to move focus via USB Canon EOS Cameras have to be in LiveView mode.

    • Are you talking about sync two 5DMKII for photograph or video?
      You can take photo also without to be in liveView, I did it with an external arduino board

  • Karl-Walter Weller

    i have many problems, when i compile the examples,
    what is wrong????

    Sorry, for my bad english.

    this is my directory structure:

    directory of D:\Arduino Mega\arduino-0022\libraries\Arduino_Camera_Control

    31.03.2011 09:07 examples
    21.02.2011 12:16 6.081 canoneos.cpp
    21.02.2011 12:16 5.088 canoneos.h
    21.02.2011 12:16 2.193 canonps.cpp
    21.02.2011 12:16 6.735 canonps.h
    21.02.2011 12:16 618 copying.txt
    21.02.2011 12:16 10.613 eosvaluetitles.h
    21.02.2011 12:16 18.349 gpl2.txt
    21.02.2011 12:16 10.553 mtpconst.h
    21.02.2011 12:16 13.657 psvaluetitles.h
    21.02.2011 12:16 23.001 ptp.cpp
    21.02.2011 12:16 8.094 ptp.h
    21.02.2011 12:16 1.762 ptpcallback.cpp
    21.02.2011 12:16 3.603 ptpcallback.h
    21.02.2011 12:16 10.798 ptpconst.h
    21.02.2011 12:16 3.121 ptpdebug.cpp
    21.02.2011 12:16 2.280 ptpdebug.h
    21.02.2011 12:16 7.305 ptpdpparser.h
    21.02.2011 12:16 5.251 ptpmsgstr.h
    21.02.2011 12:16 300 README
    21.02.2011 12:16 2.096 scheduler.cpp
    21.02.2011 12:16 8.020 scheduler.h
    21.02.2011 12:16 2.068 simplefifo.h
    21.02.2011 12:16 2.144 simpletimer.cpp
    21.02.2011 12:16 3.511 simpletimer.h
    21.02.2011 12:16 5.692 valuelist.h

    directory of D:\Arduino Mega\arduino-0022\libraries\USB_Host_Shield

    31.03.2011 09:27 examples
    24.02.2011 18:26 19 .gitignore
    24.02.2011 18:26 9.572 ch9.h
    24.02.2011 18:26 9.812 Max3421e.cpp
    24.02.2011 18:26 1.464 Max3421e.h
    24.02.2011 18:26 6.448 Max3421e_constants.h
    24.02.2011 18:26 6.944 Max_LCD.cpp
    24.02.2011 18:26 2.264 Max_LCD.h
    24.02.2011 18:26 200 README
    24.12.2010 16:48 1.564 SPI.cpp
    24.12.2010 16:48 1.680 SPI.h
    24.02.2011 18:26 16.625 Usb.cpp
    24.02.2011 18:26 10.905 Usb.h

    directory of D:\Arduino Mega\arduino-0022\libraries\qep

    31.03.2011 08:55 5.793 qassert.h
    01.11.2010 20:17 2.221 qep.cpp
    01.11.2010 20:17 10.740 qep.h
    01.11.2010 20:17 2.594 qep_pkg.h
    12.12.2009 18:24 1.941 qep_port.h
    01.11.2010 20:17 6.825 qevent.h
    01.11.2010 20:17 3.251 qfsm_dis.cpp
    01.11.2010 20:17 2.517 qfsm_ini.cpp
    01.11.2010 20:17 12.529 qhsm_dis.cpp
    01.11.2010 20:17 2.203 qhsm_in.cpp
    01.11.2010 20:17 3.468 qhsm_ini.cpp
    01.11.2010 20:17 1.588 qhsm_top.cpp
    01.11.2010 20:17 4.534 qs_dummy.h

    Compiling EOSCamController:

    ompiling is ok.
    Binary sketch size: 27602 bytes (of a 30720 byte maximum)

    Compiling PTPCapture:

    PTPCapture:27: error: expected class-name before ‘{‘ token
    PTPCapture:33: error: ‘PTP’ has not been declared
    PTPCapture:34: error: ‘PTP’ has not been declared
    PTPCapture:37: error: ‘PTP’ does not name a type
    PTPCapture:39: error: variable or field ‘OnDeviceDisconnectedState’ declared void
    PTPCapture:39: error: ‘PTP’ was not declared in this scope
    PTPCapture:39: error: ‘ptp’ was not declared in this scope

    Compiling PTPDevInfo:

    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

    • For PTPDevInfo, try to take out extra path from #include-s in devinfoparser.h, i.e make them look like “#include or “#include “ptpconst.h”. The same will probably work for PTPCapture as well.

  • Adam

    What particular type of switch/dial are you using for the focus?

  • Pete

    With this method you save the image on the memory card, and then you have to transfer it manually, right? I want to use my cam as a webcam with a Arduino board.
    I know the Arduino don’t have enough memory to store a image in memory, but it is possible to transfer the image directly to another computer with the Arduino Pro Mini 328 and XBee board when the photo have been taken? gPhoto2 already supports saving a file from a camera. I’m just not sure about Arduino’s hw limits here..

  • Pete

    Yeah, I guess so. Thanks for the answer. Are you planning to add the transfer code into the git project?

  • muk

    hi oleg !
    great work !
    i would like to know if it is possible to wake up the cam via usb also ?
    thx
    BR
    muk

    • AFAIK, no. When camera goes to sleep, it disappears from USB bus; therefore, there is no way to talk to it until you wake it up some other way, like half-pressing the shutter button.

  • Thank you so much for developing so good and practical code. I’m using your code for my canon 7D. Thank you again!
    Regarding: “controller for Canon DSLR video mode” have you have any update of your code for video mode.
    I love to hear news from you. ๐Ÿ™‚

  • Cronix

    Hi Oleg,

    This looks really great. Do you thing it might be possible to control Nikon cameras the same way? I am willing to invest time to code this out myself, but a little bit more insight would be great!

    Thanx,
    Cronix

    • Nikon DSLRs use different set of commands, most of them are standard PTP rather than proprietary. Because of that, developing should be easier.

  • Francis

    Hi Oleg,
    I’m using your code (EOSRemote) for my Canon 500D. I can only change Shutter Speed, Pict Style and Exp Comp values nothing else ?
    Thanx,
    Francis

    • Pouet

      Hi Francis,

      I also have a 500D + Arduino with Atmega 328P + USB Shield V2.0. I’m using the USB Host Shield librarie v1 and the EOSRemote example. I tryed to play with all parameters (Shutter Speed, Aperture, etc…) and it seems that some of them will not be affected, depending of the mode you select on your camera.

      I noticed that in manual mode (M) I can’t set the ISO parameter.

      PS: Oleg, thank you very much for all this work on USB host shield + libraries.

      Best,
      Pouet

  • manis404

    After following your instructions on libraries, I tried to compile the EOSRemote.pde.

    I get the following errors at compile time:

    In file included from C:\Users\1048576\Arduino0022\arduino-0022\libraries\ardcamcntrl/ptp.h:29,
    from sketch_aug07a.cpp:7:
    C:\Users\1048576\Arduino0022\arduino-0022\libraries\ardcamcntrl/ptpdebug.h:28: error: redefinition of ‘template void PrintHex(T)’
    C:\Users\1048576\Arduino0022\arduino-0022\libraries\USBHost2/printhex.h:23: error: ‘template void PrintHex(T)’ previously declared here
    C:\Users\1048576\Arduino0022\arduino-0022\libraries\ardcamcntrl/ptpdebug.h:43: error: redefinition of ‘template void PrintHex2(Print*, T)’
    C:\Users\1048576\Arduino0022\arduino-0022\libraries\USBHost2/printhex.h:38: error: ‘template void PrintHex2(Print*, T)’ previously declared here
    In file included from sketch_aug07a.cpp:7:
    C:\Users\1048576\Arduino0022\arduino-0022\libraries\ardcamcntrl/ptp.h:86: error: ‘EP_RECORD’ does not name a type
    C:\Users\1048576\Arduino0022\arduino-0022\libraries\ardcamcntrl/ptp.h: In member function ‘void PTP::Setup()’:
    C:\Users\1048576\Arduino0022\arduino-0022\libraries\ardcamcntrl/ptp.h:124: error: ‘class MAX3421E’ has no member named ‘powerOn’

    Any idea what I am doing wrong here?

    • The current PTP code is not compatible with USB Host 2.0 library. Please use the old library for the time being, I’m finishing testing new PTP code, hoping to get it released soon.

  • Pixel_K

    Hi, and thank you for you great work. Two questions :
    – Any idea when the 2.0 compatible PTP will be released ?
    – Any hint on how CanonEOS::MoveFocus should be used ?
    I would like to be able to move the focus Backward and Forward, and also know if you know which kinf of steps it uses ( The canon EOS utility has 3 different step size for moving the focus).
    As the CanonEOS::MoveFocus is an unsigned int, I’m quite confused how I could move both ways. I tried a few values but my Canon 7D didin’t move the focus at all (the lens was in Autofocus Mode, if that helps).

  • Hi Oleg I am finding it hard to get the EOSRemote sketch to compile, can I maybe contact you on skype or email ?

  • psychospiller

    Hi Oleg, This is a great work with Arduino. Can you tell me if the libraries you have used would also have potential to get/set camera meta data that would appear as EXIF data in output JPEG files ? Thanks

    • Some meta can be set with commands already implemented in current code base. Other would require re-processing of JPEG files, stored in camera – it is also possible but requires some coding.

  • ziga

    Hi i am interested in making a simple start stop buttun for video on canon eos 5d mark II. the switch would be connected via usb. i have arduino uno. is this even possible via the usb. i know it is possible in EosUtility for pc. can you direct me to the code i should use?

    thanks
    Ziga

  • Zsolt

    I got these errors trying to compile EOSCamControler from
    Arduino_Camera_Control

    ptp.h:59: error: expected class-name before ‘{‘ token
    ptp.h:82: error: ‘EpInfo’ does not name a type

    or these errors from PTP, CAM_EOS, EOSCamControler

    In file included from EOSCamController.cpp:25:
    hdrcapture.h: In constructor ‘HDRCapture::HDRCapture(CanonEOS&)’:
    hdrcapture.h:93: error: no matching function for call to ‘QFsmTag::QFsmTag(QState (*)(void*, const QEvent*))’
    qep.h:77: note: candidates are: QFsmTag::QFsmTag()
    qep.h:77: note: QFsmTag::QFsmTag(const QFsmTag&)
    hdrcapture.h: In member function ‘void HDRCapture::Run()’:
    hdrcapture.h:107: error: ‘dispatch’ was not declared in this scope
    EOSCamController.cpp: In function ‘void MenuRun()’:
    EOSCamController:448: error: ‘class CamHDRCapture’ has no member named ‘dispatch’
    EOSCamController:453: error: ‘class CamHDRCapture’ has no member named ‘dispatch’
    EOSCamController:458: error: ‘class CamHDRCapture’ has no member named ‘dispatch’
    EOSCamController:466: error: ‘class CamHDRCapture’ has no member named ‘dispatch’
    EOSCamController:471: error: ‘class CamHDRCapture’ has no member named ‘dispatch’
    EOSCamController.cpp: In function ‘void setup()’:
    EOSCamController:583: error: ‘class CamHDRCapture’ has no member named ‘init’

    • You need to follow instructions in the article. Alternatively, you may want to use version of the controller included in PTP 2.0 distro.

  • Zsolt

    I did follow all instructions and I got the same error from PTP 2 and EOSCamController

    In file included from EOSCamController.cpp:25:
    hdrcapture.h: In constructor ‘HDRCapture::HDRCapture(CanonEOS&)’:
    hdrcapture.h:93: error: no matching function for call to ‘QFsmTag::QFsmTag(QState (*)(void*, const QEvent*))’
    /Arduino/Sketchbook/libraries/gep/qep.h:77: note: candidates are: QFsmTag::QFsmTag()
    /Arduino/Sketchbook/libraries/gep/qep.h:77: note: QFsmTag::QFsmTag(const QFsmTag&)
    hdrcapture.h: In member function ‘void HDRCapture::Run()’:
    hdrcapture.h:107: error: ‘dispatch’ was not declared in this scope
    EOSCamController.cpp: In function ‘void MenuRun()’:
    EOSCamController:448: error: ‘class CamHDRCapture’ has no member named ‘dispatch’
    EOSCamController:453: error: ‘class CamHDRCapture’ has no member named ‘dispatch’
    EOSCamController:458: error: ‘class CamHDRCapture’ has no member named ‘dispatch’
    EOSCamController:466: error: ‘class CamHDRCapture’ has no member named ‘dispatch’
    EOSCamController:471: error: ‘class CamHDRCapture’ has no member named ‘dispatch’
    EOSCamController.cpp: In function ‘void setup()’:
    EOSCamController:583: error: ‘class CamHDRCapture’ has no member named ‘init’

  • Zsolt

    I forgot, I use Apple version of Arduino.

  • Zsolt

    the error is from HDRCapture

    no matching function for call to ‘QFsmTag::QFsmTag(QSate (*)(void*,const QEvent*))’

    any idea?

  • Zsolt

    OK. here is the problem and solution. I’m running Apple version of Arduino software. If you want to compile EOSCamController from Arduino_camera_control, then both USB_Host_Shield_2 and PTP2 libraries need to be moved out from the arduino library (or deleted), otherwise they will conflict with the other libraries when you try to compile the code. You also need to use old version of Arduino compiler not the latest 1.0

    To compile EOSCamController from PTP2 you need to copy all files from qcpp_x.xx/include under your new Arduino/library/gep and use the latest Arduino compiler (1.0). It won’t compile with older versions.

    It works for me now… I like this article, but these details are missing.

  • Jools Palmer

    Oleg:
    First things first, wow excelent piece of development. I’m trying and failing in a big way to get the various pieces of code to compile, I do have version 2 of USB_Host and I’m bound to be doing something really stupid, like having a file in the wrong folder. I have attached by compile error list below. Any help would be greatly apprecieted.

    In file included from C:\arduino-1.0\libraries\Camera_Control/ptp.h:28,
    from EOSHDRCapture.cpp:10:
    C:\arduino-1.0\libraries\Camera_Control/ptpcallback.h:22:22: error: WProgram.h: No such file or directory
    In file included from EOSHDRCapture.cpp:12:
    C:\arduino-1.0\libraries\qep/qep_port.h:40:79: error: qep.h: No such file or directory
    In file included from C:\arduino-1.0\libraries\Camera_Control/ptp.h:29,
    from EOSHDRCapture.cpp:10:
    C:\arduino-1.0\libraries\Camera_Control/ptpdebug.h:28: error: redefinition of ‘template void PrintHex(T)’
    C:\arduino-1.0\libraries\USB_Host_Shield/printhex.h:27: error: ‘template void PrintHex(T)’ previously declared here
    C:\arduino-1.0\libraries\Camera_Control/ptpdebug.h:43: error: redefinition of ‘template void PrintHex2(Print*, T)’
    C:\arduino-1.0\libraries\USB_Host_Shield/printhex.h:42: error: ‘template void PrintHex2(Print*, T)’ previously declared here
    In file included from EOSHDRCapture.cpp:10:
    C:\arduino-1.0\libraries\Camera_Control/ptp.h:86: error: ‘EP_RECORD’ does not name a type
    C:\arduino-1.0\libraries\Camera_Control/ptp.h: In member function ‘void PTP::Setup()’:
    C:\arduino-1.0\libraries\Camera_Control/ptp.h:124: error: ‘class MAX3421E’ has no member named ‘powerOn’
    In file included from EOSHDRCapture.cpp:14:
    /hdrcapture.h: At global scope:
    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
    EOSHDRCapture.cpp: At global scope:
    EOSHDRCapture.pde:-1: error: ‘QEvent’ does not name a type
    EOSHDRCapture.pde:-1: error: ‘QEvent’ does not name a type
    EOSHDRCapture.cpp: In member function ‘virtual void CamStateHandlers::OnDeviceInitializedState(PTP*)’:
    EOSHDRCapture.pde:-1: error: ‘struct SetEvt’ has no member named ‘sig’
    EOSHDRCapture.pde:-1: error: no matching function for call to ‘HDRCapture::PostEvent(SetEvt*)’
    /hdrcapture.h:99: note: candidates are: void HDRCapture::PostEvent(int*)
    EOSHDRCapture.pde:-1: error: ‘msTick’ was not declared in this scope
    EOSHDRCapture.cpp: In function ‘void setup()’:
    EOSHDRCapture.pde:-1: error: ‘class HDRCapture’ has no member named ‘init’
    EOSHDRCapture.pde:-1: error: ‘struct SetEvt’ has no member named ‘sig’
    EOSHDRCapture.pde:-1: error: ‘class HDRCapture’ has no member named ‘dispatch’
    EOSHDRCapture.pde:-1: error: ‘struct SetEvt’ has no member named ‘sig’
    EOSHDRCapture.pde:-1: error: ‘class HDRCapture’ has no member named ‘dispatch’
    EOSHDRCapture.pde:-1: error: ‘struct SetEvt’ has no member named ‘sig’
    EOSHDRCapture.pde:-1: error: ‘class HDRCapture’ has no member named ‘dispatch’
    EOSHDRCapture.pde:-1: error: ‘struct SetBktEvt’ has no member named ‘sig’
    EOSHDRCapture.pde:-1: error: ‘class HDRCapture’ has no member named ‘dispatch’
    EOSHDRCapture.pde:-1: error: ‘msTick’ was not declared in this scope

  • Jools Palmer

    Thanks Oleg:
    I downloaded it and decided to start again fresh installing everything and I’ve nearly got it cracked. I think I’m still missing a file, all the Canon programs now complie OK with the exception of EOSCamController, EOSHDRCapture & EOSRemote. error report below for HDRCapture.
    Also is there any way to put line numbers down the left hand side of the Arduino 1.0 displayed tab files. Th complier error log refers to, for example ‘hdrcapture.h:93’ which is I assume is file tab hdrcapture.h, line 93?

    Thanks in advance, Jools.

    In file included from EOSHDRCapture.cpp:18:
    /hdrcapture.h: In constructor ‘HDRCapture::HDRCapture(CanonEOS&)’:
    hdrcapture.h:93: error: no matching function for call to ‘QFsmTag::QFsmTag(QState (*)(void*, const QEvent*))’
    C:\Tools\arduino-1.0\libraries\USB/qep.h:84: note: candidates are: QFsmTag::QFsmTag()
    C:\Tools\arduino-1.0\libraries\USB/qep.h:84: note: QFsmTag::QFsmTag(const QFsmTag&)
    /hdrcapture.h: In member function ‘void HDRCapture::Run()’:
    hdrcapture.h:107: error: ‘dispatch’ was not declared in this scope
    EOSHDRCapture.cpp: In function ‘void setup()’:
    EOSHDRCapture.pde:-1: error: ‘class HDRCapture’ has no member named ‘init’
    EOSHDRCapture.pde:-1: error: ‘class HDRCapture’ has no member named ‘dispatch’
    EOSHDRCapture.pde:-1: error: ‘class HDRCapture’ has no member named ‘dispatch’
    EOSHDRCapture.pde:-1: error: ‘class HDRCapture’ has no member named ‘dispatch’
    EOSHDRCapture.pde:-1: error: ‘class HDRCapture’ has no member named ‘dispatch’

    • Please use pre-4.30 version of QP and pre-1.0 version of Arduino IDE. It is no longer possible to have code which would compile on every combination of Arduino and QP.

  • Jools Palmer

    Thanks Oleg:
    I’ve had a quick search of both the arduino and qp sites and the web looking for the previous versions software as you suggested with no joy, have you or anyone else got copies they can direct me to or email me.
    Thanks Jools

  • Jools Palmer

    Oleg:
    After much trial and error with Arduino 0022, PTP 2.0, USB Host Shield 2.0, qpccp 4.1.01 & qdkccp avr gnu 4.1.01 & Time I seem to have all the components in the right place. Plus I played with #include “xxxx” and and pasted in alot of *.h files that weren’t originally asked for, I can get all the simple sketches to compile OK. I’m still having trouble with EOSHDRCapture though, anything that uses includes within the examples folder seems to fail. Do I need to copy these #include “xxx” files into the main library and use #include in the .cpp files instead?
    Below is the compile error list, any ideas please.

    hdrcapture.cpp.o:(.data.expComp+0x0): multiple definition of `expComp’
    EOSHDRCapture.cpp.o:(.data.expComp+0x0): first defined here
    EOSHDRCapture.cpp.o: In function `HDRCapture::~HDRCapture()’:
    EOSHDRCapture.cpp:(.text._ZN10HDRCaptureD0Ev+0x18): undefined reference to `operator delete(void*)’
    qep\qhsm_ini.cpp.o: In function `~QHsm’:
    C:\Users\J.Palmer\Documents\Oleg\arduino-0022\libraries\qep/qhsm_ini.cpp:39: undefined reference to `operator delete(void*)’

    Many thanks

    Jools

  • Greg Gillies

    Hi,
    Firstly, thanks for an excellent project. This is THE remote I’ve been waiting for!
    I have a few questions which will help me decide how ambitious to be when building this for myself. I don’t expect you to do any of the work, just to let me know if it’s possible and I’ll then work out how (although help is always welcome ;-)).
    I realise a lot of customisations will be required to the code, and I’m happy to (try to) do them.

    1. Once the firmware is downloaded, is it possible to remove the ATMEGA328 from the Arduino board and incorporate it into a more basic (home made) board?
    2. I plan to use the spare pins to incorporate sensors to trigger the camera (e.g. piezo, ultrasonic, light beam, sound). Is this likely to work?
    3. Would a small solar panel (e.g. 10x15cm) help keep the battery topped up if this was used as a “camera trap”?
    4. (This is for next year!) Could this be coupled with an ethernet shield and/or WiFi shield to enable remote shooting and wireless file transfer รก la WFT-E7?

    Any comments appreciated
    Regards
    Greg.

  • GDSaverio

    Hi…
    I’ve assembled Arduino-Mega and the USB-Host-Shield-2.
    Then I’ve downloaded and unzipped in Arduino’s ‘libraries’ whit the (name):
    felis-Arduino_Camera_Control-4f5b1bf.zip (Camera_Control)
    felis-USB_Host_Shield-4cae57e.zip (USB_Host_Shield)
    felis-USB_Host_Shield_2.0-92e25ae.zip (USB_Host_Shield_2)
    felis-PTP_2.0-757ca0a.zip (PTP2)

    When I try to compile EOSCapture I get a lot of compilation errors:

    In file included from EOSCapture.cpp:6:
    I:\arduino-1.0\libraries\USB_Host_Shield/Max3421e.h:9:22: error: WProgram.h: No such file or directory
    EOSCapture.cpp:14:24: error: MemoryFree.h: No such file or directory
    In file included from EOSCapture.cpp:6:
    I:\arduino-1.0\libraries\USB_Host_Shield/Max3421e.h:16: error: ‘byte’ does not name a type
    I:\arduino-1.0\libraries\USB_Host_Shield/Max3421e.h:18: error: ‘byte’ has not been declared
    I:\arduino-1.0\libraries\USB_Host_Shield/Max3421e.h:18: error: ‘byte’ has not been declared
    I:\arduino-1.0\libraries\USB_Host_Shield/Max3421e.h:19: error: expected ‘;’ before ‘(‘ token
    I:\arduino-1.0\libraries\USB_Host_Shield/Max3421e.h:20: error: ‘byte’ has not been declared
    I:\arduino-1.0\libraries\USB_Host_Shield/Max3421e.h:21: error: ‘byte’ does not name a type
    ………….

    I think the error is to use USB_Host_Shield and USB_Host_Shield_2 and so I delete the first library and use only the vers.2 but :
    EOSCapture.cpp:7:32: error: Max3421e_constants.h: No such file or directory
    EOSCapture.cpp:14:24: error: MemoryFree.h: No such file or directory
    ……….
    In effect Max3421e_constants.h is in the first version

    If I use only the first version of thist library I’ve these errors:
    In file included from EOSCapture.cpp:6:
    I:\arduino-1.0\libraries\USB_Host_Shield/Max3421e.h:9:22: error: WProgram.h: No such file or directory
    In file included from I:\arduino-1.0\libraries\PTP2/ptp.h:26,
    from EOSCapture.cpp:11:
    I:\arduino-1.0\libraries\PTP2/ptpdebug.h:22:22: error: printhex.h: No such file or directory
    I:\arduino-1.0\libraries\PTP2/ptpdebug.h:23:21: error: hexdump.h: No such file or directory
    I:\arduino-1.0\libraries\PTP2/ptpdebug.h:24:21: error: message.h: No such file or directory

    Where is my error ?????

    A lastquestion:
    Why don’t you zip all necessary library files in one only file.zip ?

    Scuse me for my english
    Saverio

    • You need USB Host Shield 2.0 and PTP 2.0 libraries. Make sure you don’t have anything left of old libraries in your libraries directory – it seems that you’re trying to compile an example from an old library using new code.

  • GDSaverio

    IMPORTANT (for me !)
    Without any change, I’m able to compile the PTP2’s example sketches.
    I’d uploaded on my Arduino these sketches:
    EOSFocus, EOSBulb and EOSCapture
    I’ve connected my Eos 350D but I only have:

    Start
    EOS Init
    PTP Init

    and no actions from my Eos

    Many thanks
    Saverio

    • I don’t have this camera myself; IIRC there is a menu setting which switches USB interface between different modes. Also, try this -> https://github.com/felis/PTP_2.0/tree/master/examples/ptpsketches/PTPDevInfo , it is easier to troubleshoot.

      EOSFocus and EOSBulb won’t work with this camera.

      • GDSaverio

        I don’t want to stress you but… I’ve compiled the PTPDevInfo but I only have:
        Start
        PTP Init

        but if my camera is on stand-by it writes me
        Start
        Camera disconnected

        Where can I find a document where and how to put the setting of my own camera?
        and a basic documentation for your libraries ?

        Pardon me… 8-(
        Saverio

        • I remember somebody having issues wtih 350D. The camera might be too old. Just out of curiosity, try another camera with PTPDevInfo ( could be any P&S with USB ).