Script Writing Question. - Script Writing - CHDK Forum

Script Writing Question.

  • 2 Replies
Script Writing Question.
« on: 28 / October / 2008, 21:28:18 »
I am researching options to put together a time lapse box if you will. Something that I can leave alone for a week or more and have it self run with no intervention from me, other then retrieving images off the card. I have thought some about a digisnap intervalomter and *gasp* a Nikon camera.. shudder (Canon is not supported) with external power source.

Now to my question, I am wondering is it capable to write a script that can:

1. Power on/Power off the camera

2. Take pictures only during Day light hours, just something to be able to tell it to take a pictures between this time and this time.

3. Will the script run for a week? for two weeks? for a month? without stopping.

4. Will there be any limits (time script runs, number of images, ect) other then running out of space on the card.

Thank you anyone who takes the time to answer.



Offline reyalp

  • ******
  • 14072
Re: Script Writing Question.
« Reply #1 on: 28 / October / 2008, 23:10:01 »
A script cannot power on the camera, since the script is run on the cameras CPU.  Nothing runs when the camera is off (except the clock.)

Some cameras power up when they see power on the USB, which you could arrange with some simple external hardware. I guess you could rig a server to hit the power button too ;)

If you supplied constant power and ran the camera all the time for weeks on end, you might run into other limits. I don't know of any specific problems, but I suspect few if any people have done this.

One thing that comes to mind is when get_tick_count passes 2^31 (~24 days) that might confuse things, and again when it passes 2^32 and wraps back around to zero.

There is also the possibility of memory or other resource leaks.
Don't forget what the H stands for.


Offline fudgey

  • *****
  • 1705
  • a570is
Re: Script Writing Question.
« Reply #2 on: 29 / October / 2008, 14:35:04 »
reyalp already covered most of it... I'd love to hear if someone's wrapped the tick count and survived. I've seen script code that will fail in one way or another at that instant, but fixing them is not a problem... it's the camera firmware itself and also CHDK that could fail somehow. It's not an everyday easy easy thing to test... or can we overwrite the tick count...?

2. Take pictures only during Day light hours, just something to be able to tell it to take a pictures between this time and this time.

Yes, that's easy. You can use time from camera clock or you can use metered brightness. But you can also use long exposure times up to 65 seconds to shoot in dark.

In any case you'll want to check fbonomi's timelapse script at,2156.msg20057.html#msg20057 and my recent modifications to it later in the same thread:,2156.msg23247.html#msg23247.


Related Topics