Lopy + Pytrack: How to keep track of time in deep sleep



  • Hi!

    I'm wondering how I can keep track of the time (seconds since power on) when putting the Pytrack board in deep sleep. As far as I understood the board is completely powered down by the Pytrack, thus the RTC will be reset? Is there a RTC available on the Pytrack?

    I'm using deep sleep through:

    from pytrack import Pytrack
    
    pytrack = Pytrack()
    
    pytrack.setup_sleep(10) # sleep for 10 seconds
    pytrack.go_to_sleep()
    


  • @joeri
    How accurate does it need to be?

    You could store the time before entering deep sleep and then when the board comes back you'd know it's the stored value + your deep sleep time + small adjustment to account for boot-up (which on my tests is about 1.9s but you should check for yourself)

    That should quickly give you a good approximation. Of course on the Pytrack you can get then get the GPS time.



  • There are some small RTC modules based on DS1307



Pycom on Twitter