Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hanging ESP.restart() #1722

Closed
Pfannex opened this issue Mar 5, 2016 · 15 comments
Closed

hanging ESP.restart() #1722

Pfannex opened this issue Mar 5, 2016 · 15 comments

Comments

@Pfannex
Copy link

Pfannex commented Mar 5, 2016

Hi,

what´s the difference between

ESP.reset() and ESP.restart()?

Both work, but sometimes the ESP does not starts again.

working restart:

 ets Jan  8 2013,rst cause:2, boot mode:(3,6)
load 0x4010f000, len 1264, room 16 
tail 0
chksum 0x42
csum 0x42
@cp:0 ld    <------ this means it work

hanging restart:

 ets Jan  8 2013,rst cause:2, boot mode:(1,7)
 ets Jan  8 2013,rst cause:2, boot mode:(1,7)

wdt reset    <----- this means it does not work
@Links2004
Copy link
Collaborator

ESP.reset() is a hard reset and can leave some of the registers in the old state which can lead to problems, its more or less like the reset button on the PC.

ESP.restart() tells the SDK to reboot, so its a more clean reboot, use this one if possible.

the boot mode:(1,7) problem is known and only happens at the first restart after serial flashing.
if you do one manual reboot by power or RST pin all will work more info see: #1017

@Pfannex
Copy link
Author

Pfannex commented Mar 6, 2016

OK, thanks for your explanation......

I was reading the ESP.restart() issues.
But is there a final solution or is the, manually reset after serial flashing, the latest work around?

@Links2004
Copy link
Collaborator

yes, the manually reset after serial flashing is the latest work around.
the problem is some code in the hard coded Silicium part of the ESP8266.
there may is a register / ram address which store the mode to boot in, but no one has find it yet.
Its dam hard to search for.

@Pfannex
Copy link
Author

Pfannex commented Mar 6, 2016

OK, thanks....

I think, I can live with it...... :-)

@PhilColbert
Copy link

PhilColbert commented Apr 18, 2016

Would it be possible for the ESP gurus to write a README guide to the ESP, just a list of known issues that a newbie could read, I just spent a few hours trying to work out why system restart seemingly randomly works... and this is why, would be great to have a list of known strange issues someone just starting with the ESP could read and save a lot of headaches ! :)

For some reason , this only happens with larger programs, if you just upload a program with the system restart command in and that is it, it works fine.... not sure if that helps ?

Thanks

@aidanruff
Copy link

I've had the same problem, even with a pull up on GPOIO#0, it didn't work.

Then I reasoned that as I was using GPIO as an output, maybe the hardware wasn't reseting it to an input on a soft reset, so the reset would depend upon the state of GPIO#0.

So, I set GPIO#0 high before doing the restart and it works!

@pyjsql
Copy link

pyjsql commented Aug 11, 2017

i have a solution;
WiFi.forceSleepBegin(); wdt_reset(); ESP.restart(); while(1)wdt_reset();

close WiFi; forceSleepBegin();
and reset wdt contuniously.

@karenYerevan
Copy link

hi there
i have ESP8266-12, it is have other power
I flashing esp8266 from arduino uno
Flashing programm (XTCOM_UTIL)
aruduino uno -- esp8266
RX -> RXD
TX -> TXD
GND -> GND,GPIO0

After flashing all AT commands worck good.
But when esp8266 is restart (AT+RST) , AT commands stopping works
and show this text

AT
OK

AT+RST
OK

ets Jan 8 2013,rst cause:4, boot mode:(1,7)
wdt reset

img_0291

who can help me ???

@devyte
Copy link
Collaborator

devyte commented Jan 2, 2018

@karenYerevan this repo has nothing to do with the AT command set. I suggest asking at a community forum like esp8266.com.

@jkandasa
Copy link

jkandasa commented Jan 2, 2018

@karenYerevan AFAIK, after flash via serial, you need to do a hard/manual reboot at the very first time(power OFF and ON, ESP8266).

See in this comment

@karenYerevan
Copy link

yes i done that many many time, but that dosnt worck

@royseberg
Copy link

If a GPIO pin is set high or low prior to restart, will it remain in that state after the restart? I want to remember that state when the program reboots, if that makes any sense.

@devyte
Copy link
Collaborator

devyte commented May 6, 2018

GPIO pins will be re-inited before setup()

@garyrylander
Copy link

You have to have a jumper on D0 and Rst. That worked for me

dagnall53 added a commit to dagnall53/RocClientThrottle that referenced this issue Jan 13, 2019
added WiFi status connected test in main loop. 
But note this restart() function ONLY works After the board has been manually rebooted at least once after flashing see: esp8266/Arduino#1722
dirkmueller added a commit to dirkmueller/sensors-software that referenced this issue Nov 5, 2019
according to esp8266/Arduino#1722 (comment)
there are some issues with ESP.restart() hanging sometimes, and
the only known workaround is to shut off wifi beforehand to avoid
a race with the wifi stack.
dirkmueller added a commit to dirkmueller/sensors-software that referenced this issue Nov 6, 2019
according to esp8266/Arduino#1722 (comment)
there are some issues with ESP.restart() hanging sometimes, and
the only known workaround is to shut off wifi beforehand to avoid
a race with the wifi stack.
@verygoodguy
Copy link

Does reset cut full power?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests