You are reading a single comment by @Wilberforce and its replies. Click here to read the full conversation.
  • Isn't this because when the espruino starts its at time 0 - 1970 and then you are setting the time - so the intervals immediately expire?

    What if you set the time first and then set the intervals?

    @Gordon - any ideas?

  • Isn't this because when the espruino starts its at time 0 - 1970 and then you are setting the time - so the intervals immediately expire?

    Yes. And settimeofday() does not correct them, so they try to catch up the time.
    So we need to change it to jshSetSystemTime(), I think. SNTP app allows us to redefine function used to set system time. But I am not sure how to do it with minimal changes.

    What if you set the time first and then set the intervals?

    It depends. Because SNTP subsystem is asynchronous and so time may be really changed before or after intervals setup. It checks connection, for example, and repeats NTP request every few minutes or every hour.

About

Avatar for Wilberforce @Wilberforce started