Digital camera control code AKA PTP (Picture Transfer Protocol) compatible with USB Host Shield rev.2.0 Arduino library has been released and posted to GitHub. New code has all functionality of original camera control library and adds new elements, namely ability to control several cameras simultaneously and (finally!) support for Nikon DSLRs.
The code comes with numerous examples demonstrating various aspects of digital camera control. All examples were compiled using Arduino IDE rev.0022 with USB Host Shield 2.0 and PTP 2.0 libraries installed as usual (by copying the whole library directory in %arduino%/libraries
) and tested on Arduino UNO equipped with USB Host Shield. There are also several examples which require Quantum Platform state machine framework, they can be recognized by qp_port.h
header included in the text of the sketch. If you want to try one of those, install QP Development Kit for Arduino and then replace qp_port.cpp
with this file.
More detailed explanation of library examples will follow soon. In the mean time, play with the library and try the examples. Stay tuned for the updates!
Oleg.
Hi,
I’m trying to extend PTP_2 to be able to control CHDK PTP Extensions
Basically, I guess that every needed is in libptp-chdk.patch
So it’s “only” a work of translation based on 0x9999 CHDK Operation code:
The first issue I don’t how how to deal with is “OperFlags flags”. What do they mean?
Just found out in ptp.h…
struct OperFlags
{
uint16_t opParams : 3; // 7 – maximum number of operation parameters
uint16_t rsParams : 3; // 7 – maximum number of response parameters
uint16_t txOperation : 1; // I->R operation if the flag is set
uint16_t dataStage : 1; // operation has data stage if the flag is set
uint16_t typeOfVoid : 2; // 0 – NULL, 1 – PTPReadParser/PTPDataSupplyer, 2 – WRITEPARSER, 3 – buffer pointer
uint16_t dataSize : 6; // size of data buffer (64 bytes maximum)
};
Hi Oleg, I try to compile NKRemote.pde and get the following error message:
“psconsole.h:19: error: ‘Q_USER_SIG’ was not declared in this scope” Can you please help me out? Cheers, Ben
Do you have QP installed?
Hi there,
QP is installed. QP examples compile alright and PScapture compiles, too.
CamController has been developed prior to QP for Arduino; it uses generic QP package with modifications. The procedure of building the code is outlined in camcontroller article.
Finally works now! Make sure your library folders are named correctly and name your files according to error messages: qep is not qp…
I have the exact same and the Problem I can not solve it. Tried everything. Examples QP compiled.
In file included from bsp.cpp:45:
fsa.h:18: error: ‘Q_USER_SIG’ was not declared in this scope
fsa.h:78: error: expected class-name before ‘{‘ token
fsa.h:84: error: expected initializer before ‘*’ token
fsa.h:85: error: expected initializer before ‘*’ token
fsa.h:86: error: expected initializer before ‘*’ token
fsa.h:87: error: expected initializer before ‘*’ token
fsa.h:88: error: expected initializer before ‘*’ token
bsp.cpp: In function ‘void __vector_7()’:
bsp.cpp:108: error: ‘AO_Controls’ was not declared in this scope
bsp.cpp:108: error: expected type-specifier before ‘QEvt’
bsp.cpp:108: error: expected `>’ before ‘QEvt’
bsp.cpp:108: error: expected `(‘ before ‘QEvt’
bsp.cpp:108: error: ‘QEvt’ was not declared in this scope
bsp.cpp:108: error: expected primary-expression before ‘>’ token
bsp.cpp:112: error: ‘AO_Controls’ was not declared in this scope
bsp.cpp:112: error: expected type-specifier before ‘QEvt’
bsp.cpp:112: error: expected `>’ before ‘QEvt’
bsp.cpp:112: error: expected `(‘ before ‘QEvt’
bsp.cpp:112: error: ‘QEvt’ was not declared in this scope
bsp.cpp:112: error: expected primary-expression before ‘>’ token
bsp.cpp:119: error: ‘AO_Controls’ was not declared in this scope
bsp.cpp:119: error: expected type-specifier before ‘QEvt’
bsp.cpp:119: error: expected `>’ before ‘QEvt’
bsp.cpp:119: error: expected `(‘ before ‘QEvt’
bsp.cpp:119: error: ‘QEvt’ was not declared in this scope
bsp.cpp:119: error: expected primary-expression before ‘>’ token
bsp.cpp:123: error: ‘AO_Controls’ was not declared in this scope
bsp.cpp:123: error: expected type-specifier before ‘QEvt’
bsp.cpp:123: error: expected `>’ before ‘QEvt’
bsp.cpp:123: error: expected `(‘ before ‘QEvt’
bsp.cpp:123: error: ‘QEvt’ was not declared in this scope
bsp.cpp:123: error: expected primary-expression before ‘>’ token
bsp.cpp:130: error: ‘AO_Controls’ was not declared in this scope
bsp.cpp:130: error: expected type-specifier before ‘QEvt’
bsp.cpp:130: error: expected `>’ before ‘QEvt’
bsp.cpp:130: error: expected `(‘ before ‘QEvt’
bsp.cpp:130: error: ‘QEvt’ was not declared in this scope
bsp.cpp:130: error: expected primary-expression before ‘>’ token
bsp.cpp:134: error: ‘AO_Controls’ was not declared in this scope
bsp.cpp:134: error: expected type-specifier before ‘QEvt’
bsp.cpp:134: error: expected `>’ before ‘QEvt’
bsp.cpp:134: error: expected `(‘ before ‘QEvt’
bsp.cpp:134: error: ‘QEvt’ was not declared in this scope
bsp.cpp:134: error: expected primary-expression before ‘>’ token
bsp.cpp:147: error: ‘QF’ has not been declared
bsp.cpp: At global scope:
bsp.cpp:172: error: ‘QF’ has not been declared
bsp.cpp:182: error: ‘QF’ has not been declared
bsp.cpp:206: error: ‘QF’ has not been declared
Apparently, your compiler doesn’t see QP source.
Why? Recommend anything. I tried different versions of Arduino, follow the instructions to QEP. No results.
IDE 1.0.1 and QP version 4.5.02
Did you figure this out. Same problem here. Tried IDE version .0022 and QP version 4.5.02 and same exact problem too. For some reason the compiler isn’t finding the library…but it seems to be in the build directory. Strange.
I added “using namespace QP;” in eosconsole.h because this was in blinky.ino
Help me QP_VERSION 0x4502U
Oleg, everyone, wonderful project. I am having encouraging signs but not quite there… I am running the “PTPCapture” example with a Nikon D40 (this is from the new 2.0 library, I also have the more recent USB Host Shield 2.0 libraries installed). It does connect to the camera successfully – upon uploading the sketch the camera takes one photo, this also happens when I start the serial monitor. However I believe this example was also supposed to keep snapping pics once every second? I will keep poking at this for resolution but thanks in advance for any advice you might have. -Frank
Try to increase the timeout between shots. Set it to 5 seconds.
I’m having no luck with that. The best thing I have found is that if I put “ptp->CaptureImage();” multiple times back to back with a delay that it will take pics as many times as I do that specified by the delay I put in. If I only wanted to take a few shots after hitting the reset button on the arduino I might be happy but I am interested in getting into time lapse so I would have to have that possibly hundreds of times which is obviously not elegant… but its something. Its just not in the loop so it only runs once? (baby programmer here sorry)
Hmmm…, same problem with the Nikon Coolpix 5400, I only get “camera connected”, the first capture, then nothing. But, for me, even the multiple “ptp->CaptureImage();” statements do not get executed. I have tried extended delays (30 seconds) as well.
Hey,
I am trying out the PSRemote example, got QP installed and qp_port.cpp replaced, but still keep getting
psconsole.h:19: error: ‘Q_USER_SIG’ was not declared in this scope
It is same for all the xxxRemote examples.
I got the same error recently compiling Nkremote. The issue is likely caused by the latest version of Arduino QP. I don’t know how to fix it – I simply downgraded to 4.3.00.
Are we able to grab images from the camera before uploading them to a PC?
What do you mean by ‘grab’?
I wish to upload the images from my camera to my Arduino before sending them to a computer, is this possible?
If you have enough space on Arduino, yes.
Hi all, Hi Oleg,
I have modified (added) your library to add support for color temp of White balance in manual mode.
That’s works fine for read color temp but not for set it.
This is the code that I have modified and my problem :
***************************************************
Modification in file nkvaluetitles.h
************************************
typedef uint8_t VT_COLORTEMP;
.
.
.
#define VT_COLORTEMP_TEXT_LEN 6
.
.
.
const ValueTitle ColorTempTitles[] PROGMEM =
{
{0x00, {‘ ‘,’2′,’5′,’0′,’0’,0} }, // 2500K
{0x01, {‘ ‘,’2′,’5′,’6′,’0’,0} }, // 2560K
{0x02, {‘ ‘,’2′,’6′,’3′,’0’,0} }, // 2630K
{0x03, {‘ ‘,’2′,’7′,’0′,’0’,0} }, // 2700K
{0x04, {‘ ‘,’2′,’7′,’8′,’0’,0} }, // 2780K
{0x05, {‘ ‘,’2′,’8′,’6′,’0’,0} }, // 2860K
{0x06, {‘ ‘,’2′,’9′,’4′,’0’,0} }, // 2940K
{0x07, {‘ ‘,’3′,’0′,’3′,’0’,0} }, // 3030K
{0x08, {‘ ‘,’3′,’1′,’3′,’0’,0} }, // 3130K
{0x09, {‘ ‘,’3′,’2′,’3′,’0’,0} }, // 3230K
{0x0A, {‘ ‘,’3′,’3′,’3′,’0’,0} }, // 3330K
{0x0B, {‘ ‘,’3′,’4′,’5′,’0’,0} }, // 3450K
{0x0C, {‘ ‘,’3′,’5′,’7′,’0’,0} }, // 3570K
{0x0D, {‘ ‘,’3′,’7′,’0′,’0’,0} }, // 3700K
{0x0E, {‘ ‘,’3′,’8′,’5′,’0’,0} }, // 3850K
{0x0F, {‘ ‘,’4′,’0′,’0′,’0’,0} }, // 4000K
{0x10, {‘ ‘,’4′,’1′,’7′,’0’,0} }, // 4170K
{0x11, {‘ ‘,’4′,’3′,’5′,’0’,0} }, // 4350K
{0x12, {‘ ‘,’4′,’5′,’5′,’0’,0} }, // 4550K
{0x13, {‘ ‘,’4′,’7′,’6′,’0’,0} }, // 4760K
{0x14, {‘ ‘,’5′,’0′,’0′,’0’,0} }, // 5000K
{0x15, {‘ ‘,’5′,’2′,’6′,’0’,0} }, // 5260K
{0x16, {‘ ‘,’5′,’5′,’6′,’0’,0} }, // 5560K
{0x17, {‘ ‘,’5′,’8′,’8′,’0’,0} }, // 5880K
{0x18, {‘ ‘,’6′,’2′,’5′,’0’,0} }, // 6250K
{0x19, {‘ ‘,’6′,’6′,’7′,’0’,0} }, // 6670K
{0x1A, {‘ ‘,’7′,’1′,’4′,’0’,0} }, // 7140K
{0x1B, {‘ ‘,’7′,’6′,’9′,’0’,0} }, // 7690K
{0x1C, {‘ ‘,’8′,’3′,’3′,’0’,0} }, // 8330K
{0x1D, {‘ ‘,’9′,’0′,’9′,’0’,0} }, // 9090K
{0x1E, {‘1′,’0′,’0′,’0′,’0’,0} }, // 10000K
};
.
.
.
#define VT_COLORTEMP_COUNT sizeof(ColorTempTitles) / (sizeof(VT_COLORTEMP) + VT_COLORTEMP_TEXT_LEN)
****************************************************************
*
*
*
****************************************************************
Modification in ptpconst.h
**************************
#define PTP_DPC_ColorTemp 0xD01E
*****************************************************************
*
*
*
*****************************************************************
and I have added a new function for the menu in psconsole.cpp
void PrintColorTemp()
{
Notify(PSTR(“CCT:”));
PrintValueTitle((PTP*)&Nk, PTP_DPC_ColorTemp, ColorTempTitles));
Notify(PSTR(“\r\n”));
}
That’s works very fine for read the color temp when white balance is in manual mode
but my problem is for set the color temp I use it but that’s don’t works :
I have implemented a new function for change value (same as State PSConsole::ChangeWBMenu(PSConsole *me, QEvent const *e) but with value for Color Temp)
StepUp((PTP*)&Nk, PTP_DPC_ColorTemp);
or
StepDown((PTP*)&Nk, PTP_DPC_ColorTemp);
Have you an idea to set color temp ?
Hello! Very interesting project. I wonder, is there any chance to get the information from the camera about the lens that is mounted (mainly focus lenght)? Thank you.
Hi Oleg,
thanx for shareing your nice project.
I started also a projekt and now there are some problems or better to say solutions missing.
what i want to do is to contol camera in 4ways (slider+remotehead+focal length) save different positions and repeat the sequence… this is working
But camera contoll???
The focus and shoot with “normal cable” is fine just High/Low
but i want to get more informations from the camera to us it in programm, to change ISO, aperture, EV.
Is it possible to get the info with your shield also without a laptop via USB???
How many pins are needed with the shield???
Nunchuk and LCD is via I2C, but maybe it is needed to run also Steppercontol with I2C or your shield.
Hope you can give my mind a clear view!!!
THANK YOU
here’s a summary of everything related to the shield -> https://www.circuitsathome.com/arduino_usb_host_shield_projects
Hi all
I’ve just downloaded this files (https://github.com/felis/PTP_2.0) and copied on arduino/libraries/PTP_2
I’m using Arduino IDE 1.0.5 on a MAC with OS X
I’m getting a lot of errors, different errors for each example.
For example, EOSCamController i’m getting this errors:
In file included from dataitem.h:5,
from dataitem.cpp:1:
/Users/felipe/Documents/Arduino/libraries/USBHS/canoneos.h:20:22: error: WProgram.h: No such file or directory
In file included from /Users/felipe/Documents/Arduino/libraries/USBHS/ptp.h:29,
from /Users/felipe/Documents/Arduino/libraries/USBHS/canoneos.h:21,
from dataitem.h:5,
from dataitem.cpp:1:
/Users/felipe/Documents/Arduino/libraries/USBHS/ptpdebug.h:24: error: expected unqualified-id before ‘void’
/Users/felipe/Documents/Arduino/libraries/USBHS/ptpdebug.h:24: error: expected `)’ before ‘void’
/Users/felipe/Documents/Arduino/libraries/USBHS/ptpdebug.h:24: error: expected `)’ before ‘void’
/Users/felipe/Documents/Arduino/libraries/USBHS/ptpdebug.h:43: error: redefinition of ‘template void PrintHex2(Print*, T)’
/Users/felipe/Documents/Arduino/libraries/USBHS/printhex.h:64: error: ‘template void PrintHex2(Print*, T)’ previously declared here
In file included from /Users/felipe/Documents/Arduino/libraries/USBHS/canoneos.h:21,
from dataitem.h:5,
from dataitem.cpp:1:
/Users/felipe/Documents/Arduino/libraries/USBHS/ptp.h:86: error: ‘EP_RECORD’ does not name a type
/Users/felipe/Documents/Arduino/libraries/USBHS/ptp.h: In member function ‘void PTP::Setup()’:
/Users/felipe/Documents/Arduino/libraries/USBHS/ptp.h:124: error: ‘class MAX3421E’ has no member named ‘powerOn’
Do anyone know how to solve that ?
Hi Oleg,
When parsing an object info, how could we capture the picture filename directly to a variable?
I’m talking about the nStage 31 from the parser in “ptpobjinfoparser.cpp”:
case 31:
E_Notify(PSTR("\r\nFile Name:\t\t"),0x80);
arrayParser.Initialize(1, 2, &theBuffer);
nStage ++;
Thank you in advance!
You’ll have to write another parser for that. The one in the example just prints out everything.
Hello Oleg,
nice work with the shield (which i am using). I got the most things to work. I tried to compile the NKRemote sketch but i failed with this (known) error:
psconsole.h:20: error: ‘Q_USER_SIG’ was not declared in this scope
so as you recommended i tried to use the qp version 4.3.0.0 but i cannot find the qp_host.cpp? I found it in the newest version but this will not work either. The 4.3.0.0 version that i got is from here:
http://sourceforge.net/projects/qpc/files/QP-Cpp/
is there a special trick that i don´t get? Or am i on the wrong way?
Thanks and regards
I don’t maintain QP. The support forum for QP is here -> http://sourceforge.net/p/qpc/discussion/668726
Thanks i found it on some ftp just google: qp_arduino_4.3.00
with this now i get:
In file included from NKRemote.pde:6:
C:\Users\Helmut\Documents\Arduino\libraries\qp/qp_port.h:3505: error: section attribute not allowed for ‘file’
NKRemote:15: error: section attribute not allowed for ‘file’
NKRemote:63: error: section attribute not allowed for ‘file’
NKRemote.pde: In function ‘void Q_onAssert(const char*, int)’:
NKRemote:66: error: ‘QF_INT_DISABLE’ was not declared in this scope
Hopefully someone can point to a direction were i can fix this
Thanks and regards
I got the first of those errors when compiling EOSRemote. Apparently the “section attribute not allowed” error is somehow tied to the PROGMEM construct. I fixed the error by commenting the line “#define Q_ROM PROGMEM”, line 52 of qp_port.h. The PROGMEM construct seems to have changed a little over time and causes issues with code which previously worked. This probably isn’t a very clean way of fixing the problem as the sketch will use up more RAM now, but it works for me.
Using Arduino IDE 1.0.5 on OSX 10.7, qp_arduino_4.3.00.
thanks!
Hi,
i tried to get the lib to work for several hours now… the Problem is, that i cannot find an actual working qp library for Arduino 1.0.x. The is only a file for Arduino 1.5.x now online. Is it possible, that someone can upload this file: qp_arduino_4.3.00.zip somewhere?
Would be awesome!
Pcace
The old version is available at the following link: http://www.state-machine.com/arduino/qp_arduino_4.3.00.zip.
Thanks a lot for the link, but i get a 404 error (not available…)
Any other idea?
Thanks!!!!
Hi Oleg,
Congradulations for you great work you done here,
I miss the documentation of the software.
Example capture compiles beautifuly.
Example PTPDevProp (what is it suppose to do?)doesn’t compile it give this errors
devpropparser.cpp:363: error: __c causes a section type conflict
devpropparser.cpp:351: error: __c causes a section type conflict
devpropparser.cpp:347: error: __c causes a section type conflict
devpropparser.cpp:337: error: __c causes a section type conflict
devpropparser.cpp:332: error: __c causes a section type conflict
devpropparser.cpp:329: error: __c causes a section type conflict
devpropparser.cpp:324: error: __c causes a section type conflict
devpropparser.cpp:279: error: __c causes a section type conflict
devpropparser.h:120: error: __c causes a section type conflict
devpropparser.h:114: error: __c causes a section type conflict
devpropparser.h:108: error: __c causes a section type conflict
devpropparser.h:102: error: __c causes a section type conflict
devpropparser.cpp:122: error: __c causes a section type conflict
devpropparser.cpp:122: error: __c causes a section type conflict
devpropparser.cpp:122: error: __c causes a section type conflict
devpropparser.cpp:121: error: __c causes a section type conflict
devpropparser.cpp:113: error: __c causes a section type conflict
devpropparser.cpp:108: error: __c causes a section type conflict
devpropparser.cpp:106: error: __c causes a section type conflict
devpropparser.cpp:101: error: __c causes a section type conflict
devpropparser.cpp:92: error: __c causes a section type conflict
devpropparser.cpp:90: error: __c causes a section type conflict
devpropparser.cpp:87: error: __c causes a section type conflict
devpropparser.cpp:74: error: __c causes a section type conflict
devpropparser.h:43: error: msgUNDEF causes a section type conflict
devpropparser.h:44: error: msgINT8 causes a section type conflict
devpropparser.h:45: error: msgUINT8 causes a section type conflict
devpropparser.h:46: error: msgINT16 causes a section type conflict
devpropparser.h:47: error: msgUINT16 causes a section type conflict
devpropparser.h:48: error: msgINT32 causes a section type conflict
devpropparser.h:49: error: msgUINT32 causes a section type conflict
devpropparser.h:50: error: msgINT64 causes a section type conflict
devpropparser.h:51: error: msgUINT64 causes a section type conflict
devpropparser.h:52: error: msgINT128 causes a section type conflict
devpropparser.h:53: error: msgUINT128 causes a section type conflict
devpropparser.h:54: error: msgAINT8 causes a section type conflict
devpropparser.h:55: error: msgAUINT8 causes a section type conflict
devpropparser.h:56: error: msgAINT16 causes a section type conflict
devpropparser.h:57: error: msgAUINT16 causes a section type conflict
devpropparser.h:58: error: msgAINT32 causes a section type conflict
devpropparser.h:59: error: msgAUINT32 causes a section type conflict
devpropparser.h:60: error: msgAINT64 causes a section type conflict
devpropparser.h:61: error: msgAUINT64 causes a section type conflict
devpropparser.h:62: error: msgAINT128 causes a section type conflict
devpropparser.h:63: error: msgAUINT128 causes a section type conflict
devpropparser.h:9: error: msgUndefined causes a section type conflict
devpropparser.h:10: error: msgBatteryLevel causes a section type conflict
devpropparser.h:11: error: msgFunctionalMode causes a section type conflict
devpropparser.h:12: error: msgImageSize causes a section type conflict
devpropparser.h:13: error: msgCompressionSetting causes a section type conflict
devpropparser.h:14: error: msgWhiteBalance causes a section type conflict
devpropparser.h:15: error: msgRGBGain causes a section type conflict
devpropparser.h:16: error: msgFNumber causes a section type conflict
devpropparser.h:17: error: msgFocalLength causes a section type conflict
devpropparser.h:18: error: msgFocusDistance causes a section type conflict
devpropparser.h:19: error: msgFocusMode causes a section type conflict
devpropparser.h:20: error: msgExposureMeteringMode causes a section type conflict
devpropparser.h:21: error: msgFlashMode causes a section type conflict
devpropparser.h:22: error: msgExposureTime causes a section type conflict
devpropparser.h:23: error: msgExposureProgramMode causes a section type conflict
devpropparser.h:24: error: msgExposureIndex causes a section type conflict
devpropparser.h:25: error: msgExposureBiasCompensation causes a section type conflict
devpropparser.h:26: error: msgDateTime causes a section type conflict
devpropparser.h:27: error: msgCaptureDelay causes a section type conflict
devpropparser.h:28: error: msgStillCaptureMode causes a section type conflict
devpropparser.h:29: error: msgContrast causes a section type conflict
devpropparser.h:30: error: msgSharpness causes a section type conflict
devpropparser.h:31: error: msgDigitalZoom causes a section type conflict
devpropparser.h:32: error: msgEffectMode causes a section type conflict
devpropparser.h:33: error: msgBurstNumber causes a section type conflict
devpropparser.h:34: error: msgBurstInterval causes a section type conflict
devpropparser.h:35: error: msgTimelapseNumber causes a section type conflict
devpropparser.h:36: error: msgTimelapseInterval causes a section type conflict
devpropparser.h:37: error: msgFocusMeteringMode causes a section type conflict
devpropparser.h:38: error: msgUploadURL causes a section type conflict
devpropparser.h:39: error: msgArtist causes a section type conflict
devpropparser.h:40: error: msgCopyrightInfo causes a section type conflict
I must have done something Wrong!
What to do to solve this?
Thank you you’the best man
I have made a ready to use library available at the following link: http://blog.tkjelectronics.dk/wp-content/uploads/PTP_20.zip.
Thank you Lauszus;
I will try it and send some feedback soon 🙂
Thank you Lauszus;
that was realy helpfull, now I’ve compiled EosFocus and EosCapture and uploaded them, working fine :)the others dont compile, Im downgrading qp to 4.3.00 to try again
Hi Lauszus, I made a mess of my arduino/Libraries, now nothing compiles for a week #”€&%%$#.
can you put a link in your blog and post for your arduino/Libraries file ziped.
It wold be very helpfull, because I’m lost with all changes in the libraries and the versions that work.
I’m able to control EOS camera parameters (ISO, shutter etc) with the SetProperty() function. Now, I’m hoping to read existing camera settings using GetProperty(). However, I’m unable to work out how to do that, the PTPReadParser construct is beyond my limited knowledge of programming. And I haven’t found any code that uses GetProperty(). How is the function supposed to be used?
Which camera are you using?
Mostly, an EOS 7D.
On EOS you can’t get a property at will. The camera sends out a list of properties together with their values at the start of the session plus an event when the property has been changed (via PTP, or manually while pressing buttons, or when the battery level has changed, etc.). For more information about EOS take a look at this article -> https://www.circuitsathome.com/canon-eos-cameras-principles-of-interfacing-and-library-description
Thanks for clarifying. So do I understand correctly: from your PTP library, I can get a binary/hex dump of all the live data sent by the camera (like you do in the EOSEventLab example). In my application, I need to take care completely of interpreting the raw data? Or does something in your library (eoseventparser maybe) take over any of the interpretation?
What do you mean by ‘raw data’? ‘All the live data sent by the camera’ comes in PTP transactions. Some contents of said transactions, like commands/responses/events/etc., is parsed in the code, while some other, like jpegs sent back in LiveView mode, is not.
What I meant by ‘raw data’ was the unprocessed hex dumps that come out of EOSEventLab, or their binary equivalent. If your code already parses the PTP transactions into something more structured and usable, I’d like to use that, but due to my limited understanding of C++, I don’t know how yet.
Ah, I just realized that EOSRemote seems to make use of that parsing, that code sample would help me continue … However, I’m struggling to make it compile. (the same problem other people have had, of the current QP not working, and the old QP 4.3.00 being unavailable for download)
… eventually, I got the EOSRemote example compiled and working. That ought to get me further. Thanks for the help! By the way, some people might be interested to hear that QP 4.3.00 for Arduino is, as of very recently, available for download here:
http://sourceforge.net/projects/qpc/files/QDK_Arduino/1.0.x/qp-4.3.00_arduino-1.0.x.zip
Dear Oleg,
thanks for the great work here.
Is it possible to read out the current focal length over ptp from the mounted lens?
We want to use the value to calculate an automated picture program.
Sincerely Yours
Daniel
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).
hello guys, First congrats for the great project ¡¡
I,m so exited to make it work but after some days trying to test the PSRemote example i could not compiled it.
I tried all the above info and 6 arduino versions plus Qp versions but no luck,i dont know what else i could try.
i would really appreciate if someone could list the right versions of arduino,qt and the step by step installation ?
I use windows7-ArduinoUNO-USB-Shield-2 but i could use any other arduino board.
thanks a lot in advance
Hello Oleg,
I try to compile your examples for a PowerShot SX 110 IS with the Arduino 1.6.5 ide. I can compile PSDevProp and PSCapture with success if I change the PTPObjInfoParser class:
In the ptpobjinfoparser.cpp I need to add a second const after the char*
const char* const PTPObjInfoParser::acNames[] PROGMEM = {
const char* const PTPObjInfoParser::imNames[] PROGMEM = {
...
I also need to change the declaration in the ptpobjinfoparser.h
class PTPObjInfoParser : public PTPReadParser
{
static const char* const acNames[];
static const char* const imNames[];
...
Now I try to compile the PSRemote example. But I have no luck because my knowledge of C++ is too small. I get a compiler error in the psconsole.cpp:
C:\Users\XXX\AppData\Local\Temp\build6021342622671677151.tmp\psconsole.cpp:421:16: error: request for member 'sig' in '* e',
which is of non-class type 'const int' switch (e->sig)
I don’t find out what is wrong with the line:
QState PSConsole::ChangeZoomMenu(PSConsole *me, QEvent const *e)
{
switch (e->sig)
{
case Q_ENTRY_SIG:
I thought that it is a problem with the newer compiler in version 1.6.5. So I tried the older compilers. Also with no luck.
Do you have any suggestions?
Thanks a lot
Mark
There is a pull request in the repo said to fix the compilation for newer versions. I haven’t looked at it but you may want to give it a try.
Hello Oleg,
I tried the PSremote example from the pull and what should I say: it works fine.
Thanks a lot
Mark
Hi,
I downloaded the library and I am trying to use it with a Nikon DSLR.
The example codes work (I am using PTPCapture expecially), but I haven’t found any guide or documentation which explains how to use the library by myself.
The biggest problem that I am encountering is that it looks like that, once the Usb.Init() has initialized, the “analogic” functions of Arduino (let’s say, blinking leds and spinning motors) are not working anymore…!
Is it normal? Or is it just me and the fact that I don’t understand the library syntax?
thanks
Please, can anybody give me help on the library syntax? I can’t find a proper guide anywhere… is it possible to control motors with arduino and in the same code take snapshots with a camera using PTPCapture? I can’t make it work!
Hi,
I was trying to control my 450D but I had some troubles.
Please, can you recommend any combination of arduinoIDE version and Quantum Platform version that will work? I have troubles to compile code, I need to include SPI.h every time before compiling and only some sketches will connect with camera, but with no action.
I will appreciate any help.
This helped a lot. Problem solved.
https://www.circuitsathome.com/camera-control/arduino-based-controller-for-canon-eos-cameras/comment-page-2#comment-15989