CHDK PTP interface - page 39 - General Discussion and Assistance - CHDK Forum
supplierdeeply

CHDK PTP interface

  • 1244 Replies
  • 518408 Views
Re: CHDK PTP interface
« Reply #380 on: 19 / January / 2011, 14:21:42 »
Advertisements
>It's not different, shoot uses exactly the same code. Shoot does not switch any other camera to record >mode with USB connected that I know of.

I find now wy shoot can work on my Camera.its because key mask2 for pysw_status[2] is wrong.

when in alt mode the USB flag bit is clear.So USB does not work in alt mode(i get could not find any device messages then) , but shoot can switch to record mode.

only when leave alt mode USB work.but then shoot full always switch to record mode due to canon firmware

so a solution to deactivate USB temporary seem also set the pysw_status flag switch to record mode, and set it back.
Ixus 1000 HS

*

Offline reyalp

  • ******
  • 14111
Re: CHDK PTP interface
« Reply #381 on: 19 / January / 2011, 15:26:38 »
I find now wy shoot can work on my Camera.its because key mask2 for pysw_status[2] is wrong.

If you mask the USB power bit (for example, by enabling USB remote), then your cameras isn't in PTP mode, so you can switch and shoot without any special tricks, it's just like unplugging the cable.

I actually considered as an alternative to mode switching: write a script that masks USB, does whatever it needs to, then turns USB back interact with PTP. But this is far more limited than having USB running while shooting.
Don't forget what the H stands for.

Re: CHDK PTP interface
« Reply #382 on: 20 / January / 2011, 04:49:25 »
>I actually considered as an alternative to mode switching: write a script that masks USB, does whatever it >needs to, then turns USB back interact with PTP. But this is far more limited than having USB running while >shooting.

maybe the value of

_set_control_event(0x902);

is wrong for the Camera.How is this value get ?

maybe a G12 or SX30 user can tell if this is really work in ptp code, to switch to rec mode during play(when alt mode is not active to avoid mask set problems)

this is the command for this i use.

C:\Users\pc>e:\chdk\ptpcam --chdk="mode 1"

I dont understand  wy G12 SX30 can work, because IX1000 is very simular to this.
Ixus 1000 HS

Re: CHDK PTP interface
« Reply #383 on: 26 / January / 2011, 16:22:17 »
Do somebody know if there are a version of ewavr's application that works with A495 or A480? When I try to use that crashes camera, currently I'm using the CHDK 1053 trunk

tks


*

Offline reyalp

  • ******
  • 14111
Re: CHDK PTP interface
« Reply #384 on: 26 / January / 2011, 16:25:52 »
Do somebody know if there are a version of ewavr's application that works with A495 or A480? When I try to use that crashes camera, currently I'm using the CHDK 1053 trunk
No there is not. As I've explained before, getting any of this working requires hacking.
Don't forget what the H stands for.

Re: CHDK PTP interface
« Reply #385 on: 27 / January / 2011, 00:18:29 »
Stupid question time - again.  

Trying to run ptpCamGui.exe with my CHDK PTP enable camera (SD940 beta6).  It finds my camera okay  ( init() successful ).  But when I click on any of the buttons in the GUI, the camera appears to try to run a script (script type menu box on camera LCD briefly scrolls past) but not much happens.   If I click the "Camera Off" button it shuts down the camera so something is working.

I'm guessing that I need a LUA script of some sort loaded on the camera when I do this ?  Is that what luar is ?  I really get lost understanding the term luar - posted about that previously but did not understand the answer.

EDIT: seems to  hang with status window on ptpCamGui.exe scrolling  >> luar get_mode() << false (Length: 6)
« Last Edit: 27 / January / 2011, 00:23:54 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline whim

  • ******
  • 2046
  • A495/590/620/630 ixus70/115/220/230/300/870 S95
Re: CHDK PTP interface
« Reply #386 on: 27 / January / 2011, 03:20:07 »
Hi waterwingz,

try this:
Hook up cam and start in Play mode, then start ptpCamGui.
After init() completes, press Record, and then Play. After that, most options work
on my old ixus70_sd1000. You don't need to install any script, or anything, ptpCamGui
just needs a recent ptpcam.exe, and (on the cam) a plain vanilla CHDK-DE trunk to run.

wim
« Last Edit: 27 / January / 2011, 05:40:52 by whim »

Re: CHDK PTP interface
« Reply #387 on: 28 / January / 2011, 00:51:56 »
ptpCamGui just needs a recent ptpcam.exe, and (on the cam) a plain vanilla CHDK-DE trunk to run.
Hmmm... trying to get PTP working with the current trunk version of CHDK.  I'm not too interested in exploring the German versions of CHDK - I'm just working on a beta for the SD940 in the current trunk. 

I can talk to my camera with ptpcam and seem to get ptpcam --chdk to interact with me.

Simple things like
        ptpcam --chdk="lua print('test'); sleep(1000);"
or
        ptpcam --chdk="lua a=10; b=20; c=a+b; print('answer=',c); sleep(1000); return c;"
print a value on the display and then exit so things seem to be working.

Does ptpCamGui need CHDK PTP to support commands not in the current (not-DE) trunk ? And if so, then can the CHDK_GUI be modified to not require the DE version of CHDK ?

Ported :   A1200    SD940   G10    Powershot N    G16


*

Offline whim

  • ******
  • 2046
  • A495/590/620/630 ixus70/115/220/230/300/870 S95
Re: CHDK PTP interface
« Reply #388 on: 28 / January / 2011, 05:16:28 »
Quote
Does ptpCamGui need CHDK PTP to support commands not in the current (not-DE) trunk ? And if so, then can the CHDK_GUI be modified to not require the DE version of CHDK ?
Good questions, but wrong person to address them to  :D
All I can tell you is what's happening in CHDK-Shell, it

  • walks the DE\trunk tree to find the most recent build's \tools\ptpcam directory
  • checks if ptpcam.exe is present there, and compiles it if not
  • downloads ptpCamGui.au3 to ...\CHDK-Shell\work (will not be modified)
  • removes dependancies on AutoIt 'libraries' and puts result into \tools\ptpcam
  • starts it in a new instance of itself when asked to do so

wim
« Last Edit: 28 / January / 2011, 06:13:33 by whim »

*

Offline msl

  • *****
  • 1280
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: CHDK PTP interface
« Reply #389 on: 28 / January / 2011, 06:10:54 »
Does ptpCamGui need CHDK PTP to support commands not in the current (not-DE) trunk ? And if so, then can the CHDK_GUI be modified to not require the DE version of CHDK ?

I've tested the current trunk (rev1053) and the GUI work fine for the a720.

You need a CHDK version with activeted PTP support (camera.h) and ptpCamGui & ptpcam.exe in the same directory. Of course, the ptp-addresses must be available for the used camera.

Execute ptpCamGui. Upon successful connection between the camera and the GUI, you can see the following message in the output window: [** init() successful]

The GUI send to the camera only ptpcam.exe commands (incl. lua & luar).

[luar get_mode() << false] means PLAY mode
[luar get_mode() << true] means RECORD mode

In PTP mode the camera keys are locked. You must switch PLAY->RECORD->PLAY. This unlocked the keys in PLAY mode.

All GUI-buttons send lua commands, e.g. [MENU] lua click('menu')

By activating MD the SHOOT-button send not shoot, but lua md_detect_motion(). This is a simple motion detection test.

In the GUI file menu you can find the item "Copy to Camera". Select a CHDK relevant file. *.bas and *.lua files are copied to A/CHDK/SCRIPTS. *.bin and *.fi2/*.fir are copied to A/. Here is the ptpcam.exe command 'upload' used.

Every command can be also entered directly into the input line. Use (') and not (") for strings.

msl
CHDK-DE:  CHDK-DE links

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal