LoPy RTC loses time during deep-sleep
Eric24 last edited by
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:
- 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.
- Execute machine.deepsleep(5000); or any reasonable value--there is no apparent relationship between the deepsleep delay and the "lost" time.
- 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.
bucknall last edited by
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.
cfaessler last edited by
Hello @Eric24 do you know if this has been resolved yet?