Script to 'retain' settings (focus and shooting modes) after power-down?

  • 9 Replies
  • 1493 Views
Advertisements
Hey, everyone

Sorry for asking such a basic question, but I'm preety new to CHDK and I was wondering if someone could help me out.

I'd like to know if there's a simple script available (or how I could put one together if there isn't) that will select both continuous drive shooting mode and manual focus on power up? I'm using a Canon A710 IS in P Mode for street photography, and it would be great if my camera somehow retained these settings - at the moment, I have to manually select them each time (a real pain).

For reference, I'm using the latest version of CHDK with a Canon Powershot A710 IS (in P-Mode).

Thanks in advance!
« Last Edit: 31 / January / 2016, 10:22:59 by The Man With The Red Bag »

Re: Script to 'retain' settings (focus and shooting modes) after power-down?
« Reply #1 on: 31 / January / 2016, 11:26:52 »
I'd like to know if there's a simple script available (or how I could put one together if there isn't) that will select both continuous drive shooting mode and manual focus on power up?
CHDK allows you to have a script that runs when CHDK loads and CHDK can be configured to load when the camera powers up.

CHDK is able to set some Canon configuration parameters directly by writing to Property Case variables.  Unfortunately,  manual focus and continuous modes cannot be set that way.

However, it is possible to enable MF mode using a script function - set_mf( ).  Note that this function does not work on every Canon camera.  However, according to this it should work for your A710

Setting continuous drive shooting mode is somewhat more difficult.  It is possible to have a script simulate camera key presses though.  So one way to handle this is to have the script simulate the manual steps you make (when you remember) as you start your camera. The only drawback to this method is that you have to wait a couple of seconds while it runs - slowing down camera startup. That might be inconvenient if your street scene subject walks away while you are waiting for the sequence to complete.

Quote
I'm using a Canon A710 IS in P Mode for street photography, and it would be great if my camera somehow retained these settings - at the moment, I have to manually select them each time (a real pain).
What do you use Manual Focus for?  Are you looking for not just manual focus but a fixed distance focus setting as well?   Or do you want to be able to adjust the focus with the buttons on the back of the camera (or the zoom lever maybe) as you take pictures?

I can post a quick & dirty script that should do what you need once I know the answer to the questions I've posted here.
« Last Edit: 31 / January / 2016, 11:37:19 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Script to 'retain' settings (focus and shooting modes) after power-down?
« Reply #2 on: 31 / January / 2016, 11:52:38 »
Hi, waterwingz, and many thanks for the quick and informative reply - very much appreciated!

If you could post a quick script for me, that would be extremely helpful indeed - thank you ever so much!

I don't need to adjust the manual focus at all - I set it to infinity once selected, and that's where it stays (at the moment, I'm using the focus override option in CHDK which saves me having to manually adjust it after selected).  Likewise, the added extra bit of start-up time won't really be an issue - simulating button presses seems like a great idea to set up the continuous shooting mode.

To give you an idea, my current routine goes something like this:

Power up the camera, select continuous shooting mode, select manual focus, go about my business taking shots, power down.

It's a relatively simple process to do manually, but I find I often forget/ have to fuss about while wearing gloves, etc. Anything that fully automates the manual focus and drive mode selections would be an amazing help.

In addition (I'm not sure anything can really be done about this, but it's worth a mention), the manual focus mode reverts back to auto focus if the display is turned off/on - this has caught me out a couple of times. At the moment, I'm having to keep the LCD screen on to prevent this (I use the view finder, mostly, so I often switch the LCD off to save the battery) - not ideal, but neither is it a huge issue; it just means taking a few extra batteries along.

Thanks once again, and all the best

All in all
« Last Edit: 31 / January / 2016, 11:57:32 by The Man With The Red Bag »

*

Offline srsa_4c

  • ******
  • 3710
Re: Script to 'retain' settings (focus and shooting modes) after power-down?
« Reply #3 on: 31 / January / 2016, 11:59:47 »
@The Man With The Red Bag
It would be possible to make a script without simulated keypresses, if you can do some research:
try following the "howto" section here to find out the UI property IDs and their values for drive mode, focus mode, etc.


Re: Script to 'retain' settings (focus and shooting modes) after power-down?
« Reply #4 on: 31 / January / 2016, 12:54:41 »
If you could post a quick script for me, that would be extremely helpful indeed - thank you ever so much!

I don't need to adjust the manual focus at all - I set it to infinity once selected, and that's where it stays (at the moment, I'm using the focus override option in CHDK which saves me having to manually adjust it after selected). 
Script attached.  It switches the camera to shooting mode if it's in playback mode, does the key clicks necessary to enable continuous shooting, and enables's MF at infinity using CHDK functions.  You can set the delay between key presses in the script parameters.  It's defaulted to 1/2 second which seems to work well on my camera.  Also,  you won't need the focus override option in the CHDK menus any longer.

I don't have an A710 so I had to do it blind (although I tested on one of my cameras). The key sequence is different on my camera so I guessed using the A710 Advance Manual. From what I can tell,  the key sequence after startup in shooting mode is :
  • Func/Set
  • Down
  • Right
  • Func/Set
If not, the script will need to be modified to suit. 

Note that this assumes the camera has just been started when the script runs.  If you rerun the script, the key press thing may give strange results as the Func/Set menu does not reset to startup state each time it is enabled.

For reference, the section in the manual explaining how to enable this at startup is here :  Script Autostart

Quote
In addition (I'm not sure anything can really be done about this, but it's worth a mention), the manual focus mode reverts back to auto focus if the display is turned off/on - this has caught me out a couple of times. At the moment, I'm having to keep the LCD screen on to prevent this (I use the view finder, mostly, so I often switch the LCD off to save the battery) - not ideal, but neither is it a huge issue; it just means taking a few extra batteries along.
I've seen this mentioned before but I don't recall anyone having a solution.  But I added a "Display Off" option to the script. If you select it,  it will disable the display before setting MF mode.  See if that helps?

@The Man With The Red Bag It would be possible to make a script without simulated keypresses, if you can do some research: try following the "howto" section here to find out the UI property IDs and their values for drive mode, focus mode, etc.
This would result in a better script although it's not really what you would call currently "supported" in CHDK.  And as I don't have the camera to test with or the time to invest in this,  I'll leave the missionary work here to anyone else interested in giving it a try.
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Script to 'retain' settings (focus and shooting modes) after power-down?
« Reply #5 on: 31 / January / 2016, 13:27:28 »
Thanks ever so much!

I gave it try and, after modifying the sequence slightly, it switches to continuous shooting mode perfectly! Brilliant!

Unfortunately, though, it doesn't seem to switch to manual focus - perhaps the option isn't supported? Any way to do this in a similar fashion, I wonder?

At the very least, that's one less setting I have to fiddle with - much appreciated!  :)
« Last Edit: 31 / January / 2016, 13:56:24 by The Man With The Red Bag »

Re: Script to 'retain' settings (focus and shooting modes) after power-down?
« Reply #6 on: 31 / January / 2016, 13:53:42 »
I gave it try, but the sequence is a little different for the shooting mode selection.
Updated script attached.

Quote
Manual focus doesn't seem to work at the moment - not sure if it will once the drive mode is done, but at least I'll have one of them automated which would be a great help.
It should work - I tested on my camera.  How are you determining that it doesn't work?  Did you try some test shots?  It might not actually activate the Canon MF indicator on the LCD even though it's working.  The CHDK OSD display can be setup to show the Subject Distance setting - that's usually a better indicator.

We could also force the CHDK menu's SD override menu setting via the script to mimic what you were doing manually. But that actually uses the same underlying MF code as what I've already tried so it should not be necessary.

Worst case here we could add one additional key click to press the MF button to put the camera into Canon MF mode.
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Script to 'retain' settings (focus and shooting modes) after power-down?
« Reply #7 on: 31 / January / 2016, 14:01:01 »
No, wait! My mistake - it's working! Fantastic!

I somehow managed to mess up a bit of the code - I really shouldn't play with things I don't fully understand (lol).

Great! I'll set the script to run on startup, and I'm good to go - thanks ever so much for all your help!
« Last Edit: 31 / January / 2016, 14:24:00 by The Man With The Red Bag »


Re: Script to 'retain' settings (focus and shooting modes) after power-down?
« Reply #8 on: 02 / February / 2016, 20:44:56 »
Just wanted to post a brief update.

Had the chance to take the camera out on the street, earlier today, and the script is working perfectly - the results were exactly as I was hoping for.  :D

Thanks again!

Re: Script to 'retain' settings (focus and shooting modes) after power-down?
« Reply #9 on: 02 / February / 2016, 20:55:25 »
Had the chance to take the camera out on the street, earlier today, and the script is working perfectly - the results were exactly as I was hoping for.  :D
Thanks for the note. Many times we help people here and never hear what happens.  I'm pretty sure they leave happy and get lost in the new world of CHDK fun.   But it's nice to get some feedback.
Ported :   A1200    SD940   G10    Powershot N    G16

 

Related Topics