ESP8266 NodeMCU wdt reset problem

Hey there!

I’ve recently bought a NodeMCU v1.0 (ESP8266). Initially, I installed the ESP8266 library and Blynk by reading the docs. Then I tried a sketch with an HC-SR05 module.

Even though it did work fine with the the sensor, all of a sudden it stopped working. To diagnose the problem I opened up the serial monitor to check the logs, which were just full of reconnects.

[4797] Connected to WiFi
[4797] IP: 192.168.0.100
[4797] 
    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v1.0.1 on ESP8266

[4874] Connecting to blynk.cloud:80
[5007] Ready (ping: 41ms).
[70] Connecting to WiFi
[4799] Connected to WiFi
[4799] IP: 192.168.0.100

I then checked the DHCP clients listing of my router and noticed that the device shows up for a second or two and then disappears. Then I noticed WDT resets in the logs.

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

wdt reset
load 0x4010f000, len 3460, room 16 
tail 4
chksum 0xcc
load 0x3fff20b8, len 40, room 4 
tail 4
chksum 0xc9
csum 0xc9
v000461f0
~ld

I tried searching all over blynk community but none of the fixes worked. I then read that some specific GPIO pins in use might be the cause. So I removed the NodeMCU from the breadboard and tried by uploading a sample sketch.

#define BLYNK_PRINT Serial
#define BLYNK_TEMPLATE_ID "TMPxxxxxxxxx"

#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

char auth[] = "authToken";

char ssid[] = "WiFi";
char pass[] = "myPassword";

void setup()
{
  Serial.begin(9600);
  Blynk.begin(auth, ssid, pass);
}

void loop()
{
  Blynk.run();
}

But the same problem persists. The point to be noted is that the example ESP8266 sketch (WifiClient) does NOT cause any WDT resets and works just fine, which is weird.

Any help is appreciated.

This might help you

Blynk.begin() is a blocking command
Your code stops there until it connects.
This is why the watchdog reacts. :rage::rage:
Better use Blynk.config().
I don’t see define BLYNK_DEVICE_NAME at the first 2 lines of your code.

Which ESP8266 core version do you have installed in your Arduino IDE Boards Manager?
What board type and settings are you using when you upload the file to your NodeMCU?

Pete.

Thanks for the assistance @PeteKnight. I have version 3.0.2 of ESP8266 installed in Arduino IDE. As my board type I use NodeMCU 1.0 (ESP-12E Module), 115200 as my upload speed, All Flash Contents as my Erase flash setting. I have also tried changing COM ports even though the issue is not related to them, and of couse it didn’t help.

@Blynk_Coeur can you help me with the implementation in the code? Well I have BLYNK_DEVICE_NAME in my code but just skipped it while posting it here.

Try downgrading to 3.0.1 and see if that helps.

Do you have another device that you could try?

A screenshot would be more informative.

Pete.

WiFi.begin(ssid, pass);
  while (WiFi.status() != WL_CONNECTED) {
    delay(200);
    Serial.print(".");
  }
Serial.print("IP address: ");
  Serial.println(WiFi.localIP());
  Serial.print("Signal ");
  Serial.println(map(WiFi.RSSI(), -105, -40, 0, 100));
  delay(5000);

  Blynk.config(auth); 
  Blynk.connect();

I do have an arduino uno, though not a wifi shield for it. Tried downgrading. Didn’t help.

Screenshot (44)

@Blynk_Coeur the same problem persists. Put all that code in the setup and Blynk.run() in the loop.

1 Like

Can you show us what you see in your serial monitor when you run this code?

Pete.

The error is exactly the same -

wdt reset
load 0x4010f000, len 3460, room 16 
tail 4
chksum 0xcc
load 0x3fff20b8, len 40, room 4 
tail 4
chksum 0xc9
csum 0xc9
v000461f0
~ld

So this is all you see, no debug messages from your sketch?
Does this appear once, or keep repeating?

Pete.

No, the debug messages were there. The error is repetitive.

IP address: 192.168.0.100
Signal: 57

wdt reset
load 0x4010f000, len 3460, room 16 
tail 4
chksum 0xcc
load 0x3fff20b8, len 40, room 4 
tail 4
chksum 0xc9
csum 0xc9
v000461f0
~ld

Since none of the fixes have worked, I am using Adafruit IO temporarily. Everyting thing goes as expected with blynk, except for those WDT resets which did not bother me with Adafruit IO.

What does your latest sketch (the one that produced this output) look like?

Can you make the following changes…

  1. In the IDE, choose Tools > Debug Port and change from “Disabled” to “Serial”

  2. In the IDE, choose Tools > Debug Level and select the next to last option…

  1. Change your Serial.begin command in the sketch to 74880…
    Serial.begin(74880);

  2. Change your Serial Monitor to 74880 and put a check in the “Show Timestamp” box

Upload the sketch and allow it to go through two cycles of rebooting (so it shows the time between the info that’s appearing on screen and the WDT reset, then post the results here.

Under normal circumstances, you should see output something like this (this is using your sketch from post #1 with my Template ID, Auth token and WiFi credentials)…

08:46:34.803 -> 
08:46:34.803 ->  ets Jan  8 2013,rst cause:2, boot mode:(3,6)
08:46:34.803 -> 
08:46:34.803 -> load 0x4010f000, len 3460, room 16 
08:46:34.849 -> tail 4
08:46:34.849 -> chksum 0xcc
08:46:34.849 -> load 0x3fff20b8, len 40, room 4 
08:46:34.849 -> tail 4
08:46:34.849 -> chksum 0xc9
08:46:34.849 -> csum 0xc9
08:46:34.849 -> v00049890
08:46:34.849 -> ~ld
08:46:34.849 -> 
08:46:34.849 -> 
08:46:34.849 -> Hardware WDT Stack Dump - enabled
08:46:34.849 -> 
08:46:34.896 -> 
08:46:34.896 -> SDK:2.2.2-dev(38a443e)/Core:3.0.2=30002000/lwIP:STABLE-2_1_2_RELEASE/glue:1.2-48-g7421258/BearSSL:6105635
08:46:34.943 -> [73] Connecting to REDACTED
08:46:34.943 -> fpm close 1 
08:46:34.943 -> mode : sta(a0:20:a6:15:d9:5b)
08:46:34.943 -> add if0
08:46:34.943 -> wifi evt: 8
08:46:34.943 -> wifi evt: 2
08:46:37.788 -> scandone
08:46:38.674 -> state: 0 -> 2 (b0)
08:46:38.674 -> state: 2 -> 3 (0)
08:46:38.674 -> state: 3 -> 5 (10)
08:46:38.674 -> add 0
08:46:38.674 -> aid 7
08:46:38.674 -> cnt 
08:46:38.674 -> 
08:46:38.674 -> connected with REDACTED, channel 1
08:46:38.674 -> dhcp client start...
08:46:38.674 -> wifi evt: 0
08:46:38.767 -> ip:192.168.1.54,mask:255.255.255.0,gw:192.168.1.1
08:46:38.767 -> wifi evt: 3
08:46:39.142 -> [4310] Connected to WiFi
08:46:39.142 -> [4310] IP: 192.168.1.54
08:46:39.142 -> [4310] 
08:46:39.142 ->     ___  __          __
08:46:39.142 ->    / _ )/ /_ _____  / /__
08:46:39.189 ->   / _  / / // / _ \/  '_/
08:46:39.189 ->  /____/_/\_, /_//_/_/\_\
08:46:39.189 ->         /___/ v1.0.1 on ESP8266
08:46:39.189 -> 
08:46:39.189 -> [4320] Connecting to blynk.cloud:80
08:46:39.189 -> [hostByName] request IP for: blynk.cloud
08:46:39.189 -> [hostByName] Host: blynk.cloud IP: 159.65.55.83
08:46:39.189 -> :ref 1
08:46:39.235 -> :wr 37 0
08:46:39.235 -> :wrc 37 37 0
08:46:39.235 -> :ack 37
08:46:39.235 -> :rn 5
08:46:39.235 -> readBytes should be overridden for better efficiency
08:46:39.235 -> :c0 1, 5
08:46:39.235 -> [4408] Ready (ping: 22ms).
08:46:39.326 -> :wr 116 0
08:46:39.326 -> :wrc 116 116 0
08:46:39.326 -> :ack 116
08:46:39.326 -> :rn 5
08:46:39.326 -> :c0 1, 5
08:46:48.673 -> pm open,type:2 0

Pete.

1 Like