how accurate is the clock? particularly on the a570is and a590is - page 2 - Script Writing - CHDK Forum

how accurate is the clock? particularly on the a570is and a590is

  • 15 Replies
  • 9983 Views
*

Offline reyalp

  • ******
  • 14117
Re: how accurate is the clock? particularly on the a570is and a590is
« Reply #10 on: 23 / November / 2008, 18:04:29 »
Advertisements
Are you expecting the camera to run continuously for months or years on end ? Or power up and down based on some external input ?

In the former case, I would expect problems. The millisecond timer from get_tick_count will wrap to negative in ~25 days, and back to zero in ~49. Aside from that, there could well be other counters or resource leaks that eventually kill things. Neither the original firmware nor CHDK are built with the expectation of long uptimes.

What sort of events would you want lua to support ? Feel free to add suggestions here Improving the lua interface

Moving to a more event-driven model is definitely a possible future direction, although probably not near future :)
Don't forget what the H stands for.

*

Offline fudgey

  • *****
  • 1705
  • a570is
Re: how accurate is the clock? particularly on the a570is and a590is
« Reply #11 on: 23 / November / 2008, 18:19:14 »
In the former case, I would expect problems. The millisecond timer from get_tick_count will wrap to negative in ~25 days, and back to zero in ~49. Aside from that, there could well be other counters or resource leaks that eventually kill things. Neither the original firmware nor CHDK are built with the expectation of long uptimes.

And the way around this would be to create a reboot function for Lua to boot up the camera periodically before any of this happens and coding scripts to handle it (e.g. by saving necessary variables to a file on the sd card before reboot). Or even better, have CHDK automatically hibernate Lua, reboot the camera and restore Lua when get_tick_count is about to wrap :)

Do we know how to reboot in a way that clears get_tick_count()? Wdt timeout bricks the camera so that's no good. I know next to nothing about the loader, could we jump there at will or something?

Re: how accurate is the clock? particularly on the a570is and a590is
« Reply #12 on: 23 / November / 2008, 18:30:39 »
i haven't worked with get_tick_count and haven't examined the options for getting the time. you're certainly correct about your concerns about values wrapping.

i have an arduino wired to the power button on the camera. i can restart the camera via usb. the camera can automatically start chdk and automatically start the script. this is an easy and reliable method of restarting.

*

Offline dzsemx

  • ****
  • 302
  • [SX40HS][A650][A630]
Re: how accurate is the clock? particularly on the a570is and a590is
« Reply #13 on: 24 / November / 2008, 01:45:12 »
a650 has the coin battery in the backside of the swivel screen
it can be accessed with a good screwdriver :)


Re: how accurate is the clock? particularly on the a570is and a590is
« Reply #14 on: 26 / May / 2009, 19:11:11 »
I want to take a pic every five minutes. preferably at 00, 05, 10, 15 etc on the hour.

i need to make sure that the camera doesn't suffer from clock drift if i want to base script execution on it.

does anyone have experience with this? i guess i'll keep an eye on the camera clock for a couple of days but it would be nice to compare to other people's experiences.

I just checked my A590 IS -- Since last October it gained a couple minutes compared to Internet time, also A590 doesn't do daylight savings time.  So the internal clock is as good as a watch at a few minutes per year.

Re: how accurate is the clock? particularly on the a570is and a590is
« Reply #15 on: 26 / May / 2009, 19:26:24 »
thanks for your feedback.

i've noticed that mine has fallen a bit behind. i suspect that it falls behind more when its turned off than when its powered on - but i should really test that.

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal