-->
Page 1 of 1

Software reset on a NodeMCU

PostPosted: Fri Jul 29, 2016 1:36 am
by Ignat Georgiev
I am trying to reset my NodeMCU via a web page. Both
Code: Select allESP.reset()
and
Code: Select allsystem_restart()
are not working properly. Here it becomes strange. The first time I try to reset it after a new flash does not work. After that, any consecutive try restarts the NodeMCU without a problem. This is quite troublesome because I have already incorporated an OTA onto the chip and if I put it somewhere unreachable my I wouldn't have a way to restart it properly.

The NodeMCU already has it's GPIO15 and GPIO0 pulled down and up respectively, therefore, that shouldn't be a problem.

Re: Software reset on a NodeMCU

PostPosted: Fri Jul 29, 2016 4:00 pm
by martinayotte
What do you means exactly ?
ESP.reset should work without issue.
In case there are issue, you can connect GPIO16 to RES thru a 470R resistor, and do a deepSleep(1), it will then do a wakeUp after 1 microsecond.

Re: Software reset on a NodeMCU

PostPosted: Mon Aug 01, 2016 1:25 am
by Ignat Georgiev
First boot attempt gives out:
Code: Select allets Jan  8 2013,rst cause:2, boot mode:(1,6)
. The device just stops working after that and resumes after I reset it manually with a button.
Every consecutive boot after that gives out
Code: Select allets Jan  8 2013,rst cause:2, boot mode:(3,6)
and resets the device properly.

I can try your method but this just makes me curious. Why does this happen only on the first reset attempt?

Re: Software reset on a NodeMCU

PostPosted: Sun Oct 23, 2016 9:01 am
by Luis Uguina
Apparently, the issue is caused by one of the internal registers not being properly updated until physical reset. This issue concerns only serial uploads. OTA uploads are not affected. If you are using ESP.restart(), the workaround is to reset ESP once after each serial upload.

You can see some proposed workarounds here.

Anyway, this shouldn't be an issue for any real-world application — you will certainly power the device down and up at least once after programming it. After you perform a physical reset (e.g. power-on reset), the strapping register will be in the right state, and soft reset will work fine (tested).