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.
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.
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.
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.
Blynk.begin() is a blocking command
Your code stops there until it connects.
This is why the watchdog reacts.
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?
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.
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.
Change your Serial.begin command in the sketch to 74880… Serial.begin(74880);
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)…