CHDK PTP interface - page 60 - General Discussion and Assistance - CHDK Forum

CHDK PTP interface

  • 1241 Replies
  • 490168 Views
*

Offline msl

  • *****
  • 1280
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: CHDK PTP interface
« Reply #590 on: 02 / October / 2011, 03:44:43 »
Advertisements
For your information: With changeset 1316 ptpCamGui will only work with CHDK-DE because the minor version number of the the ptp modul is not compatible.

See also here: http://chdk.setepontos.com/index.php?topic=6285.msg73674#msg73674

msl
CHDK-DE:  CHDK-DE links

Re: CHDK PTP interface
« Reply #591 on: 08 / October / 2011, 06:35:27 »
I'm running into a problem with overlapped commands - I know that if you run a second command before the first has completed, that PTP crashes.  The problem I'm having is trying to detect when an action has completed.  Currently I call ptp_chdk_exec_lua(), then I poll ptp_chdk_get_script_status() until Status doesn't have PTP_CHDK_SCRIPT_STATUS_RUN set (sleeping 50ms each loop).  This seems to work in most cases, but in a couple it doesn't - the most obvious example is trying to use the lua "set_aflock(0);"  In my script I toggle it, so that it sets the focus, then disables autofocus. 

Now, it returns almost immediately from "set_aflock(0);", so when I issue "set_aflock(1);", the camera crashes.  I could combine the two, like "set_aflock(0);set_aflock(1);", but then it crashes on the next command.  Right now my terrible terrible workaround is to do this:

set_aflock(0);press(\"shoot_half\"); repeat sleep(50); until get_shooting() == true; release(\"shoot_half\"); repeat sleep(50); until get_shooting() == false;

which works, but does a ton of other stuff that's irrelevant to what I'm trying to do.

My question is, is this the expected behavior with set_aflock(), and if so, how can I wait until it's completed?
SD1100IS / SD1200IS / SX130IS / SX30IS

Re: CHDK PTP interface
« Reply #592 on: 08 / October / 2011, 22:34:15 »
Compiled version attached.
One note, there is a checkbox to 'autoupdate' the live view (also calculates the frame rate).
If you have this checked it will crash if you try and send other commands to the camera (it needs to stop the autoupdate before sending the command; but I haven't coded this yet).

Phil.


Works here on A650IS, I get 9.9fps. Overlay checkbox make it crash. Cant wait to see whats in store for this feature!

*

Offline zeno

  • *****
  • 891
Re: CHDK PTP interface
« Reply #593 on: 09 / October / 2011, 12:49:07 »
I'm currently trying to get ptpcam working on my Ubuntu linux system. I've installed libusb (see below) and managed to get the ptpcamcode to compile and run, but every time I run it I get the message:
  ERROR: Could not open session!
  Try to reset the camera.
It does detect the camera, but won't open a session. I'm not really familiar with linux internals and none of the things I've read about the problem seem to apply to my ubuntu system (e.g. the information here http://libptp.sourceforge.net/README doesn't help because I don't have a /proc/bus/usb folder).

The libusb I've installed is "libusb-compat-0.1.3" because this seems to correspond to the windows libusb-win32-bin-1.2.2.0 that works fine for me. The other linux libusb versions don't fit (e.g. they have a libusb.h file rather than a usb.h file).

I suspect I've bitten off more than I can chew, but after lengthy struggles to get ptpcam to compile, I now seem quite close to getting it to run.

Postscript: I didn't realise that 'Try to reset the camera' meant try the command 'ptpcam -r'. That did the trick - ptpcam now talks to the camera as it should!

« Last Edit: 09 / October / 2011, 18:11:45 by zeno »
A570, S100, Ixus 127
Author of ASSIST, STICK, WASP, ACID, SDMInst, LICKS, WICKS, MacBoot, UBDB, CFGEdit


Re: CHDK PTP interface
« Reply #594 on: 11 / October / 2011, 12:47:32 »
I'm also experiencing a camera shutdown when sending the lua shoot() command.  I'm using the sample .net app (live view works).  I have also tried with ptpcamgui with the same results. 

I've tried both a Canon SX130 and SX110 using changeset 1359 from the autobuild server.

I have made sure to set the camera in record mode before sending the shoot() command.  Anyone have any ideas for me?

Sgtrum

Re: CHDK PTP interface
« Reply #595 on: 11 / October / 2011, 14:01:58 »
Back on page 10 there was a patch to make this work on an A540. Those links are broken now. Is there anyway to get this on my A540's?

Chuck

*

Offline msl

  • *****
  • 1280
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: CHDK PTP interface
« Reply #596 on: 12 / October / 2011, 03:23:13 »
Back on page 10 there was a patch to make this work on an A540. Those links are broken now. Is there anyway to get this on my A540's?

You can try this version: http://chdk.bplaced.net/content/download/view.download/7/23.html

with this M$ interface: http://chdk.bplaced.net/content/download/view.download/6/11.html

But this is a very old CHDK version based on ewavr's PTP interface. You need also the alternate USB driver.
CHDK-DE:  CHDK-DE links

*

Offline reyalp

  • ******
  • 14080
Re: CHDK PTP interface
« Reply #597 on: 13 / October / 2011, 01:05:15 »
Regarding the live view stuff.

I clearly won't have time to work on this for a while, so I don't want to hold things up. IMO the implementation in phils branch is preferable to the original one.

I still reservations but we can always do protocol 3.0 down the road if needed. IMO, a combined "select what data I'm interested in and fetch it all in one call" is the right thing to do in the long run, and should not be terribly hard to implement in a reasonably flexible way.

Don't forget what the H stands for.


Re: CHDK PTP interface
« Reply #598 on: 02 / November / 2011, 13:36:58 »
I have tried S95 with ptpCamGui 2.0.112 and got message "CHDK isn't started on camera!". There is a message in console "** init() start ...
>> version << error: cannot get camera CHDK PTP version; either it has an unsupported version or no CHDK PTP support at all
ptpcam: 2.0 (Length: 122) [unexpected return code 0x2005
unexpected return code 0x2005 (Length: 60)]
"
CHDK 0.9.9 firmware 100h. Usb-driver libusb-win32-bin-1.2.4.0.
Could You please tell me what I do wrong?

*

Offline rudi

  • ***
  • 129
  • A590IS_101B, SX260HS_100B
Re: CHDK PTP interface
« Reply #599 on: 02 / November / 2011, 15:33:10 »
got message "CHDK isn't started on camera
Make sure CHDK is loaded in play mode before you start ptpCamGui.

 

Related Topics