Soft wdt reset

I have 5 nodemcu and 1 wemos D1.
All of them, after i have uploaded the sketch below return the following error
//

Soft WDT reset

stack>>>

ctx: cont
sp: 3ffffdc0 end: 3fffffc0 offset: 01b0
3fffff70: 3ffef3cc 40203d08 3ffeec34 3ffeed58
3fffff80: 3fffdad0 00000000 3ffeea70 40202ae0
3fffff90: feefeffe 00000000 3ffeed28 402037fc
3fffffa0: 3fffdad0 00000000 3ffeed28 40206054
3fffffb0: feefeffe feefeffe 3ffe853c 40100c11
<<<stack<<<

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

load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
v951aeffa
~ld

//
i can’t figure it out by myself. if someone had similar errors and could share his solution. i appreciate.

#include <ESP8266WiFi.h> #include <BlynkSimpleEsp8266.h> #include <SoftwareSerial.h>
#include <SimpleTimer.h>
#include <Adafruit_NeoPixel.h>
#include<DHT.h>
#include <Servo.h>

#define DHTTYPE DHT11
#define LightPin D5
#define numarPixeli 16
#define valuePir D7
int pinDht = 12;
DHT dht(pinDht, DHTTYPE);
Servo servo;
Adafruit_NeoPixel pixeli = Adafruit_NeoPixel(numarPixeli, LightPin, NEO_GRB + NEO_KHZ800);


char authBlynk[] = " ";
const char* ssid = " ";
const char* password =" ";


WiFiClient espClient;



void setup_wifi() {
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
  }
}





void setup() {
  pinMode(D7,INPUT);
  servo.attach(5);
  Serial.begin(115200);
  setup_wifi();
  pixeli.begin();
  dht.begin();
  Blynk.begin(authBlynk, ssid, password);
ESP.wdtDisable();
ESP.wdtEnable(WDTO_8S);

}

void loop()
{
  ESP.wdtFeed();
  int a = digitalRead(valuePir);  
  if(a == HIGH)
  {
    Blynk.notify("Miscare detectata!");
  }
  float hum = dht.readHumidity();
  float temp = dht.readTemperature();
  float fahr = dht.readTemperature(true);
  if (isnan(hum) || isnan(temp) || (isnan(fahr))  ) return;
  float hic = dht.computeHeatIndex(temp, hum, false);
  static char temperatureTemp[7];
  dtostrf(hic, 6, 2, temperatureTemp);
  static char humidityTemp[7];
  dtostrf(hum, 6, 2, humidityTemp);
  Blynk.run();
  Blynk.virtualWrite(V16, temp);
  Blynk.virtualWrite(V17, hum);
  yield();
}
BLYNK_WRITE(V1)
{
  servo.write(param.asInt());
}

BLYNK_WRITE(V2)
{
  servo.write(0);
}


BLYNK_WRITE(V3)
{
  servo.write(90);
     }
     BLYNK_CONNECTED() {
      Blynk.syncVirtual(V15);
     }
      BLYNK_WRITE(V15)
    {

      int R = param[0].asInt();
      int G = param[1].asInt();
      int B = param[2].asInt();
      for (int i = 0; i < numarPixeli; i++) 
      {
        pixeli.setPixelColor(i, pixeli.Color(R, G, B));
        pixeli.show();
     }

    }

I’ve edited your post so that the code displays correctly, by adding triple backticks at the beginning and end of the code.
Please do this yourself in future, otherwise your unformatted code will be deleted.
Triple backticks look like this:
```

You should read this document so that you understand how many times per second your void loop is being processed:


You should also research what the maximum read frequency of the DHT11 sensor is, and obviously take heed of the fact that calling Blynk.virtualWrites within the void loop is not allowed.

Pete.

Hi Pete,

Thank you for the response and also for formatting my code. sorry ! next time i will be more focused on that.
What i forgot to mention is that the code was uploaded to one of my nodemcu and worked well. until today when i was thinking to change the ssid and password credentials.
And then surprise ! Soft wdt error… and after that i tried with all of my nodemcu. in the first place, they all worked fine. With one of them i tried to upload only the blynk example to see if is something wrong with my code or no. So i proceeded and the result was exactly the same. Even with the blynk example it keeps return that error. it blynks but in serial monitor that error appear.
I dont know what should i do now. Are there all broken?

What version of the ESP core are you running?

Pete.

I am using the core vs 2.4.2

After more than 7 hours of research and all kinds of methods implemented in code, obviously without results. now i think i figured it out how this error could be resolved.
I had to rewrite some parts of code and i uploaded to everyone of my nodemcu. In serial monitor the error dissapeared but i will let them turned on at least 1 day to see how they act. I will come back to write the solution. Maybe someone will encounter the same problem and it will help . And also the topic should be closed as solved.
Pete, thank you !

1 Like

How did you fix the issue, can you comment?