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

[Problem] ets Jan 8 2013,rst cause:4, boot mode:(3,7) #1328

Closed
lhcavalcanti opened this issue Dec 30, 2015 · 64 comments

Comments

Projects
None yet
@lhcavalcanti
Copy link

commented Dec 30, 2015

I tried to resolve the reseting problem with the previous issues here. But I already correct all the pins ( GPIO0 pulled up, GPIO15 pulled down, rst and ch_pc also pulled up) and the problem continues. So I checked the supply, but I'm using a lm1117 and the voltage provided its also correct.

Some issue before talked about disabling the watchdog ( ESP.wdtDisable();), I tested and the problem persists.

After the problem line appears:

wdt reset
load 0x4010f000, len 1264, room 16
tail 0
chksum 0x42
csum 0x42
~ld

Anyone knows what can I do to fix it?

@lhcavalcanti lhcavalcanti changed the title ets Jan 8 2013,rst cause:4, boot mode:(3,7) [Problem] ets Jan 8 2013,rst cause:4, boot mode:(3,7) Dec 30, 2015

@me-no-dev

This comment has been minimized.

Copy link
Collaborator

commented Dec 30, 2015

So how do you get to trigger that problem? Please post some code that triggers it. The issue as explained could not be understood.

@lhcavalcanti

This comment has been minimized.

Copy link
Author

commented Dec 30, 2015

Sorry.
I'm trying to use the WebClient example to send the temperature from my work space. So I just changed the value sent and the frequency of upload data.

The code is:

#include <ESP8266WiFi.h>

const char* ssid     = "------------------------";
const char* password = "-------------------";

const char* host = "data.sparkfun.com";
const char* streamId   = "G2NoXQalpKHjJ0ZvM7GL";
const char* privateKey = "----------------------------------";

void setup() {
  Serial.begin(115200);
  delay(10);
  // We start by connecting to a WiFi network
  //ESP.wdtDisable();
  Serial.println();
  Serial.println();
  Serial.print("Connecting to ");
  Serial.println(ssid);

  WiFi.begin(ssid, password);

  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }

  Serial.println("");
  Serial.println("WiFi connected");  
  Serial.println("IP address: ");
  Serial.println(WiFi.localIP());
}

int temp = 0;

void loop() {
  temp = analogRead(A0); // reading sensor
  temp = temp * 0.09765625; // costance (1/1024*100)


//  ++value;

  Serial.print("connecting to ");
  Serial.println(host);

  // Use WiFiClient class to create TCP connections
  WiFiClient client;
  const int httpPort = 80;
  if (!client.connect(host, httpPort)) {
    Serial.println("connection failed");
    return;
  }



  // We now create a URI for the request
  String url = "/input/";
  url += streamId;
  url += "?private_key=";
  url += privateKey;
  url += "&value=";
  url += temp;

  Serial.print("Requesting URL: ");
  Serial.println(url);

  // This will send the request to the server
  client.print(String("GET ") + url + " HTTP/1.1\r\n" +
               "Host: " + host + "\r\n" + 
               "Connection: close\r\n\r\n");
  delay(10);

  // Read all the lines of the reply from server and print them to Serial
  while(client.available()){
    String line = client.readStringUntil('\r');
    // Serial.print(line); // Not using this message yet 
  }
  Serial.println("time");
  delay(20000); // Just send every 20 seconds
  Serial.println("closing connection");
  Serial.println();
}
@demandajmenso

This comment has been minimized.

Copy link

commented Jan 1, 2016

Check this out maybe we have the same issue.
#1342

@demandajmenso

This comment has been minimized.

Copy link

commented Jan 1, 2016

Also I have added a large capacitor (470uF) across the Vcc and Gnd rails

@TwatBurglar

This comment has been minimized.

Copy link

commented Feb 5, 2016

OP, did you find a solution for this? wdt_disable() DOES NOT WORK, but it DOES seem to feed the watchdog. 8 seconds after wdt_disable(), watchdog will always time out.

@pratikmokashi

This comment has been minimized.

Copy link

commented Apr 22, 2016

having same problem
wdt reset
load 0x4010f000, len 1264, room 16
tail 0
chksum 0x0f
csum 0x0f
~ld

@stsrc

This comment has been minimized.

Copy link

commented Apr 27, 2016

Be sure that your power supply is strong and stable enough. To get it working with stm32f0discovery board I had to get:

  • an external voltage source (12V, 1A max),
  • voltage stabilizer to 5V (radiator may be required),
  • voltage stabilizer to 3V3,
  • 2200uF(?!) electrolytic capacitor on 3V3, as close as possible to esp8266 power supply pin.
    This capacitor may be way to big, but I am only prototyping and want things to work.
  • 100nF ceramic capacitor as close as possible to esp8266 power supply pin.

and it finally worked.

  • Note about my circuit - power section was located on prototyping board, while esp8266 was connected through 20cm wires.
  • Note about stabilizers - also connect to them some capacitors as their datasheets say.
  • Note about big capacitor - esp8266 may work with smaller capacitor, just test it. Electrolytic capacitor should have low impedance.
@Captayne

This comment has been minimized.

Copy link

commented May 28, 2016

I have the same problem, and can't get rid of it. I am close to throw all ESP8266 away and go for another IoT system on chip.
I can't get this running stable: https://github.com/cnlohr/esp8266ws2812i2s
I use a PC power supply with 3.3V capable to drive 25A. Also added some ceramic capacitors to VCC and 3.3V directly on the pins of the Nodemcu accumulating now in up to ~3700µF.
From time to time (~~ every 20 minutes ) the chip resets with the following serial output:
ets Jan 8 2013,rst cause:4, boot mode:(3,7)
wdt reset
load 0x4010f000, len 1264, room 16
tail 0
chksum 0x0f
csum 0x0f
~ld

I feel soo helpless now, because everything else works fine. Meanwhile i Have also added some other hadware and software featrues and made a new website to control pumps for a bar mixing app.
Is there anything else to debug and look deeper?
Maybe there really is a bug in the Fastled Library or any other lib used in the example?
I use Arduino 1.6.5.

Thanks for any hints.
Andreas

@krzychb

This comment has been minimized.

Copy link
Contributor

commented May 28, 2016

@Captayne

Do you have issue with application from https://github.com/cnlohr/esp8266ws2812i2s or "Fastled Library" from https://github.com/FastLED/FastLED?

@Captayne

This comment has been minimized.

Copy link

commented May 28, 2016

Actually, I don't know. I just experience the crashes. If someone can give me a hint, to track down the reboots, I would be more than lucky.

Andreas/Captayne

----- Ursprüngliche Nachricht -----
Von: "Krzysztof" notifications@github.com
Gesendet: ‎28.‎05.‎2016 19:59
An: "esp8266/Arduino" Arduino@noreply.github.com
Cc: "Captayne" a.keibel@systragon.de; "Mention" mention@noreply.github.com
Betreff: Re: [esp8266/Arduino] [Problem] ets Jan 8 2013,rst cause:4, boot mode:(3,7) (#1328)

@Captayne

Do you have issue with application from https://github.com/cnlohr/esp8266ws2812i2s or "Fastled Library" from https://github.com/FastLED/FastLED?


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#1328 (comment)

@Captayne

This comment has been minimized.

Copy link

commented May 29, 2016

I now have changed the power supply to another PC power supply, with lots of amps on 3.3V. But reboots still occur occassionally. Always this shows up in the usb serial monitor:
ets Jan 8 2013,rst cause:4, boot mode:(3,7)
wdt reset
load 0x4010f000, len 1264, room 16
tail 0
chksum 0x0f
csum 0x0f
~ld

What does room 16 mean?
The websocket error event results in #1006. (quite clear.)

Of cause I can reconnect easily from JScript, but this in not a honest solution.

Any idea? Can the code be buggy, resulting in such an error? If the code is buggy, then the beaviour should be little more deterministic and not with crashes from time to time. Website and ESP do communicate in 10Hz frequency. all works fine without any overlap until the ESP crashes.
I have swapped the NodeMCU Devboard with 5 others without any change. I put it from my PCB design back into the protoyping board with no change in behaviour.
Has somebody similiar problems?
Is there a possiblity to ad more detailed output on what the system crashes? Memory leak/ Nullpointer assignement/ memory read error / invalid instruction/ page error (I think rather not, as there is no paging).... ?
uh!?
Any hints?
Thank you soo much.

@krzychb

This comment has been minimized.

Copy link
Contributor

commented May 29, 2016

@Captayne,

  1. If not done already, you may check recommendations here
  2. To verify if watchdog timer resets may be caused by your application, I would load one of example sketches that is using WiFi, e.g. WiFiWebServer.ino and leave it running for couple of hours.

Krzysztof

@akashdeep3194

This comment has been minimized.

Copy link

commented Aug 1, 2016

I was facing this problem and it was fixed by changing Tools>Upload Speed to 115200.
And Flash Size to 4M(3M SPIFFS).

@hadipic

This comment has been minimized.

Copy link

commented Sep 3, 2016

eset ets Jan 8 2013,rst cause:4, boot
eset ets Jan 8 2013,rst cause:2, boot

add this code slove problem all reset
ets_intr_lock(15); // all intruptt off
ets_wdt_disable();

@jumpjack

This comment has been minimized.

Copy link

commented Oct 5, 2016

I have same issue.
How can I specifically add ESP-07 to boards available on Arduino IDE?

@jumpjack

This comment has been minimized.

@lagunacomputer

This comment has been minimized.

Copy link

commented Nov 4, 2016

was able to fix this by changing the Digital Pin Assignment of my onewire device to D4, and my DHT sensor pin assignment to D6. it did not like the previous pin assignments. nodemcu v1.0

@RubenVot

This comment has been minimized.

Copy link

commented Nov 13, 2016

I had same problem and same message. I was trying to set the D8 to INPUT.
Changed to 0, everything ok now :)

@cesarcardinali

This comment has been minimized.

Copy link

commented Jan 9, 2017

Guyyyyyyys! Problem solved!
Connect an external power source to Arduino and it should work just fine!
I plugged an 9v 1A and at same moment it came to work!

@isaiasmoioso

This comment has been minimized.

Copy link

commented Jan 20, 2017

@cesarcardinali I"m not sure i follow. Did you mean you plugged in an external power source to your esp8266 to get it to work?

@RubenVot

This comment has been minimized.

Copy link

commented Jan 20, 2017

Sometimes cheap power sources can make that arduino behaves in an erratic mode.

@cesarcardinali

This comment has been minimized.

Copy link

commented Jan 20, 2017

@isaiasmoioso Exactly! Buy an external power source capable of 1000mA and it should work just fine.
I am using it connected to my Arduino and an external power source. Problem solved.

@macmeck

This comment has been minimized.

Copy link

commented Feb 11, 2017

I was having the same issue while my power supply was just fine. Solved it by using a different USB to Serial adapter. FTDI adapters brought up this issue (while also making trouble during programming from time to time) whereas I had no issues using a CP2102 adapter. You might want to give this a try...

@gojimmypi

This comment has been minimized.

Copy link
Contributor

commented Feb 12, 2017

fwiw - I found this thread while searching for the cause of my continual ESP8266 reboots - the "rst cause:2, boot mode:(3,7)" messages out the serial port at 74880 baud - followed by repeated diagnostics, only to repeat.

My issue, is that I believe my programming method was forcing in corrupted code into the ESP8266.

The solution for me? Hold down the "Flash button" while programming. Previously I had been using VisualMicro to program the NodeMCU via the UART. (the UART handles the flash control automagically) I knew I had a good device, as I could successfully program it via the UART. However I wanted to use a JTAG debugger such as the Segger or Olimex with VisualGDB - but could never get it to work with the NodeMCU. (I spent a ridiculous amount of time before I found this solution).

While googling, I came across this: https://nodemcu.readthedocs.io/en/master/en/flash/#putting-device-into-flash-mode I had never needed to press the flash button, as the USB connection would do that for me automatically. But with JTAG I no longer had this luxury! Note that the flash button needs to be held down before power is applied to the ESP8266.

Hopefully this will help someone else & save you a few hours...

@lagunacomputer

This comment has been minimized.

Copy link

commented Feb 12, 2017

lol 74880, what was that like the insta-obsolete V.32fast? lol anyway i gotta tell you, i have bought about 10 nodemcu's from ebay, and it seems half were 'legit' and the other half we cheap knockoffs that did not do so well in the 'serial communication' and overall 'works great' departments. Some would work fine with the arduino 1.6x IDE and a standard stupid usb cable, others would just fight me to load a firmware. I think the cheapie chinese knock offs are a problem. The only way i could visually disingush between the two, the 'print' on the big ESP8266 chip on the fake NodeMCU's from ebay was visually rough and 'falling off'. Check yours, do you have the same cheap paint on your ESP8266 chip on your NodeMCU?

@lagunacomputer

This comment has been minimized.

Copy link

commented Feb 12, 2017

and YES YOU MUST SUPPLY EXTERNAL POWER if you want to run anything other than a LED off of the pins of a NodeMCU

@Captayne

This comment has been minimized.

Copy link

commented Mar 16, 2017

Guys, after almost a year of doing nothing on my project, which came from little demotivation, and speculating about errorfixing in the IDE and libraries by others, ...
... NOW really time seems to have worked for me.
I upgraded from Arduino 1.6.5 to 1.8.1 and compilied and flashed again. Everything in the Dev-Environment and libraries were upgraded.
AND ....

Tadaaa! No reboots occour anymore!

WebSocket connection remains stable, and the ESP runns like hell for the first hours .
Yiiippiii!

@pipoblak

This comment has been minimized.

Copy link

commented May 30, 2017

I tryed a more simple code with FastLeds and NodeMCU and dont work too.

Code: https://gist.github.com/pipoblak/9e164e86242728e14f72500d2de9eeb4

StackTrace:

dev 1143

 ets Jan  8 2013,rst cause:4, boot mode:(3,6)

wdt reset
load 0x4010f000, len 1384, room 16 
tail 8
chksum 0x2d
csum 0x2d
v09f0c112
~ld
á

@scotthibbs

This comment has been minimized.

Copy link

commented Jun 26, 2017

wdt reset
load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
v09f0c112
~ld

I solved this error loop because I had
#define DOOR_PIN 6
instead of
#define DOOR_PIN 4

So check which pins are assigned.
Hope this helps,
Scott

@NarreKiwi

This comment has been minimized.

Copy link

commented Jul 15, 2017

This problem entirely goes away, after completely erasing the external SPI FLASH chip. Most likely it got corrupted somehow along the way from the previous FLASH upload to the chip, since it triggers the WDT reset and keeps rebooting all the time, after you pressed the reset button on the ESP12-E which I've got.
You need to use a short Arduino IDE sketch to do it - see https://github.com/kentaylor/EraseEsp8266Flash
Then I used the NodeMCU Flasher to upload a normal program *.bin file to it, to run a normal serial comms program from it which I checked the comms through the Arduino IDE serial monitor. Everything runs fine after that!

@shitalshivani

This comment has been minimized.

Copy link

commented Aug 12, 2017

Hi everyone!!
i have ESP12-E,i am using this for IOT application.I have done with my code.Now i am testing this code on esp8266 12E node MCU board.and i am getting random error of exception 0 and
ets Jan 8 2013,rst cause:2, boot mode:(3,7) wdt reset after 24 hours and sometimes it occurs after few hours.
I am not getting whats wrong with my code.please suggest any solution.thanks in advance.

@NarreKiwi

This comment has been minimized.

Copy link

commented Aug 13, 2017

@raufjay

This comment has been minimized.

Copy link

commented Nov 10, 2017

I had the same issue which is resolved now.

dt reset
load 0x4010f000, len 1264, room 16
tail 0
chksum 0x42
csum 0x42
~ld

Just resolved it with a strange solution.

I was using example of basicOTA with a minor addition of blink. In the loop I had a condition to check pin D8, if LOW go to the OTA handler so it will wait to receive sketch OverTheAir. If D8 is HIGH then continue blinking LED.

After uploading the code via com port, the esp8266 or nodemcu should blink the led unless i pull down the D8. But I kept getting the above error.

I tried using D7 and D3 as well, with the same result.

I was using "#define BUTTON 8" statement.

But when I used "#define BUTTON D8" instead, all issues gone, and esp8266 started working normally.

Strangely, the pin D2 which is used for the built-in LED is still flashing ON and OFF without using letter D. I can still use digitalWrite(2,HIGH) or LOW. That means there is some inherent problem with the IDE porting code which behaves different for the INPUT and OUTPUT modes.

Can some one explain it to me?

Hope it may help someone.

Thanks,

Rauf

@Tvde1

This comment has been minimized.

Copy link

commented May 14, 2018

I'm getting this issue without having touched the board before.

I bought an ESP8266 and connected to it with the serial monitor and got this. I've tried flashing the basic Blink demo but that isn't fixing anything. I've played around with all the settings.

Any help?

@lagunacomputer

This comment has been minimized.

Copy link

commented May 14, 2018

@man6663

This comment has been minimized.

Copy link

commented Jun 9, 2018

resolve it by change to external power supply....usb port not enough amp

@kopolindo

This comment has been minimized.

Copy link

commented Aug 13, 2018

@akashdeep3194 GOD BLESS YOU. I owe you a beer

@daekonn

This comment has been minimized.

Copy link

commented Sep 11, 2018

I solved...
by inserting

ESP.wdtDisable();

inside the problem making function , not in the setup(). ^^

@devyte

This comment has been minimized.

Copy link
Collaborator

commented Sep 11, 2018

@daekonn which function?

@ivm164

This comment has been minimized.

Copy link

commented Oct 18, 2018

I've got resets when trying to use quite large local array. In my case it was bool a[150][150]. IDE doesn't produce any warning during compilation in this case. When I made that array global I've got the warning on possible instability due to low memory but in the end there were no real problems and at least I know now what I should optimize to make things better.

@dehuy69

This comment has been minimized.

Copy link

commented Nov 7, 2018

Try:
In Arduino IDE Tools >> Erase Flash >> All flash content
recompile and upload

@frustrat01

This comment has been minimized.

Copy link

commented Dec 8, 2018

Having some issues with the ESP8266-01 by uploading the sensor data to the localhost.

The below shows the issues when I open the Serial Monitor in the Arduino

` ets Jan 8 2013,rst cause:4, boot mode:(1,0)

wdt reset
`
By the way, I have tried using the WiFiClient example to upload the dummy data to the localhost and it works. But it cannot work with uploading the sensor to the localhost.
Anyone has solution please help me to get rid of this issue ASAP

@lagunacomputer

This comment has been minimized.

Copy link

commented Dec 8, 2018

@frustrat01

This comment has been minimized.

Copy link

commented Dec 8, 2018

@lagunacomputer Can you give the example for this because I still new to this Arduino and ESP8266-01.

@lagunacomputer

This comment has been minimized.

Copy link

commented Dec 8, 2018

@KiLLAAA

This comment has been minimized.

Copy link

commented Jan 10, 2019

Hello everyone, the wdt reset is caused by entering infinite loop!

Entering infinite loop(while) will trigger reset in a second, the reason is that the loop is blocking and esp8266 needs to keep WiFi connected and lots of other background things running.
Solution recommended by @daekonn ESP.wdtDisable(); only disables software watchdog, the hardware one will trigger in ~6seconds, resulting in -> rst cause:4
Solution is to FEED the watchdog!
Solution no.1: ESP.wdtFeed(); // feeds the dog
Solution no.2: system_soft_wdt_feed(); // same as no.1
Solution no.3: yield(); // implemented in esp8266 libraries
Solution no.4: delay(1); // yeah, really

example:
while(1) {ESP.wdtFeed();};

@devimeruva

This comment has been minimized.

Copy link

commented Jan 22, 2019

17:34:15.107 ->
17:34:15.107 -> ets Jan 8 2013,rst cause:4, boot mode:(1,6)
17:34:15.107 ->
17:34:15.107 -> wdt reset

this is being displayed on my COM port instead of showing IP Address. How can i resolve this issue?

@lagunacomputer

This comment has been minimized.

Copy link

commented Jan 22, 2019

@lrmoreno007

This comment has been minimized.

@KiLLAAA

This comment has been minimized.

Copy link

commented Jan 24, 2019

@devimeruva post code?

@devimeruva

This comment has been minimized.

Copy link

commented Jan 24, 2019

@devimeruva

This comment has been minimized.

Copy link

commented Jan 24, 2019

#include <ESP8266WiFi.h>
#include <LiquidCrystal.h>
#include <EmonLib.h>
EnergyMonitor emon1; // Create an instance
LiquidCrystal lcd(12,11,5,4,3,2);

const char* ssid = "Zunik Energies Pvt Ltd";
const char* password = "zunik1234";
WiFiServer server(80);

void setup() {
Serial.begin(9600);
Serial.setDebugOutput(true);
lcd.begin(20,4);
emon1.voltage(2,2313.26,1.7);
emon1.current(1,58.1);
Serial.println();
Serial.print("Connecting to ");
Serial.println(ssid);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED)
{
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi connected");
Serial.write(13);
server.begin();
Serial.println(WiFi.localIP());
}

void loop() {
WiFiClient client = server.available();
if (!client) {
return;
}
Serial.println("new client");
while(!client.available())
{
delay(1);
}
emon1.calcVI(20,2000);
emon1.serialprint();
unsigned int long timemillis = millis();
unsigned int long time = millis();
float realPower = emon1.realPower;
float apparentPower = emon1.apparentPower;
float supplyVoltage = emon1.Vrms;
float Irms = emon1.Irms;
float powerFactor = (realPower/ apparentPower);
lcd.setCursor(4,0);
lcd.print ("EnergyMonitor");
lcd.setCursor(0,1);
lcd.print("V = ");
lcd.print (supplyVoltage);
lcd.setCursor(9,1);
lcd.print("I = ");
lcd.print(Irms);
lcd.setCursor(0,2);
lcd.print("Powerfactor = ");
lcd.print(powerFactor);
lcd.setCursor(0,3);
lcd.print("Units(kWh) = ");
lcd.print(abs(realPowertime)/abs(10003600));
String web = "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n";
web += "\r\n";
web += "\r\n";
web += "

ENERGY MONITOR

\r\n";
web += "

\r\n";
web += "V=\r\n";
web += Serial.print(supplyVoltage);
web += "I=\r\n";
web += Serial.print(Irms);
web += "Powerfactor =\r\n";
web += Serial.print(powerFactor);
web += "Units(kWh) = \r\n";
web += Serial.print((realPowertime)/abs(10003600));

web += "\r\n";
web += "\r\n";

client.print(web);
}

@lrmoreno007

This comment has been minimized.

Copy link
Contributor

commented Jan 24, 2019

The problem are in the the Third Party library EmonLib ---> https://github.com/openenergymonitor/EmonLib/blob/master/EmonLib.cpp

It's not fixed for ESP8266. There are a while(1) and if you read the docs and what was discussed in this issue, then you must know what to do.

@KiLLAAA

This comment has been minimized.

Copy link

commented Jan 24, 2019

@devimeruva the problem is that you need to use proper (ported) library for esp8266..
also.. the sketch seems that it will not likely do what you would expect..
library here..
inspiration there..

@DamienAR

This comment has been minimized.

Copy link

commented Feb 15, 2019

Hi ! I don't know if someone will see my message but, I had the same error and I think I found my problem.
I work on an ESP8266 NodeMCU DevKit V1 and I noticed, when I want tu use the function millis(), my ESP reset.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.