Determine deep sleep duration

Home Forums mDot/xDot Determine deep sleep duration

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #17884
    Mark Ruys
    Participant

    I would like to know how long an xDot was in deep sleep after it waked up from an interrupt on the WAKE pin. clock() resets itself, as us_ticker_read() does.

    And is there a way to determine whether the xDot was restarted after a deepsleep from an RTC_ALARM or because of an INTERRUPT?

    Thanks, Mark

    #17888
    Mike Fiore
    Blocked

    Mark,

    You could use the RTC to see how long the xDot was sleeping. Just save the time to the EEPROM before going to sleep and compare to the time after you wake up.

    We don’t currently have a method to let you know what the wakeup source was, but it’s on our list. I’ll see if I can get it into the next release.

    Cheers,
    Mike

    #17926
    Mark Ruys
    Participant

    I completely overlooked that the RTC survives a deepsleep. So time() is just what I need, thanks.

    We expect our sensors to go to deepsleep about 50.000 times during their life time. EEPROM handles minimal 300.000 erase/write cycles, so we’re good 🙂

    In our case I can determine the cause of the wake up by checking the WAKE pin.

    Best,
    Mark

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.