Remote triggering multiple cameras, and transferring images to HD - General Help and Assistance on using CHDK stable releases - CHDK Forum  

Remote triggering multiple cameras, and transferring images to HD

  • 25 Replies
  • 9734 Views
Advertisements
Hi everyone!

I'm a newbie CHDK user. I've built myself a 4 camera rig to be used in photogrammetry. It consists of two Ixus 105 cameras, an Ixus 220HS and an Ixus 80. Right now I'm triggering the cameras mounted to the rig, thru a USB hub and CHDK Remote function set to ON. I power the hub, the cameras focus and when I turn power off, the shoot. It works perfect for now.

My problem is that I can't transfer the pictures to the HD without first disabling Remote on each of the cameras and then connecting them to the computer. Is there a more reliable way of doing it? They're already hooked to the USB hub, and I'd like to transfer images directly to the PC without going one by one disabling Remote. The rig is not too stable, and I'd like to upgrade it soon with more cameras. That's why I'd like to get rid of fiddling with them to turn Remote OFF, it is very unreliable to work like that. Can anybody help me here?

I've tried PTPCamGUI, but I couldn't get it to work with more than one camera at a time. Thanks in advance for your help.

Re: Remote triggering multiple cameras, and transferring images to HD
« Reply #1 on: 24 / October / 2013, 11:57:02 »
My problem is that I can't transfer the pictures to the HD without first disabling Remote on each of the cameras and then connecting them to the computer. Is there a more reliable way of doing it?
If you use a CHDK script rather than the built-in USB remote functions you should be able to get this working.  The script can watch the status of the USB power and simulate the built-in remote shooting function without the USB remote being enabled in the CHDK menu.   This should allow normal PTP communications over the USB line.  Just setup the script so that it does not shoot if the 5V power is active for more than 10 seconds or so.

Quote
I've tried PTPCamGUI, but I couldn't get it to work with more than one camera at a time. Thanks in advance for your help.
There are forum post about people using ptp with multiple cameras.  You will have to do a bit of searching though.
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Remote triggering multiple cameras, and transferring images to HD
« Reply #2 on: 24 / October / 2013, 12:41:51 »
Thanks a lot for your prompt response waterwingz!

That sounds like a great idea. If only I had some idea of scripting.... Unfortunately i don't. Is there any script already available that would do that? Could you point me in any direction?

Once I get the same functionality with the Remote option disabled, I think I'll somehow be able to manage the file transfer myself.

**BTW, I've been trying to do some research on this matter, but everything i found quickly gets so technical that i couldn't understand a thing. Thx again!
« Last Edit: 24 / October / 2013, 12:45:47 by ikercito »

Re: Remote triggering multiple cameras, and transferring images to HD
« Reply #3 on: 24 / October / 2013, 14:02:21 »
I'll post something tonight for you to try.   If you set it up to automatically run at startup,  you'll never know its a script rather than the built-in funcition.

Ported :   A1200    SD940   G10    Powershot N    G16


Re: Remote triggering multiple cameras, and transferring images to HD
« Reply #4 on: 24 / October / 2013, 14:59:11 »
Thanks a million, I'm looking to try it.

Re: Remote triggering multiple cameras, and transferring images to HD
« Reply #5 on: 24 / October / 2013, 18:52:44 »
The script can watch the status of the USB power and simulate the built-in remote shooting function without the USB remote being enabled in the CHDK menu.   This should allow normal PTP communications over the USB line.  Just setup the script so that it does not shoot if the 5V power is active for more than 10 seconds or so.

Hi waterwingz -

from what I read, photogrammetry geometry / texture builds gets really screwed up with any subject movement [makes sense - this post displays the problem http://www.agisoft.ru/forum/index.php?topic=578.msg2576#msg2576], hence my interest in 'concurrent' usbremote 'synch' and chdkptp operation. Thanks to your help [and a few other forum members - which will always be remembered] i've now got a CHDK-Shell build environment setup and the ability to edit/test out the kbd.c file change you suggested on a couple of SX150IS (£35 each) - it doesn't appear, in the porting thread, that any particular synch problems were reported / unreported - so i'm not necessarily expecting plain sailing. I just ordered a couple of 4GB SD cards so testing can start soon  :)

Anyway, to settle my nerves a bit, might you confirm that your suggested 'on camera scripting method' would [likely] result in much worse 'synch' than 'regular' remote synch ? 

Hi ikercito -

I think I already posted this link on the Agisoft forum, you may be interested: http://chdk.setepontos.com/index.php?topic=8769.msg105488#msg105488

[I have not yet investigated (because 'sych' will not be so good as chdkusbremote synch) - but chdkptp might be able to do the lot in a multicam environment - shoot & transfer]. If you were 'scanning' inanimate objects and did not need flash synchronisation - that could be ideal]

Also, please examine waterwingz's script closely [when it appears].
« Last Edit: 24 / October / 2013, 18:58:28 by andrew.stephens.754365 »

Re: Remote triggering multiple cameras, and transferring images to HD
« Reply #6 on: 24 / October / 2013, 19:40:31 »
Thanks a million, I'm looking to try it.
So here's the script.  It watches the USB port and sets focus and exposure when the USB port 5V signal is present.  If the 5v goes away faster than the user settable parameter (default 10 sec) then the script takes a picture.  If the 5v stays longer then the script enables the USB port for ptp communication and waits until the 5v goes away.  No picture is taken in the second case.

Save this code to a file called  usbptp.lua and copy to the CHDK/SCRIPTS directory of your SD card.  Use a simple editor like Notepad (not a word processor).

Code: [Select]
--[[
@title USB PTP Shooter
   @param   d  Delay (sec)
   @range   d  5 60
   @default d  10
--]]

delay = d*1000
shot = 1
set_console_layout(1, 1, 44, 10)
print("USB & PTP Started ...")
set_config_value( 121, 1 )   -- USB port disable
sleep(5000)
-- switch to shooting mode if necessary
    if ( get_mode() == false ) then
        set_record(1)
        while ( get_mode() == false ) do sleep(100) end
    end
repeat
    if (get_usb_power(1) == 1) then
        timer = 0
        print("USB is active")
        press("shoot_half")
        repeat
            sleep(50)
            timer = timer + 50
            x=get_usb_power(1)
        until (x == 0) or (timer > delay)
        if ( x == 0 ) then
            click("shoot_full_only")
            sleep(500)
            release("shoot_half")
            print("Shot " .. shot.." complete.")
            shot = shot+1
        else
            release("shoot_half")
            print("No shot - waiting for USB release")
            set_config_value( 121, 0 )   -- USB port enable for ptp
            repeat sleep(1000) until (get_usb_power(1) == 0)   
            set_config_value( 121, 1 )   -- USB port disable
            print("USB released")           
        end 
    else sleep(100) end
until false
One drawback of this script method is that chdkptp does not like connecting to your camera while a script is running.  You can use liveview but not commands to upload images.
« Last Edit: 24 / October / 2013, 20:23:05 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Remote triggering multiple cameras, and transferring images to HD
« Reply #7 on: 24 / October / 2013, 19:43:46 »
Anyway, to settle my nerves a bit, might you confirm that your suggested 'on camera scripting method' would [likely] result in much worse 'synch' than 'regular' remote synch ? 
The script I posted above will not do "precision" sync as written. Enabling the USB remote sync menu option makes no difference in this case.   Variations between cameras of as much as 100 mSec are quite possible.

Ported :   A1200    SD940   G10    Powershot N    G16


Re: Remote triggering multiple cameras, and transferring images to HD
« Reply #8 on: 24 / October / 2013, 20:08:44 »
Wow..! Looks really promising, will check tomorrow ASAP. Thanks a lot!

Re: Remote triggering multiple cameras, and transferring images to HD
« Reply #9 on: 24 / October / 2013, 20:51:22 »
The script I posted above will not do "precision" sync as written. Enabling the USB remote sync menu option makes no difference in this case.   Variations between cameras of as much as 100 mSec are quite possible.

Thanks waterwingz [and thanks for the script also (if closely examined all of these 'things' add to the understanding of others) - and that is a 'gift'].


Edit [for my memory]

background history for:

set_config_value( 121, 1 )   -- USB port disable
set_config_value( 121, 0 )   -- USB port enable for ptp

see here

http://chdk.setepontos.com/index.php?topic=6429.0 [2nd June 2011]

"Is there anyway to turn on/off the CHDK remote parameter PROGRAMMATICALLY, without having to go through the CHDK menu?"
->
"...Maybe CHDK-DE is a solution for you. There is a script function get/set_config_value(). With this function you can get/set most configuration values, also on/off remote control -> set_config_value(121, <1|0>)."
->
"...Added as of release 1348 to the regular CHDK - supported in both LUA and uBASIC."


but note: http://chdk.setepontos.com/index.php?topic=8291.0 [8th July 2012]

"Only one question: it could be possible to connect the four cameras by a hub to the computer, and open four PTPCamGui applications, one for each camera? Thank you very much."
->
"To use ptpcamgui or other PTP software, you have to use the PTP Extension, not USB remote. In that case, you can use a hub. I'm not sure about ptpcamgui, but you can run multiple PTP client applications. You have to be careful because some operations could cause other instances to disconnect."
->
"...ptpCamGui is not suitable. A function to connect multiple cameras has been tested temporarily, but this feature was too unstable and was removed."




http://chdk.wikia.com/wiki/CHDK_Scripting_Cross_Reference_Page

  • get_mode -> Returns whether record mode or playback mode is active, useful for closing scripts that are meant to be run in a certain mode (like the majority of all available scripts). Returns 0 in record mode, 1 in playback mode, 2 when mode dial is set to videomode AND camera is in record mode (2 since changeset #499) **This command has advanced functionality in Lua, see Lua Reference: get_mode]
  • get_usb_power -> get status of USB connector ( voltage present or not present ) [http://chdk.wikia.com/wiki/USB_Remote: Calling function get_usb_power with parameters = 1 returns the current state of USB power ( 0=off, 1=on)]
  • click -> press and release a key
  • release -> releases the specified camera button
  • press -> activates the specified camera button

in more detail http://chdk.wikia.com/wiki/UBASIC/TutorialScratchpad:

Camera commands can be written in 3 flavors / command-methods:

click "button-name"
Presses the button momentarily, used for one time, instantaneous commands. This will be the most often used method of issuing a camera command.

press "button-name"
Presses and HOLDS the required camera button, it remains pressed until the same button-name is given the release command. Some camera commands can only be accessed when a button is held down during use.
Example: In Manual Focus in the S-series cameras the MF button needs to be held down while the focus commands are being issued. Or when shooting in high-speed burst mode, then the shutter button must be held down during its needed duration with the press "shoot_full" command.

release "button-name"
Ends the press "button-name" command. If using a press "button-name" command be sure to end it with the release "SAME-button-name command at the appropriate sequence in your script to reset things back to normal.

All camera command buttons that you can press manually you may use in your scripts using this syntax. The only exception is the often-used shoot command. shoot is used by itself without the leading click, press, and release command methods.

and Additional uBASIC and Lua Scripting Commands http://chdk.wikia.com/wiki/Script_commands
« Last Edit: 14 / December / 2013, 11:33:29 by andrew.stephens.754365 »

 

Related Topics