Date/Time inconsistency with imp.wakeup()?

Hello,

I have a function that is called by imp.wakeup(). I am seeing a slight difference between the date/time from the scheduled wakeup and the log. For example this is a test line:
06/25/2013 12:06:38 PM: current date 6/25/2013 16:6:36
and it has a two second difference.

More specifically the application schedules itself to trigger every morning at a certain time. It triggers then reschedules itself for the next day. What happened this morning was that the log shows it triggered successfully at 9:00 then got the system time which was 8:59:58 - calculated that it needed to trigger again in 2 seconds and then did.
I can add some checks in the code around this bug I just wanted to understand what is happening.

This is the actual logs from the application. The function rotate is what is scheduled to feed the fish every day and previous tests were ok and this didn’t cause any real issue - I am really just curious.

06/25/2013 08:31:34 AM: Next 9:00 AM 6/25/2013 9:0:0
06/25/2013 09:00:02 AM: rotate current step 1 current date 6/25/2013 8:59:56
06/25/2013 09:00:02 AM: current date 6/25/2013 8:59:58
06/25/2013 09:00:02 AM: Next 9:00 AM 6/25/2013 9:0:0
06/25/2013 09:00:02 AM: next LIVE wakeup in 0 hours and 0.0333333 minutes or 2 seconds
06/25/2013 09:00:04 AM: rotate current step 2 current date 6/25/2013 9:0:0
06/25/2013 09:00:05 AM: current date 6/25/2013 9:0:2

Thanks

your fish are very punctual :slight_smile:

They don’t have much else going for them :slight_smile:

Never-mind the first example - the delay is probably due to remote logging.

The function rotate() is what is being scheduled for 9:00 however it reports 8:59:56? Is it possible for imp.wakeup() to be called early?

imp.wakeup() runs on the 30ppm main system oscillator; this could be ~3 seconds out in a day. There’s also the bug (depending on which peripherals you have one) which means you should use imp.enableblinkup(true) to ensure accurate timing on release-17 (this is not needed on 25).

Thanks Hugo - I adjusted for early wake-ups. i am running 25 so I should be ok with the enableblinkups.

Please don’t forget to add me to the early access program for agents.