How can I turn on usb trigger mode via PTP? Or open CHDK Main Menu

  • 1 Replies
  • 234 Views
How can I turn on usb trigger mode via PTP? Or open CHDK Main Menu
« on: 26 / September / 2017, 09:31:48 »
Advertisements
Hi guys, I've been bashing my head against the wall for a few days. I'm new to chdk scripting but I am a programmer. I have a  Powershot A2200 with 1.00c firmware, and CHDK 1.50 seems to work well in general on this camera. I use chdkptp on Ubuntu and it works, I'm able to send some command like = set_zoom(100), and chdkptp gui can show the live view finder and so on. I do begin my ptp sessions with the proper switch_mode_usb(1) and (0) etc.

I want to use chdkptp and in the middle of the script, I want to turn on usb trigger mode (yes, that will kill the usb ptp connection). There doesn't seem to be a call to do this however.

Another way to do that would be to open the Chdk menu with simulated key presses (<ALT> and then <MENU>) but no matter what I try, that doesn't happen. If I use

Code: [Select]
= post_levent_to_ui('PressDispButton"); post_levent_to_ui('UnpressDispButton"); post_levent_to_ui('PressMenuButton"); post_levent_to_ui('UnpressMenuButton")
Then the regular canon menu opens.

If I do
Code: [Select]
= enter_alt(); press("menu")
samt result, and so on (I have tried every combination of commands possible), no matter what I try.

Help, please!
« Last Edit: 26 / September / 2017, 10:05:43 by maymaykumar »

*

Offline reyalp

  • ******
  • 10944
Re: How can I turn on usb trigger mode via PTP? Or open CHDK Main Menu
« Reply #1 on: 26 / September / 2017, 18:07:29 »
You cannot send key presses to the CHDK UI, so you can't navigate the menu this way.

You can set most menu options using set_config_value: http://chdk.wikia.com/wiki/Script_commands#set_config_value

Depending on exactly what you are trying to do, you may not need to change the menu options.

You can use usb_force_active http://chdk.wikia.com/wiki/Lua/PTP_Scripting#usb_force_active to make the canon firmware think the USB is still present while controlling using the remote. You can use usb_sync_wait if you want to use USB power to control a shot started from script. You can also use get_usb_power() or is_key("remote") from script even if the remote options are not enabled.
Don't forget what the H stands for.

 

Related Topics