You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Solved] ESP8266 12E keeps rebooting (rst cause:2, boot mode:(3,6)) #3241
Same wiring same all, the problem starts if I change the function "getkey" to "waitForKey" I don't know why, the function waitForKey stops the program and wait until a key is pressed, not like "getkey" that keeps the programme looping
Include a delay in the routine. That would allow background tasks that need to run. You can not have long blocking code with the ESP8266. It will cause the behavior you see.
Reacted by Rinaldi Segecin, javadhabibi1500, rmileskcl, Nabeel Kirmani, Mitch Talmadge, Eric Duminil, VayuDev, William Andres Granada and Pikuto
Yes I noticed if I keep pressing buttons from the keypad the board doesn't reboot until I stop for few seconds.
Is there a way to increase that rebooting perdiod, like from 2seconds to 10 or more seconds, it would be great for me if it waited few seconds more before rebooting?
Thanks
As you can see I kept the same wiring, even if I used the pin 10, the first code works fine but the second one keeps rebooting if I don't press buttons quickly, the problem appears if I change the function I mentionned above.
I've read about a reset period that can be modified, but I don't have further information about it. If you know please tell me, thanks.
Oh, I'm a beginner, I didn't understand what you meant...
Should I remove the keypad "waitforkey" function, or should I modify something to be able to use it?
Thanks
0 -> normal startup by power on
1 -> hardware watch dog reset
2 -> software watch dog reset (From an exception)
3 -> software watch dog reset system_restart (Possibly unfed watchdog got angry)
4 -> soft restart (Possibly with a restart command)
5 -> wake up from deep-sleep
Looking at the provided code you can decide from what reason the chip is restarting.
I found that loops need a yield() to be ESP8266 friendly, to feed the watchdog before it triggers.
the line referred to by Igrr ... while( (waitKey = getKey()) == NO_KEY ); // Block everything while waiting for a keypress.
most likely should be ... while( (waitKey = getKey()) == NO_KEY ) yield(); // Block everything while waiting for a keypress.
If it doesn't block the program, it would be like the function getKey() and this one make a little mess in my program, I really want the program to wait like 5s or more in this step before looping again.
I want the program to wait a key then store it into a char c1, then wait another key and store it into char c2 ... So I can do other things later. If I use the function "getkey" it mess with my program: I can only store one char, because the program doesn't wait. (to explain my little idea).
And how can I modify the library if I want to test your solution.
No didn't find it there.
I have found that library on the arduino library "Program files - Arduino - Libraries"
Because I tried first time with an Arduino UNO, then when I used the NodeMcu I had that library problem and I downloaded it using the library manager.
"I don't know if both uses the same library, or the NodeMcu ones are saved in another place like wifi libraries ..."
Hello everyone,
So it seems it works fine,
For everyone having the same problem: I did a copy of the library (so not to ruin it), then I opened the file keypad.cpp with note++, I did the modification proposed by "WheresWally" and "igrr", then I saved the .cpp file as Keypad2 and renamed the keypad.h to keypad2.h, then I kept the same second code mentionned above, now I can store 2 keys as c1 and c2 and manipulate them with using the modified version of "waitForKey" function.
changed the title [-]ESP8266 12E keeps rebooting (rst cause:2, boot mode:(3,6))[/-][+][Solved] ESP8266 12E keeps rebooting (rst cause:2, boot mode:(3,6))[/+]on May 14, 2017
If we are calling the yield() function in the "Keypad.cpp" file should we not have some code associated with it too what i mean is
void yield(){
//something that the function does//
}
Or should we just call it and save it and hope it works in the final compilation on the arduino ide.
One more final comment :
how should we call the yield() if the while loop is like this:=
while(some condition){
//some work//
};
Thanks.
Ps. I am facing similar problem while working with a finger print sensor library here https://github.com/sparkfun/Fingerprint_Scanner-TTL
yield() is a "system" function that should be called regularly if you are stuck in your loop() function.
In the arduino model we should try to not be stuck, then it usually is
@pieman64 i was doing home appliance control threw google assistant using iot platform ,i was used Esp12e board ,after uploading code ,wifi connection properly conneting local hotspot ,but mqtt not connecting ,, board working properly while see serial monitor following cmt only continuously reboot
ets Jan 8 2013,rst cause:2, boot mode:(3,6)
mine was also giving the same error in the serial monitor but kept failing to upload, I was about to give up and just throw it away when I found this page, I fixed it and wanted to share in case someone else has a esp8266 that always fails to download no matter what you try, reboot power down another port hit flash button, nothing worked. sooo.. I hooked a wire to ground and touched every pin (BUT vin and 3.3v) as that would be stupid. this somehow "fixed" my device for some reason. I suspect it was one of the 2 reserve pins. if anyone knows why this desparate measure fixed my bricked node ecu please chime in!
update, a program caused this semi bricked state, this time I did one pin at a time and found ground to CMD resets it and lets you upload again! yay
Include a delay in the routine. That would allow background tasks that need to run. You can not have long blocking code with the ESP8266. It will cause the behavior you see.
Include a delay in the routine. That would allow background tasks that need to run. You can not have long blocking code with the ESP8266. It will cause the behavior you see.
Activity
Khorne13 commentedon May 14, 2017
Same wiring same all, the problem starts if I change the function "getkey" to "waitForKey" I don't know why, the function waitForKey stops the program and wait until a key is pressed, not like "getkey" that keeps the programme looping
RudyFiero commentedon May 14, 2017
Include a delay in the routine. That would allow background tasks that need to run. You can not have long blocking code with the ESP8266. It will cause the behavior you see.
Khorne13 commentedon May 14, 2017
Yes I noticed if I keep pressing buttons from the keypad the board doesn't reboot until I stop for few seconds.
Is there a way to increase that rebooting perdiod, like from 2seconds to 10 or more seconds, it would be great for me if it waited few seconds more before rebooting?
Thanks
WheresWally commentedon May 14, 2017
If you load the original sketch, is all ok then?
igrr commentedon May 14, 2017
Pin 10 is used to connect flash memory inside the esp12 module, I doubt it can be used for other purposes.
Khorne13 commentedon May 14, 2017
As you can see I kept the same wiring, even if I used the pin 10, the first code works fine but the second one keeps rebooting if I don't press buttons quickly, the problem appears if I change the function I mentionned above.
I've read about a reset period that can be modified, but I don't have further information about it. If you know please tell me, thanks.
igrr commentedon May 14, 2017
Ok, sorry, missed that part.
Keypad::waitForKeymethod in Keypad library is not compatible with the ESP8266 Arduino core because it uses a busy loop. This part of the code library needs to be modified, by inserting adelay(0);oryield();:https://github.com/Chris--A/Keypad/blob/master/src/Keypad.cpp#L211-L215
Khorne13 commentedon May 14, 2017
Oh, I'm a beginner, I didn't understand what you meant...
Should I remove the keypad "waitforkey" function, or should I modify something to be able to use it?
Thanks
WheresWally commentedon May 14, 2017
The codes are :
0 -> normal startup by power on
1 -> hardware watch dog reset
2 -> software watch dog reset (From an exception)
3 -> software watch dog reset system_restart (Possibly unfed watchdog got angry)
4 -> soft restart (Possibly with a restart command)
5 -> wake up from deep-sleep
Looking at the provided code you can decide from what reason the chip is restarting.
I found that loops need a yield() to be ESP8266 friendly, to feed the watchdog before it triggers.
the line referred to by Igrr ...
while( (waitKey = getKey()) == NO_KEY ); // Block everything while waiting for a keypress.most likely should be ...
while( (waitKey = getKey()) == NO_KEY ) yield(); // Block everything while waiting for a keypress.igrr commentedon May 14, 2017
Or rather,
:)
Khorne13 commentedon May 14, 2017
If it doesn't block the program, it would be like the function getKey() and this one make a little mess in my program, I really want the program to wait like 5s or more in this step before looping again.
I want the program to wait a key then store it into a char c1, then wait another key and store it into char c2 ... So I can do other things later. If I use the function "getkey" it mess with my program: I can only store one char, because the program doesn't wait. (to explain my little idea).
And how can I modify the library if I want to test your solution.
Thanks guys.
Khorne13 commentedon May 14, 2017
I downloaded that library by using the "library manager" method, where can I find the cpp file so I can modify it?
Thanks
lights0123 commentedon May 14, 2017
It is in the folder under your sketchbook location, so probably Documents/Arduino/libraries/Keypad/Keypad.cpp.
Khorne13 commentedon May 14, 2017
No didn't find it there.
I have found that library on the arduino library "Program files - Arduino - Libraries"
Because I tried first time with an Arduino UNO, then when I used the NodeMcu I had that library problem and I downloaded it using the library manager.
"I don't know if both uses the same library, or the NodeMcu ones are saved in another place like wifi libraries ..."
Khorne13 commentedon May 14, 2017
Hello everyone,
So it seems it works fine,
For everyone having the same problem: I did a copy of the library (so not to ruin it), then I opened the file keypad.cpp with note++, I did the modification proposed by "WheresWally" and "igrr", then I saved the .cpp file as Keypad2 and renamed the keypad.h to keypad2.h, then I kept the same second code mentionned above, now I can store 2 keys as c1 and c2 and manipulate them with using the modified version of "waitForKey" function.
You guys thanks so much you're really helpful.
[-]ESP8266 12E keeps rebooting (rst cause:2, boot mode:(3,6))[/-][+][Solved] ESP8266 12E keeps rebooting (rst cause:2, boot mode:(3,6))[/+]sebinbc commentedon Oct 3, 2018
If we are calling the yield() function in the "Keypad.cpp" file should we not have some code associated with it too what i mean is
void yield(){
//something that the function does//
}
Or should we just call it and save it and hope it works in the final compilation on the arduino ide.
One more final comment :
how should we call the yield() if the while loop is like this:=
while(some condition){
//some work//
};
Thanks.
Ps. I am facing similar problem while working with a finger print sensor library here https://github.com/sparkfun/Fingerprint_Scanner-TTL
d-a-v commentedon Oct 3, 2018
yield()is a "system" function that should be called regularly if you are stuck in yourloop()function.In the arduino model we should try to not be stuck, then it usually is
You can consider that system is doing this:
moorthi5 commentedon Dec 29, 2018
ets Jan 8 2013,rst cause:2, boot mode:(3,6)
load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
v09f0c112
~ld
Hello guys ,anyone help me , i have used Esp12e after uploading iot code its continuesly rebooting ,not connect mqtt ,what to do? How to solve
pieman64 commentedon Dec 29, 2018
@moorthi5 please create your own issue with all the required details.
moorthi5 commentedon Dec 29, 2018
@pieman64 i was doing home appliance control threw google assistant using iot platform ,i was used Esp12e board ,after uploading code ,wifi connection properly conneting local hotspot ,but mqtt not connecting ,, board working properly while see serial monitor following cmt only continuously reboot
ets Jan 8 2013,rst cause:2, boot mode:(3,6)
load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
v09f0c112
~ld
Where is problem i can't find ,board or code?
pieman64 commentedon Dec 29, 2018
@moorthi5 there are lots of reasons for a device reset and that's why you must create a NEW issue with all the required details.
texsean commentedon Mar 8, 2019
mine was also giving the same error in the serial monitor but kept failing to upload, I was about to give up and just throw it away when I found this page, I fixed it and wanted to share in case someone else has a esp8266 that always fails to download no matter what you try, reboot power down another port hit flash button, nothing worked. sooo.. I hooked a wire to ground and touched every pin (BUT vin and 3.3v) as that would be stupid. this somehow "fixed" my device for some reason. I suspect it was one of the 2 reserve pins. if anyone knows why this desparate measure fixed my bricked node ecu please chime in!
update, a program caused this semi bricked state, this time I did one pin at a time and found ground to CMD resets it and lets you upload again! yay
javadhabibi1500 commentedon Jun 11, 2019
Adding a 1ms delay worked for me.
Thanks
BrunoPedro7 commentedon Apr 10, 2020
Where did you add it?
raspiduino commentedon Jul 22, 2020
Just put this into
loop():raspiduino commentedon Jul 22, 2020
I did it and it worked!
JamesDelfini commentedon Sep 11, 2022
What the heck it also works for me
raspiduino commentedon Sep 11, 2022
:))
Idk
Sth just works but can't be explained