Wdt reset - firebase & esp8266

My app is crashing and I don't know what are the causes. I am new in arduino. Below I will paste my codes and the error.

Code in Arduino IDE:

//####################################################################################################################################################################################
//---------------------------------------------------------------------------------Test Set and Get Data from Firebase Realtime Database
#include <ESP8266WiFi.h>
#include <FirebaseArduino.h>
#include <ArduinoJson.h>
#include <ESP8266HTTPClient.h>

#define FIREBASE_HOST "****" //--> URL address of your Firebase Realtime Database.
#define FIREBASE_AUTH "********" //--> Your firebase database secret code.

//----------------------------------------SSID and Password of your WiFi router.
const char* ssid = "Sadboi 4G"; //--> Your wifi name or SSID.
const char* password = "_8fZugB0@^"; //--> Your wifi password.
const unsigned char Passive_buzzer = 2;
//----------------------------------------

String stats = "";

void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
delay(500);

WiFi.begin(ssid, password); //--> Connect to your WiFi router
Serial.println("");

pinMode(Passive_buzzer,OUTPUT); //--> On Board LED port Direction output

//----------------------------------------Wait for connection
Serial.print("Connecting");
while (WiFi.status() != WL_CONNECTED) {
Serial.println("error");

}
Serial.println("");
Serial.print("Successfully connected to : ");
Serial.println(ssid);
Serial.print("IP address: ");
Serial.println(WiFi.localIP());
Serial.println();
//----------------------------------------

//----------------------------------------Firebase Realtime Database Configuration.
Firebase.begin(FIREBASE_HOST, FIREBASE_AUTH);
Firebase.setString("Buzzer","Off");
//----------------------------------------
}

void loop() {
// put your main code here, to run repeatedly:

Serial.println();

stats = Firebase.getString("Buzzer");
// Conditions for handling errors.
if (stats == "On") {
Serial.print("Buzzer on.");
tone(Passive_buzzer, 523);
delay(1000);
}
else if(stats == "Off"){
Serial.print("Buzzer off.");
noTone(Passive_buzzer);
}
else{
Serial.println("Error.");
Serial.println();
}
Serial.println("Setting successful");
Serial.println();
//----------------------------------------

}

Error:
Soft WDT reset

stack>>>

ctx: cont
sp: 3ffffd60 end: 3fffffc0 offset: 01b0
3fffff10: 3ffe894c 00000000 3ffeeea0 3ffe8520
3fffff20: 3ffe894c 3ffeedb0 3ffeeea0 40207a9c
3fffff30: 40242652 3ffeeea0 3ffeedb0 40207d15
3fffff40: 3ffe8607 00000000 3ffeeea0 40207d40
3fffff50: 3ffef6ec 40202d60 3ffeeea0 40207d28
3fffff60: 3fffdad0 3ffeedb0 3ffeeea0 40202911
3fffff70: feefeffe feefeffe feefeffe feefeffe
3fffff80: feefeffe feefeffe feefeffe feefeffe
3fffff90: feefeffe feefeffe feefeffe 3ffeef28
3fffffa0: 3fffdad0 00000000 3ffeeef8 40208ee8
3fffffb0: feefeffe feefeffe 3ffe8598 401008b5
<<<stack<<<

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

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

wdt reset

@dhan0427, your topic has been moved to a more suitable location on the forum. InstallationandTroubleshooting is not for problems with your project (see About the Installation & Troubleshooting category).

Please take some time to read How to get the best out of this forum and next apply what you have learned / read about code tags to the code in your post.

wdt..... Watch Dog Timer.....
Check the settings.

I solved it, I added yield() at the while loop function

Well done!

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.