Remote interval start with auto shut off - Script Writing - CHDK Forum supplierdeeply

Remote interval start with auto shut off

  • 24 Replies
  • 5694 Views
Remote interval start with auto shut off
« on: 07 / June / 2012, 11:43:21 »
Advertisements
I´m looking for a script to use in my photomapping airplane, i have a camera pointing down and taking pics every 2 sec with the interval script or simple remote trigger.

Problem is during landing that the lense gets dirty as i have no landing gear. And also during takeoff and landing i get "unwanted" pics.

I have been looking around on various forums but couldnt find anything doing what i´m looking for.

I would like a interval script that is remotly started via the usb port that is controlled by a switch on my controller, When the mission is done i turn the switch on my controller to off, and the camera stops taking pictures and shut´s down and retracts the lense.

Any help/tips/ideas would be greatly appriciated

*

Offline msl

  • *****
  • 1274
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: Remote interval start with auto shut off
« Reply #1 on: 07 / June / 2012, 12:56:41 »
There are many ways.

You can start a script via remote control: http://chdk.wikia.com/wiki/USB_Remote_V2#Enable_Script_Start (only available with CHDK developer version http://mighty-hoernsche.de/trunk/)

Add a shutdown command at the end of the script: http://chdk.wikia.com/wiki/CHDK_scripting#shut_down

msl
CHDK-DE:  CHDK-DE links

Re: Remote interval start with auto shut off
« Reply #2 on: 07 / June / 2012, 14:24:08 »
Or you put a line of code at the start of your script to loop until USB power is applied.

Start the camera in playback mode. When USB  power is applied,  the script switches the camera into shooting mode and continues with the intervalometer script.

Somewhere in the intervalometer loop,  insert a check on USB power status.  When power goes away, issue a command to changed from shooting to playback mode and exit the script.  Optionally shutdown the camera under script control.

Ported :   A1200    SD940   G10    Powershot N    G16

Re: Remote interval start with auto shut off
« Reply #3 on: 07 / June / 2012, 14:56:22 »
All good ideas, some days ago i tried different solutions but often got error or the cam would just shot 1 pic and the close down.
And i also needed to start the interval shooting by pressing an button.

Can someone write examples of the code

The camera is S95


Re: Remote interval start with auto shut off
« Reply #4 on: 07 / June / 2012, 15:15:02 »
I'll do it tonight if nobody else jumps in first.
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Remote interval start with auto shut off
« Reply #5 on: 07 / June / 2012, 15:46:57 »
Can someone write examples of the code

It is a built-in feature of SDM.

A signal is also available for an external microcontroller.

Someone in Tahiti is using it for the same application, also with an S95.

I will ask him if I can give you his email address.




« Last Edit: 07 / June / 2012, 15:54:47 by Microfunguy »

Re: Remote interval start with auto shut off
« Reply #6 on: 07 / June / 2012, 16:13:33 »
It is a built-in feature of SDM.
Is there a link to describe that ?
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Remote interval start with auto shut off
« Reply #7 on: 09 / June / 2012, 22:20:17 »
It is a built-in feature of SDM.
Is there a link to describe that ?

While we wait for that link,  here's a tested Lua script that should work on every CHDK supported camera. Feel free to modify it to do exactly what you want it to do.

Code: [Select]
--[[
@title RC Plane Shooter 22
@param a Interval (sec)
@default a 5
@param b Repeat ? (0=no, 1=yes)
@default b 1
--]]

function restore()
  set_backlight(1)
  set_config_value(121, 0)
  shut_down()
end

count = 0
set_console_layout(1, 1, 35, 12)
print("started ...")
print("enabling USB")
set_config_value(121, 1)

repeat

  print("waiting for USB ...")

  repeat
     wait_click(100)
  until is_pressed("remote") == true

  print("USB activate")

  set_record(1)

  repeat
    sleep(500)
  until get_mode() == true

  print("in shooting mode")

  repeat
    nextshot = get_tick_count() + a*1000
    shoot()
    count = count + 1
    print("shoot", count)
    while (get_tick_count() <= nextshot) and (is_pressed("remote") == true ) do
sleep(100)
         set_backlight(0)
    end
  until is_pressed("remote") == false

  set_backlight(1)

  print("USB released")

  set_record(0)

  repeat
    sleep(100)
  until get_mode() == false

until b == 0

restore()

Note that the second parameter determines whether the camera shuts down when USB power is removed or if it loops back and starts shooting again once  USB power is re-applied.  Either way,  the camera is in playback mode with the lens retracted whenever there is no USB power.

You probably want to set the lens retract delay to zero in the Canon menus so that the lens retracts right away when shooting stops.

Update :  Incidentally,  the new trunk USB remote code can be configured to  automatically take continuous pictures whenever USB power is applied.  No scripting required.
« Last Edit: 09 / June / 2012, 22:44:56 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16


Re: Remote interval start with auto shut off
« Reply #8 on: 10 / June / 2012, 06:18:55 »
While we wait for that link,  here's a tested Lua script that should work on every CHDK supported camera.

It is simply the parameter settings in the timelapse script of SDM 1.86.

1.86 has not yet been released because testers keep letting me down.

airfoto.se did not respond to my request for testing the build other than acknowledging receipt.

No further assistance will be given and he will not be put in contact with another SDM user who is already doing a similar application.

Re: Remote interval start with auto shut off
« Reply #9 on: 10 / June / 2012, 11:35:53 »
The parameter settings in the timelapse script of SDM 1.86.
Found the link : http://stereo.jpn.org/eng/sdm/tlapse.htm

I see where you can set it up to start shooting when USB power is applied and shutdown when the power is removed.

Can it also be configured to loop rather than shutdown ?   (i.e.  shoot while USB power is active and wait in palyback mode (lens retracted) when USB power is not active).  This would allow shooting only while the plane is over something of interest.

Ported :   A1200    SD940   G10    Powershot N    G16

 

Related Topics