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

CHDK PTP interface

  • 1241 Replies
  • 489990 Views
*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: CHDK PTP interface
« Reply #330 on: 01 / January / 2011, 02:46:02 »
Advertisements

example
Code: [Select]
ptpcam --chdk
upload ptpmsg.lua A/ptpmsg.lua
lua loadfile('A/ptpmsg.lua')()
putm ls A/
getm
exec return 1+1
getm


Not sure what I'm doing wrong here; but 'putm' and 'getm' give 'unknown command' error message.
Using ptpcam from 'Ptpcam-chdkde-r515.zip' and I've applied the CHDK patches from 'ptpmsg-work-2.zip' and rebuilt (camera is SX30).

Regards,
Phil.

CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

*

Offline reyalp

  • ******
  • 14080
Re: CHDK PTP interface
« Reply #331 on: 01 / January / 2011, 16:09:11 »

example
Code: [Select]
ptpcam --chdk
upload ptpmsg.lua A/ptpmsg.lua
lua loadfile('A/ptpmsg.lua')()
putm ls A/
getm
exec return 1+1
getm


Not sure what I'm doing wrong here; but 'putm' and 'getm' give 'unknown command' error message.
Using ptpcam from 'Ptpcam-chdkde-r515.zip' and I've applied the CHDK patches from 'ptpmsg-work-2.zip' and rebuilt (camera is SX30).
You need to build a patched PTPcam too. Patch is against the source in chdkde
http://tools.assembla.com/chdkde/browser/trunk/tools/ptpcam

This is really an experiment, not intended as something for end users yet. But it is pretty functional.

I think the of approach of queuing messages is definitely the way to handle getting data back, but it needs quite different PTP client, because the client needs to be able to poll in the background. It also needs to be flexible enough to handle different scripts on the camera end. I'm still not sure exactly the best way to structure this, but I have some ideas...



Goals:
- easy enough for other developers to work on.
- portable, built with all free tools/libraries
- optional GUI
- PC side scripting/extending
- CHDKcam style live view

Current work uses
- ptpcam code for low level stuff, with everything that isn't CHDK related ripped out
- IUP 3.3 http://www.tecgraf.puc-rio.br/iup/ for gui
- Lua for both GUI (using IUP) and interface to CHDK PTP commands
- all builds with out of the box mingw gcc4.5 binary

I hope to get it in a usable enough state to put it in a public repository this weekend. Once that happens, chdk, chdkde and other interested developers will be welcome to contribute.

Don't forget what the H stands for.

*

Offline reyalp

  • ******
  • 14080
Re: CHDK PTP interface
« Reply #332 on: 02 / January / 2011, 18:45:25 »
I've shamelessly stolen most of chdkde changeset 530, trunk changeset 1018

This adds the necessary functions for mode changing on most dryos cameras. I haven't turned it on in camera.h, but this should give us what we need to support PTP out of the box on almost all cameras.

I see they are also working on a PTP GUI http://forum.chdk-treff.de/viewtopic.php?f=7&t=2122&start=75#p20351
Don't forget what the H stands for.

*

Offline rudi

  • ***
  • 129
  • A590IS_101B, SX260HS_100B
Re: CHDK PTP interface
« Reply #333 on: 03 / January / 2011, 06:14:11 »
I've shamelessly stolen most of chdkde changeset 530, trunk changeset 1018
Such a thing! But you must it do another one, because the G12_100c is also ready.

The "switch_mode_usb"-routine for all cams are in "/generic/lib.c", see changeset 465 and 470.

rudi


*

Offline msl

  • *****
  • 1280
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: CHDK PTP interface
« Reply #334 on: 03 / January / 2011, 06:48:58 »
I've shamelessly stolen ...
This is not shameless, that's great. So we have more opportunities to locate any errors.

I see they are also working on a PTP GUI ...
The GUI design is a small attempt to help people who have problems with a console. So we get more feedback  (maybe). Wim will probably laugh at this Autoit attempt. ;)

Your proposal (IUP) is certainly the better way for a GUI because it is platform independent. The idea of using read/write_ptp_msg is also very interesting.

edit: You can find the GUI now here: http://forum.chdk-treff.de/viewtopic.php?f=7&t=2207
« Last Edit: 03 / January / 2011, 08:32:53 by msl »
CHDK-DE:  CHDK-DE links

*

Offline hwntw

  • ***
  • 159
Re: CHDK PTP interface
« Reply #335 on: 03 / January / 2011, 10:38:21 »
Tested ptpGUI on Ixus95/SD1200 and WinXP, using CHDKDE build 531. All seems to work.
Colin
« Last Edit: 28 / January / 2011, 18:06:46 by hwntw »
Ixus 300HS S100


Windows 10

*

Offline reyalp

  • ******
  • 14080
Re: CHDK PTP interface
« Reply #336 on: 04 / January / 2011, 02:32:16 »
The "switch_mode_usb"-routine for all cams are in "/generic/lib.c", see changeset 465 and 470.
Thanks. Equivalent changes are in trunk 1022-1023. I did it a little differently so I wouldn't have to touch every lib.c

I didn't get as much as I wanted done on the PTP tool this weekend. Got distracted by patches and exmem, but still made a lot of progress.

I'll try to get it in a public repository next weekend. Not sure where it should go, I'm thinking of making a new project for it on assembla, or maybe github ?
Don't forget what the H stands for.

*

Offline hwntw

  • ***
  • 159
Re: CHDK PTP interface
« Reply #337 on: 04 / January / 2011, 13:04:26 »
Hello,
Exciting times for CHDK-PTP is progressing, scripting support could soon be optional and result in smaller builds, more camera memory availability looks on the cards. My question to developers is: if I opt out of scripting support, will this render PTP usage inoperable?

Colin
Ixus 300HS S100


Windows 10


*

Offline c10ud

  • ***
  • 245
Re: CHDK PTP interface
« Reply #338 on: 04 / January / 2011, 13:30:56 »
unless you hardcode some actions in the ptp code, the possibilities without scripts are very tiny (upload, download, mode change?)

*

Offline reyalp

  • ******
  • 14080
Re: CHDK PTP interface
« Reply #339 on: 04 / January / 2011, 15:34:24 »
unless you hardcode some actions in the ptp code, the possibilities without scripts are very tiny (upload, download, mode change?)
We could expose the "action stack" commands and PostLogicalEvent with very little overhead.

But really I think scripting is the way way to go. If we hard code it in PTP, then we take memory away from every user, even if they don't use PTP at all

You could always use a different binary for PTP and regular shooting, since we now have reboot("filename"), although that currently uses script as well...

Don't forget what the H stands for.

 

Related Topics