These are chat archives for SmingHub/Sming

28th
Jun 2016
Riley
@ril3y
Jun 28 2016 01:41
Hi All. I had a quick question about the getRtcSeconds() function.
the documentation says:

Get seconds from RTC.

Return values
uint32_t Quantity of seconds since last RTC reset or set

is that in seconds? microseconds?
I think its in micro but wanted to be sure.
My application is to... On initial boot up for the esp set the RtcSeconds to 0. Then go into deep sleep. Once an external event on the rst lines wakes up the esp I am trying to check to see if its been asleep for longer than the set interval (something like 1 minute etc) If its been sleeping for greater than a minute it powers up the rf connects to mqtt and sends me a msg.
Why all the details :) Well I am trying to figure out if I am going about this correctly with the rtc vs something else?
Riley
@ril3y
Jun 28 2016 03:01
FYI I think the external resets to exit deep sleep resets the RTC clock timer so I think my method will not work.
hreintke
@hreintke
Jun 28 2016 07:05

@ril3y :
From espressif documentation :

Attention
System time will return to zero because of system_restart, but the RTC time still goes on. If the chip is reset
by pin EXT_RST or pin CHIP_EN (including the deep-sleep wakeup), situations are shown as below:

  1. reset by pin EXT_RST : RTC memory won't change, RTC timer returns to zero
  2. watchdog reset : RTC memory won't change, RTC timer won't change
  3. system_restart : RTC memory won't change, RTC timer won't change
  4. power on : RTC memory is random value, RTC timer starts from zero
  5. reset by pin CHIP_EN : RTC memory is random value, RTC timer starts from zero
hreintke
@hreintke
Jun 28 2016 08:40
@HappyCodingRobot :
I still need to make the QueuedTimer backwards compatible. That also means you will have to do some small adaptions in the sample application -> You cannot PR against the master branch yet.
So little patience but won't take long. :smile:
HappyCodingRobot
@HappyCodingRobot
Jun 28 2016 11:19
@hreintke ok, np.. take your time :smile:
please give a short note when it's done