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

Moderator: igrr

User avatar
By Jep
#61172 Hi there,

I'm currently using the function getResetReason from ESP lib to distinguish between reboot reasons.
As far as I understand, it should return a different value in the 2 following cases:
- reset due to RST button pressed on nodeMCU board
- reset due to power on
But here is what I get:
1) power on due to USB cable plugged in NodeMCU board => reason is REASON_EXT_SYS_RST
2) power on due to 5V on Vin => reason is REASON_EXT_SYS_RST
3) power on due to RST button press ed => reason is REASON_EXT_SYS_RST
Is it the normal behaviour??
If yes, how can I distinguish between a "power on" boot and a "hard reset" boot?

Thanks guys! ;)
User avatar
By Jep
#61270 Am I really the only one who encountered this problem? :shock:
What shall I do to get a nice REASON_DEFAULT_RST reset reason (which according to the API is exactly what I should get by powering on my device)?

Code: Select allenum rst_reason {
   REASON_DEFAULT_RST      = 0,   /* normal startup by power on */
   REASON_WDT_RST         = 1,   /* hardware watch dog reset */
   REASON_EXCEPTION_RST   = 2,   /* exception reset, GPIO status won’t change */
   REASON_SOFT_WDT_RST      = 3,   /* software watch dog reset, GPIO status won’t change */
   REASON_SOFT_RESTART    = 4,   /* software restart ,system_restart , GPIO status won’t change */
   REASON_DEEP_SLEEP_AWAKE   = 5,   /* wake up from deep-sleep */
   REASON_EXT_SYS_RST      = 6      /* external system reset */
User avatar
By Jep
#61369 Hi everybody,

I'm sorry to insist but I'm a bit stuck on that!!
I would appreciate if somebody who is using NodeMCU board could quickly try to log the reboot reason (by adding the following line in his sketch) and power on his board.
Code: Select allSerial.println(ESP.getResetInfo());

Thanks ;)
User avatar
By torntrousers
#61407 I gave it a try and also can't get REASON_DEFAULT_RST

I can get REASON_SOFT_RESTART with ESP.restart(), and REASON_DEEP_SLEEP_AWAK after wakeup from ESP.deepSleep(), but otherwise power on just seems to give REASON_EXT_SYS_RST which is also what it gets when the reset button is pushed.

Seems like a bug.