LoPy RTC loses time during deep-sleep



  • I'm seeing some very strange behavior with the LoPy RTC during deep-sleep mode (this is with the latest firmware that supports keeping the RTC alive during deep-sleep).

    From the REPL:

    1. Initialize the RTC to the now-current time using rtc.init((2017, 6, 16, ...)); note that you can use the (default) internal RC oscillator or the external 32KHz crystal (if you have one)--the effect is the same either way.
    2. Execute machine.deepsleep(5000); or any reasonable value--there is no apparent relationship between the deepsleep delay and the "lost" time.
    3. After the LoPy wakes up, execute rtc.now() to show the RTC's time.

    I would expect the RTC time to be the then-current time (or very, very close to it), but when I do this, the RTC "loses" time, typically several hundred seconds, but somewhat inconsistent. This happens each time I go through a deep-sleep cycle. But if I just let the LoPy sit there idle for a while, or running some sort of "exercise" loop, rtc.now() always returns the expected then-current time.

    Does anyone else see this same behavior? I want to be sure I'm not chasing a ghost.


  • administrators

    Hi @Eric24 & @cfaessler,

    There is a problem with the machine.deepsleep() function on this version of the LoPy. Please see (https://forum.pycom.io/topic/1022/root-causes-of-high-deep-sleep-current/78) for more information about this.

    That means that when this function is called, it simply resets the device rather than putting it into deepsleep mode. You will need to use a Deep Sleep Shield to utilise this feature and to keep the RTC tracking, whilst the device is in deep sleep.

    Thanks,

    Alex



  • Hello @Eric24 do you know if this has been resolved yet?


Log in to reply
 

Looks like your connection to Pycom Forum was lost, please wait while we try to reconnect.