Concurrent USB remote / ptp - how to? - General Discussion and Assistance - CHDK Forum

Concurrent USB remote / ptp - how to?

  • 9 Replies
  • 5949 Views
Concurrent USB remote / ptp - how to?
« on: 27 / April / 2015, 06:28:18 »
Advertisements
I finally think i've just about got the hang of multicam.lua to self develop and create a helpful autoit based gui for my needs.

So, I just:
downloaded trunk 4153 (thanks whim, CHDK-Shell-v345 works a treat on win7)
go to sx150is 100a kbd.c to add:

"physw_status[USB_IDX] = physw_status[USB_IDX] | USB_MASK ;  // NEW : make it look like 5V is there no matter what"

and...the file structure is changed.

I guess i've missed some nice development work (I last built with 3993). Do I still need a local edit (how / where) or is this a menu item selection or ... ?

Please.
« Last Edit: 27 / April / 2015, 06:29:51 by andrew.stephens.754365 »

Re: Concurrent USB remote / ptp - how to?
« Reply #1 on: 27 / April / 2015, 08:32:31 »
The code in kdb.c has been substantially changed in CHDK 1.4.0 (unstable)  and the various USB hacks have yet to be looked at.

If you use the CHDK 1.3.0 (stable) trunk instead you can still use the patch you quoted.   I believe there is a way to do that in CHDK-Shell?
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Concurrent USB remote / ptp - how to?
« Reply #2 on: 27 / April / 2015, 10:14:44 »
Ok.

Yes, i've now selected "release-1_3_" rather than "trunk" in chdk-shell and downloaded 1_3_4152.

I'll use that as a base for the edit.

Thanks.

*

Offline reyalp

  • ******
  • 14126
Re: Concurrent USB remote / ptp - how to?
« Reply #3 on: 27 / April / 2015, 16:15:07 »
The code in kdb.c has been substantially changed in CHDK 1.4.0 (unstable)  and the various USB hacks have yet to be looked at.

If you use the CHDK 1.3.0 (stable) trunk instead you can still use the patch you quoted.   I believe there is a way to do that in CHDK-Shell?
FWIW, the 1.4 code should allow http://chdk.wikia.com/wiki/Lua/PTP_Scripting#usb_force_active to work on nearly every camera, without any special define or patches.
Don't forget what the H stands for.

Re: Concurrent USB remote / ptp - how to?
« Reply #4 on: 27 / April / 2015, 16:33:29 »
FWIW, the 1.4 code should allow http://chdk.wikia.com/wiki/Lua/PTP_Scripting#usb_force_active to work on nearly every camera, without any special define or patches.
Yes - that just rang a bell.

It may be worth looking into. If so i'll feedback the experience.

Thanks.

Re: Concurrent USB remote / ptp - how to?
« Reply #5 on: 27 / April / 2015, 17:44:13 »
Yes, this is interesting.

I havent yet decided/tested multicam on ptp or usbremote triggering so testing both setups would be easiest via script.

It's practically bed time here in the UK - if this is an easy answer it may give me a head start tomorrow.

Ref

So PTP would be ignored until you set the sharing setting? That would definitely ugly for people who primarily wanted to control via PTP.
I think I explained that right but I'm not sure it's as bad as you are thinking.  After all, that's how it works today - if you have the USB Remote enabled, you can't do PTP.

So without my second version,  the sequence for ptp with precision sync is :
  • make a ptp connection
  • switch to shooting mode via switch_mode_usb()
  • enable USB remote (and sync if it's not already set) by poking the CHDK menu item
  • call share_usb_port(1)
  • shoot
  • drop the USB 5V line
  • restore the USB 5V line
  • repeat steps 5 to 7 until happy
  • call share_usb_port(0)
  • disable USB remote by again by poking the CHDK menu item
  • profit

In 1.4 does usb_sync_wait, mode = 1 or true for wait for sync at next shot

Equate to both steps 3&4 in quoted conversation? (apologies, I haven't had time to read that thread again in detail)


Re: Concurrent USB remote / ptp - how to?
« Reply #6 on: 29 / April / 2015, 12:49:11 »
FWIW, the 1.4 code should allow http://chdk.wikia.com/wiki/Lua/PTP_Scripting#usb_force_active to work on nearly every camera, without any special define or patches.
Update:

using sx150is-100a-1.4.0-r4153-full built straight out of chdk-shell & using chdkptp gui gave:

Code: [Select]
> =usb_force_active(1)
> =usb_sync_wait(1)
> =shoot() -> then disconnect 5V prior to 10 sec delay then immediately reinstate 5V
> =usb_sync_wait(1)
> =shoot() -> then disconnect 5V prior to 10 sec delay
2 consecutive synched shots on transistion from 5v -> 0V [if period between issuing shoot() and voltage transistion > 10 secs a timeout shot happened as expected].

Very nice indeed. I'll try to build usb_force_active(1) into multicam.lua camera side script soon. Much easier than having to work between 2 builds for ptp or usb triggering testing - appreciate the FWIW


Now, to get two consecutive shots (Topic: Faster Sync Triggering?) as quickly as possible I plan to add to multicam.lua camera side similar to the following http://chdk.setepontos.com/index.php?topic=12219.msg120473#msg120473 . It'll need a few changes and i'll need to add

usb_sync_wait(1)

at the start of the script and again immediately after

repeat sleep(20) until get_usb_power(1) == 0 .

Is there anything I can do programatically to ensure the usb_sync_wait(1) has taken effect for the first shot [and prior the 2nd "shoot_full") occurence] or any guidance about how long a wait should be inserted (if any) to allow it to take effect?
« Last Edit: 29 / April / 2015, 14:23:57 by andrew.stephens.754365 »

*

Offline reyalp

  • ******
  • 14126
Re: Concurrent USB remote / ptp - how to?
« Reply #7 on: 03 / May / 2015, 21:37:06 »
Is there anything I can do programatically to ensure the usb_sync_wait(1) has taken effect for the first shot [and prior the 2nd "shoot_full") occurence] or any guidance about how long a wait should be inserted (if any) to allow it to take effect?
You don't need to do anything special, just call it before shoot() or pressing shoot_full. All it does is set a flag that's checked when the actual hook is reached.
Don't forget what the H stands for.

Re: Concurrent USB remote / ptp - how to?
« Reply #8 on: 04 / May / 2015, 04:26:20 »
More good news, thanks:

You don't need to do anything special, just call it before shoot() or pressing shoot_full. All it does is set a flag that's checked when the actual hook is reached.


Re: Concurrent USB remote / ptp - how to?
« Reply #9 on: 21 / May / 2015, 17:55:31 »
Edited: Posted on the wrong topic, sorry  ::)

 

Related Topics


SimplePortal © 2008-2014, SimplePortal