Ultimate Intervalometer - a script for shooting over a long duration - v4.9 - Completed and Working Scripts - CHDK Forum

Ultimate Intervalometer - a script for shooting over a long duration - v4.9

  • 651 Replies
  • 218208 Views
Advertisements
I've seen many references to an "ultimate" intervalometer CHDK script but after patient searching here on the forum, on the wikia, and via google, I have yet to find such a script.   I think it's a typo for the simplistic "Ultra Intervalometer" script.  So I'd like to release somethings I've been using - something that encompasses everything I've wanted in an intervalometer  - as the "Ultimate Intervalometer" script.

There are several really good special purpose intervalometer scripts available today. In addition, there are a wheelbarrow full of scripts that simply take a shot on a defined interval.  The most recent example of a great dedicated intervalometer is lapser's excellent fast shooting scripts for sunsets (and anything else you want in slow-mo  rather than a time-lapse). 

The Ultimate Intervalometer is another special purpose script - one for shooting sessions that could stretch over months. It deals with midnight roll-over and with periodically rebooting the camera to reset the tic timer and anything else that was not designed to run for weeks or months (never mind more than a the few minutes people normally uses their camera for).

It provides all the known methods of blanking the display / power savings .  In addition,  it can be configured to periodically blink one of the camera's LED's just so you know the script is still running.

There is a wiki page :  Ultimate Intervalometer that describes how to use the script.  I won't repeat it all here.  But the major features are :
  • Start shooting each day on any combination of a fixed time, dawn, or brightness.
  • Stop shooting each day when all combinations of a fixed time, dusk, and brightness are satisfied.
  • Day of week schedule to select on which days shooting will occur ( All,  Mon-Fri, Sat-Sun )
  • Periodic automated restarts of the camera to reset internal timer and assist with long term stability.
  • Optional exposure bracketing (HDR)
  • Support for all known power savings techniques ( backlight off. display off, sleep mode,  playback mode)  if supported by the camera model.
  • Interval shooting in sync to the time of day  (e.g. 60 minute intervals always occur at the top of the hour, 30 minute intervals a the top and bottom of the hour, etc.)
  • Sets the zoom lens to a user define position (reset zoom to that position after periodic script intitiated restarts)
  • Optional LED slow blink to let you know the script is still running when the display is off.
  • Detailed logging of operation to SD card (optional).

I've posted the latest version of the script here : ultimate.lua

Recent Changes :
Updated : June 8 2013 to v1.7  - added disable of flash, image stabilization, focus assist lamp
Updated : Sept 5 2013 to v1.8  - fixed typo in Day of Week code
Updated : Dec 15 2013 to v1.9  - added low battery voltage detection and shutdown
Updated : Dec 28 2013 to v1.10 - set_lcd_display() and support for inverted start & stop times
Updated : April 4 2014 to v2.0  -  themes and the ability to pause for download via PTP
Updated : Dec 22 2014 to v2.3  -  increased valid range of reset intervals to 365 days.
Updated : April 25 2015 to v2.5  -  fixed Playback power save and with script not shooting at midnight
Updated : May 15 2015 to v3.0  -  general cleanups including focus at infinity, log file open timeouts & exposure bracketing.
Updated : Oct 31 2015 to v3.2  - adds optional shutdown after user specified # of days and SD card full shutdown.
Updated : Nov 1 2015 to v3.3  - fixed bug in log formatting
Updated : Nov 22 2015 to v3.4 - fixed bugs is PLAYBACK and SHORTCUT display off modes
Updated : Dec 05 2015 to v4.1 - CHDK 1.4.0 version with enhanced HDR/bracketing
Updated : May 01 2016 to v4.2 - added user disable of scheduled day/night plus bugs fixes
Updated : May 14 2016 to v4.3 - writes user setup selections to log file
Updated : Jul 22 2016 to v4.4 - allows deletion of oldest images from current run when SD card is full
Updated : Jun 21 2017 to v4.5 - changed HDR mode to use set_tv96_direct, set_av96_direct and bypass the CHDK range checks
Updated : Nov 26 2017 to v4.7- added option to trigger shots via a CHDK USB remote compatible device. Plus a few minor bug fixes.
Updated : Apr 7 2018 to v4.8- fixed crashing on some cameras when LCD disabled in PLAYBACK mode
Updated : Nov 1 2020 to v4.9 - IS fixes from srsa_4c
Updated : May 8 2021 to v4.10 - recent camera display resolution detect fixup from srsa_4c
FAIR WARNING :  CHDK is a hack and there has been very little testing of sustained long term operation.  And there is no guarantee that Canon firmware will work over an extended period of being powered up.   The periodic rebooting of the camera via this script is not guaranteed to work every time.

Also voltages read by the camera are not necessarily accurate. Do not trust the script's low-voltage cutoff to protect lithium polymer batteries from discharging below 3V per cell for example.
« Last Edit: 08 / May / 2021, 20:24:29 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

I'll use a second post to start an "upgrade/change needed" post for the Ultimate Intervalometer.

Right off the bat,  there are several things I did not get to,  fearing shipwright's disease :
  • Of the various power saving / LCD off modes,  the mode where the camera idles in Playback mode has been shown to save almost as much power as turning the display off or sleeping (on cameras that support that).  However,  in playback mode the lens will retract - using power and introducing wear&tear on the mechanism.   This might be a good thing to protect the lens between shots though?  Should I add an additional playback mode that periodically switches to shooting mode and back just before the lens would have retracted?
  • While the script monitors SD card space,  it does not currentlly do anything when space runs low. Considering the script is supposed to run for weeks or months on its own,  providing some sort of user selected alert (display on & flashing,  blinking focus assist lamp,  beeping ) when the card is almost full seems like a good idea?
  • Assuming someone might try running on a large external battery then a low battery alarm like the ones listed above might make sense?
  • The minimum Tv mode that starts and stops shooting based on shutter speed is easy to understand.  But what you really want is brightness (Bv) - I just didn't use that because the units are not well understood by most.  What Bv96 value corresponds to dusk?  Should a Bv mode be added too?
  • Focus lock / manual focus distance / hyperfocal lock -  necessary or not ?

I'm sure there are other things?
« Last Edit: 20 / May / 2013, 16:47:53 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline bwh13

  • *
  • 28
Ultimate Intervelometer script
« Reply #2 on: 22 / May / 2013, 01:55:39 »
Hi All,
I just downloaded the !NEW! Ultimate Intervelometer script and I'm psyched to get it going.

I've got 2 things I want to share: one is a solution to a problem I had with the script, the other is a problem that still exists.

First my specs: SD1000 (ixus70) FM:101B.  I downloaded the 1.2.0 build to run the script

SOLUTION:
I would try to run the script, but it was not recognizing my 1.2.0 build.  The onscreen error message referenced the script line number 368:
"if (bi.build_number ~= "1.2.0") then"
To get the script to work, I had to modify the script to include my SVN number (-2797).  the modified line looks like this:
"if (bi.build_number ~= "1.2.0-2797") then"
After this, the script started to work.

PROBLEM:
The script starts to work and even takes the first picture, but onscreen there is an error message that states:
":99: bad argument to format  #5  (expected number, got nil)
TERMINATED"
Line #99 looks like this:
"local str=string.format(...)"
this appears to be part of the script that looks at the log_mode and writes the error message to the screen and/or the card.

I'm in DAY mode now (I was in NIGHT mode when it was taking the first picture before bombing out).  It is 22:00 hours and I've got the START and STOP times set appropriately (21:00 & 23:00 respectively).  In DAY mode, it doesn't take the first picture at all and the error message states "bad argument to format #4"

Anyone have any advice?  We're gearing up to deploy this setup so we can capture a lake's melting ice cover this spring in the mountains.  Our water temperature data suggest it happens over a period of a couple of weeks and we would like to capture that.  This script seems like just the ticket.

Thanks in advance for any ideas!
Brian

Re: Ultimate Intervelometer script
« Reply #3 on: 22 / May / 2013, 07:23:06 »
Thanks for the testing report.  Forty one downloads of the script and this is the first report of these issues.

I would try to run the script, but it was not recognizing my 1.2.0 build.  The onscreen error message referenced the script line number 368:
"if (bi.build_number ~= "1.2.0") then"
To get the script to work, I had to modify the script to include my SVN number (-2797).  the modified line looks like this:
"if (bi.build_number ~= "1.2.0-2797") then"
After this, the script started to work.
I'm guessing that  "autobuild" versions of CHDK return a different string than the ones people build for themselves.  I tested the script on three different cameras but I compiled the CHDK they were each running myself.  I'll change the string compare to just check that the second digit is 2 or greater.

Quote
I
The script starts to work and even takes the first picture, but onscreen there is an error message that states:
":99: bad argument to format  #5  (expected number, got nil)
TERMINATED"
Line #99 looks like this:
"local str=string.format(...)"
this appears to be part of the script that looks at the log_mode and writes the error message to the screen and/or the card.

I'm in DAY mode now (I was in NIGHT mode when it was taking the first picture before bombing out).  It is 22:00 hours and I've got the START and STOP times set appropriately (21:00 & 23:00 respectively).  In DAY mode, it doesn't take the first picture at all and the error message states "bad argument to format #4"
It seems likely you are hitting a test case I did not try.  And as the error is in the logging function and due to an invalid passed parameter,  its hard to know immediately what called it.  When I have a spare couple of minutes today I'll scan the code and figure you where this is coming from.

Please let me know exactly what you set each of the user parameter values to?

Update : had a few minutes to look at the script between flights today.  The issue (as usuallly happens) relates to the way I was testing the last feature I implemented (Tv).  In night mode or with Tv mode off,  the script either does not check exposure ofter or ever.  So the print statements at lines 471 & 473 end up with undefined exposure values.  Edit those lines or insert default values up during the initialization phase of the script.  I'll post an updated version later today
« Last Edit: 22 / May / 2013, 19:54:50 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16


*

Offline bwh13

  • *
  • 28
Re: Ultimate Intervelometer script
« Reply #4 on: 22 / May / 2013, 14:12:05 »
Good morning!
Thanks for the prompt reply.
Here are the settings that I tried this morning at 10am local time.
Shot interval: 1min
Zoom: 0
Dawn: off
Dusk: off
Start hr: 6
Start min: 0
End hr: 20
End min: 0
Day of Week: All
Tv: 0
Reboot: 1
Status LED: off
Blanking: none
Latitude: 410
Longitude: -1230
UTC: -8
Logging: Both

It might be worth noting that when I tried the script this morning, that the title box had a Tv value of 0.3 [hi] and that the Disp: 0 & Mode: DAY.  Today, the script took one picture, but then I got the same error as last night: ":99: bad argument to format #5 (expected value, got nil)"

Regarding your suggestion to edit lines 471 & 473 and place default variables: I've looked at the code and not sure which variables I would edit or what those defaults values would be

Thanks in advance!  Let me know what I can do to help you out!

Re: Ultimate Intervelometer script
« Reply #5 on: 22 / May / 2013, 15:42:18 »
Regarding your suggestion to edit lines 471 & 473 and place default variables: I've looked at the code and not sure which variables I would edit or what those defaults values would be

Thanks in advance!  Let me know what I can do to help you out!
I believe I've found and fixed both of the issues you identified.  I'll post an update in a couple of hours when I have a few moments to actually test the changes more completely  :-[

On an unrelated note,  have you worked out how you are going to power your camera over the duration of you "melting lake ice" shoot?  I'm assuming you've read enough to realize the camera internal battery will not be enough even with the best script power savings tricks.
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline bwh13

  • *
  • 28
Re: Ultimate Intervelometer script
« Reply #6 on: 22 / May / 2013, 19:23:39 »
Bug fixes: Wow! That's great news! I can't wait to try them out. I would be interested in hearing about them and why you think no one else encountered similar problems.

Battery life: I have given that some thought. I wanted to make sure that the script works before I spent too much time on it.  Our plan is to modify the DC adaptor and plug a big battery into the other end. We've been scoping some batteries and mini solar panel setups from AdaFruit.  As you can tell, we're only a couple steps past the conceptual stage.  If you have any tips or tricks I would love to hear about them.

Thanks again; can't wait to test the new script!

Re: Ultimate Intervelometer script
« Reply #7 on: 22 / May / 2013, 19:52:31 »
Bug fixes: Wow! That's great news! I can't wait to try them out.
Version 1.5 now available.  Has fixes for the CHDK version string being different for versions from the autobuild versus versions built from the svn.  Also fixed the uninitialized variable when tv mode is turned off.

Quote
I would be interested in hearing about them and why you think no one else encountered similar problems.
I think many people downloaded the script to have a look at it but have not had a "long term" intervalometer application that they need it for yet.

Quote
Battery life: I have given that some thought. I wanted to make sure that the script works before I spent too much time on it.  Our plan is to modify the DC adaptor and plug a big battery into the other end. We've been scoping some batteries and mini solar panel setups from AdaFruit.  As you can tell, we're only a couple steps past the conceptual stage.  If you have any tips or tricks I would love to hear about them.
This is a common discussion on the forum - a little search for "battery" will bring up many threads.  The most recent conversation is probably this one : http://chdk.setepontos.com/index.php?topic=9849.msg100284#msg100284

Here's some older stuff :
http://chdk.setepontos.com/index.php?topic=2644.msg24572#msg24572
http://chdk.setepontos.com/index.php?topic=6615.msg71495#msg71495
http://chdk.setepontos.com/index.php?topic=6207.0
http://chdk.setepontos.com/index.php?topic=5797.0
http://chdk.setepontos.com/index.php?topic=2075.msg19129#msg19129


Quote
Thanks again; can't wait to test the new script!
Have at it!  My regression testing was obviously inadequate so I appreciate the feedback and help.
« Last Edit: 22 / May / 2013, 21:05:51 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16


*

Offline bwh13

  • *
  • 28
Hey hey,
I've just tested out v1.5 in my kitchen and it works great.  I purposely set the Stop time to be a couple of minutes after I started it to see how the script would react and it worked like a charm.

Here is a portion of the 'ultimate.log' that the script generated:
MAY 22 19:54:46:2013: === Started: 19:54 ===
MAY 22 19:54:46:2013: CHDK 1.2.0-2797 ixus70_sd1000 101b May 20 2013
MAY 22 19:54:47:2013: CHDK version 120 okay
MAY 22 19:55:20:2013: starting a new day
MAY 22 19:55:21:2013: start time : 06:00 stop time : 20:00
MAY 22 19:56:05:2013: --shot: 1 tv:1/10  [t323|a362|s507|b50]
MAY 22 19:57:05:2013: --shot: 2 tv:1/10  [t323|a362|s507|b50]
MAY 22 19:58:05:2013: --shot: 3 tv:1/10  [t323|a362|s507|b50]
MAY 22 19:59:05:2013: --shot: 4 tv:1/10  [t323|a362|s507|b50]
MAY 22 20:00:00:2013: switching to night mode
MAY 22 20:00:00:2013: --no shot: tv:1/10  [t323|a362|s507|b50]
MAY 22 20:01:00:2013: --no shot: tv:1/10  [t323|a362|s507|b50]
MAY 22 20:02:00:2013: --no shot: tv:1/10  [t323|a362|s507|b50]

It switched to NIGHT mode @ 20:00 and no shots were taken.  Perfect!

A question: 
1) what is the info in brackets after the Tv value?  i.e. [t323|a362|s507|b50]

I will be bench testing this all day tomorrow for bugs and will post anything that seems important (good or bad!)  I will let you know how this comes out with longer term testing as well.
Thanks for your hard work and attention!  Very much appreciated!

Re: Ultimate Intervelometer script
« Reply #9 on: 23 / May / 2013, 06:48:05 »
Our plan is to modify the DC adaptor and plug a big battery into the other end. We've been scoping some batteries and mini solar panel setups from AdaFruit.


I have had six timelapse rigs running in woodland for the last month.
They shoot from 8am to 4 pm, screen is permanently off to reduce power.
The batteries are 'hot swappable', the camera does not need to be turned off.

For what it is worth, I am no longer interested in very long duration scripts and leaving the rigs unattended for periods longer than one week.
They are in safe locations, I just prefer to stop them,check the last image and that there are no unforseen problems.

I now have a rig where an external device turns the camera on and off each day.


David

 

Related Topics