chdkptp - alternative ptp client - page 38 - General Discussion and Assistance - CHDK Forum supplierdeeply

chdkptp - alternative ptp client

  • 1097 Replies
  • 388746 Views
Re: alternative ptp client
« Reply #370 on: 29 / June / 2013, 10:33:12 »
Advertisements
OK, that doesn't sound like any of the problems I had in mind.

This could happen if some other program grabbed the USB connection. You could try looking in the kernal log (dmesg output) to see of something particular happens at the times you lose connection.

It could also be the USB connection being flaky I guess. Do you have any other USB devices plugged into the pi? Are you using a powered hub? The camera itself should be fine on USB, but other devices that expect to get a significant amount of power can cause problems if you aren't using a powered hub.

Thanks for the replies.

As it happens I've changed the USB hub since I last posted and I think the issue has gone. I've tried to replicate the issue with the new USB hub but all downloads seem to have been successful and without error so it looks like it could well be a Pi USB problem with the other hub (which wouldn't really be a surprise considering the known Pi USB issues).

If the issue occurs again I'll get whatever logs I can, but it's looking like an RPi USB issue rather than chdkptp problem.

*

Offline reyalp

  • ******
  • 13391
Re: alternative ptp client
« Reply #371 on: 05 / July / 2013, 21:59:23 »
If you build your own chdkptp, it's very important that Lua be linked to exactly the same C runtime library as chdkptp itself. The lbuf file routines expect to be able to fread and fwrite on a FILE * opened by lua io.open()

This condition probably won't be met if you use a pre-compiled Lua dll on windows. I think it's probably OK with a shared lua in typical linux environments, but I could be wrong. If in doubt, build your own Lua with the same compiler you build chdkptp with.

You can use
!require'tests':runall()
to test some aspects of your chdkptp build. It should crash or fail if the runtimes aren't compatible.
Don't forget what the H stands for.

*

Offline reyalp

  • ******
  • 13391
Re: alternative ptp client
« Reply #372 on: 05 / July / 2013, 23:23:52 »
I've uploaded snapshot build r384 to the chdkptp files area:
https://www.assembla.com/spaces/chdkptp/documents

This includes remote capture support for the current trunk. This is available using the 'rs' command. Use
help rs
for details.

There are still some loose ends:
1) Exposure controls are not integrated in the rs command. rs should probably be integrated into the regular shoot command, or at least given equivalent options.
2) If you use rs without any options on a camera that does not have filewrite support, you will get an error "'unsupported format" because it defaults to jpeg, but jpeg is not supported. -raw or -dng should still work. In this case, the jpeg will be saved on the camera.
3) DNG does not currently create a thumbnail or patch badpixels
4) rs (and shoot) don't wait for the flash to be ready, so shooting is likely to fail if flash is enabled

The new protocol commands can also be accessed directly in lua using the chdk_connection api (documented in chdkptp.c). There are also helpers in chdku (documented in chdku.lua) to make it more convenient.

edit:
corrected above, the "shoot" cli command already used shoot()
« Last Edit: 08 / July / 2013, 01:42:19 by reyalp »
Don't forget what the H stands for.

*

Offline reyalp

  • ******
  • 13391
Re: alternative ptp client
« Reply #373 on: 08 / July / 2013, 01:34:47 »
I switched the chdkptp 'rs' command to use shoot instead of a get_shooting() loop. This should avoid the timeouts when the flash isn't ready.

This only applies to single shot mode, continuous still uses a get_shooting() loop.

I haven't made an updated build yet, these are lua only changes, so you can just grab cli.lua and rlibs.lua from svn.
Don't forget what the H stands for.


*

Offline tpont

  • **
  • 81
Re: alternative ptp client
« Reply #374 on: 14 / July / 2013, 18:22:51 »
Hi reyalp. I'm testing chdkptp-r384-win32 on a A2300 camera using the latest trunk version of CHDK (a2300-100f-1.2.0-2954-full_ALPHA.zip ). I can't get remoteshoot (rs) past "usb capture not supported". I've tried  rs , rs -raw , rs C:\test -raw and so on but always get the same error message (see previous sentence). Any ideas on what could be amiss here?
« Last Edit: 14 / July / 2013, 18:24:35 by tpont »

*

Offline reyalp

  • ******
  • 13391
Re: alternative ptp client
« Reply #375 on: 14 / July / 2013, 18:30:05 »
Hi reyalp. I'm testing chdkptp-r384-win32 on a A2300 camera using the latest trunk version of CHDK (a2300-100f-1.2.0-2954-full_ALPHA.zip ). I can't get remoteshoot (rs) past "usb capture not supported". I've tried  rs , rs -raw , rs C:\test -raw and so on but always get the same error message (see previous sentence). Any ideas on what could be amiss here?
Are you sure you have the right diskboot and modules on your camera?

"usb capture not supported" should only appear if the lua module doesn't have the "init_usb_capture" function.

What is the output of
vers -p
in chdkptp?
Don't forget what the H stands for.

*

Offline tpont

  • **
  • 81
Re: alternative ptp client
« Reply #376 on: 15 / July / 2013, 05:21:45 »
I get "unknown command 'vers' ".
If I run "version" in interactive command line mode I get: "host:2.5 cam:2.4"

*

Offline msl

  • *****
  • 1276
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: alternative ptp client
« Reply #377 on: 15 / July / 2013, 06:10:13 »
Use 'ver' instead of 'vers'. See also: http://trac.assembla.com/chdkptp/browser/trunk/USAGE.TXT#L187

msl
CHDK-DE:  CHDK-DE links


*

Offline reyalp

  • ******
  • 13391
Re: alternative ptp client
« Reply #378 on: 15 / July / 2013, 15:55:16 »
I get "unknown command 'vers' ".
Oops, sorry about, it should have be 'ver' but 'version' is the same.
Quote
If I run "version" in interactive command line mode I get: "host:2.5 cam:2.4"
Your camera is not actually running a version that supports remote capture. If you are using a multi-partition card, you might not have updated the right partition.

You can use =return get_buildinfo() to see what build you are actually running.
Don't forget what the H stands for.

*

Offline tpont

  • **
  • 81
Re: alternative ptp client
« Reply #379 on: 16 / July / 2013, 04:34:32 »
Thanks. I had failed to overwrite some of the older files on the SD card. Working now.
I did some speed tests. When I run
Code: [Select]
rs C:\ -dng the shot takes ~2.2 seconds. The camera doesn't support remoteshoot to jpg. using -raw and -dnghr takes about the same time as -dng.
When I do a regular shoot using
Code: [Select]
=t0=get_tick_count();press('shoot_half');repeat sleep(10) until get_shooting();t1=get_tick_count();click('shoot_full');repeat sleep(10) until not get_shooting(); t2=get_tick_count();return t1-t0,t2-t1 the shot takes ~1.9 seconds (I got it down to that by setting jpeg quality override in the CHDK menu to "normal")

Is it to be expected that the remoteshoot will take longer time? Or do you see any ways to make it as fast as or even faster than the regular shoot?
« Last Edit: 16 / July / 2013, 04:37:56 by tpont »

 

Related Topics