Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By erniberni
#41943 Hello,
is it possible to differentiate in the code between a power on reset and a reset from deep sleep?
Code: Select allextern "C" {
#include "user_interface.h"
  uint16 readvdd33(void);
  extern struct rst_info resetInfo;

}

void setup() {
  Serial.begin(115200);
  Serial.println();
  Serial.println("Start...");
  Serial.print("Reset reason ");
  Serial.println(ESP.getResetInfo());
}

void loop() {
  Serial.println("going to sleep now...");
  Serial.println(readvdd33());
  system_deep_sleep_set_option(0);
  system_deep_sleep(15000000);            // deep sleep for 15 seconds
  delay(1000);
}


always gives
Code: Select allStart...
Reset reason Fatal exception:0 flag:6 (EXT_SYS_RST) epc1:0x00000000 epc2:0x00000000 epc3:0x00000000 excvaddr:0x00000000 depc:0x00000000
going to sleep now...
3365
Last edited by erniberni on Sun Feb 28, 2016 3:30 am, edited 1 time in total.