Soft wdt reset error on NodeMCU (ESP8266) I am getting error on Serial monitor Soft WDT reset. I decoded the error code also and found the following stacktrace.
I am using SIM808 module and DFRobot_sim808 as the library.

0x4010030d: millis at AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0\cores\esp8266/core_esp8266_wiring.c line 180
0x401003b9: __digitalWrite at AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0\cores\esp8266/core_esp8266_wiring_digital.c line 82
0x40202863: sim808_wait_for_resp(char const*, DataType, unsigned int, unsigned int) at Documents\Arduino\libraries\DFRobot_SIM808-master/sim808.cpp line 172
0x402027a4: sim808_send_byte(unsigned char) at Documents\Arduino\libraries\DFRobot_SIM808-master/sim808.cpp line 118
0x402028ce: sim808_check_with_cmd(char const*, char const*, DataType, unsigned int, unsigned int) at Documents\Arduino\libraries\DFRobot_SIM808-master/sim808.cpp line 191
0x402025dc: DFRobot_SIM808::init() at Documents\Arduino\libraries\DFRobot_SIM808-master/DFRobot_sim808.cpp line 63
0x402024c1: setup at G:\Development\ESP8266\SIM Module\sim_module/sim_module.ino line 41 (discriminator 1)
0x40203248: loop_wrapper() at AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0\cores\esp8266/core_esp8266_main.cpp line 122
0x40100e8d: cont_wrapper at AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0\cores\esp8266/cont.S line 81

I tried to find solution for the same everywhere but none found it. But the same code I am trying on arduino it works but not for ESP8266. I dont have long waiting loop(). But still it gives me error.
Below is the code for the same
#include &lt;DFRobot_sim808.h&gt;
#include &lt;SoftwareSerial.h&gt;

#define PHONE_NUMBER &quot;********&quot;  

#define MESSAGE  &quot;hello,world&quot;

#define PIN_TX D1 
#define PIN_RX D0

SoftwareSerial mySerial(PIN_RX, PIN_TX);
DFRobot_SIM808 sim808(&amp;mySerial);//Connect RX,TX,PWR,

void setup() {
  delay(1000);
  mySerial.begin(9600);
  Serial.begin(9600);

  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB
  }
  while(!sim808.init()) {
      delay(1000);
      Serial.print(&quot;Sim808 init error\r\n&quot;);
  } 
  Serial.println(&quot;Sim808 init success&quot;);
  Serial.println(&quot;Start to send message ...&quot;);

  sim808.sendSMS(PHONE_NUMBER,MESSAGE);
}

void loop() {

}
The culpret is the SIM808 library. It's not written to work well with the ESP8266.

The problem lies in this function:

boolean sim808_wait_for_resp(const char* resp, DataType type, unsigned int timeout, unsigned int chartimeout)
{
    int len = strlen(resp);
    int sum = 0;
    unsigned long timerStart, prevChar;    //prevChar is the time when the previous Char has been read.
    timerStart = millis();
    prevChar = 0;
    while(1) {
        if(sim808_check_readable()) {
            char c = serialSIM808-&gt;read();
            prevChar = millis();
            sum = (c==resp[sum]) ? sum+1 : 0;
            if(sum == len)break;
        }
        if ((unsigned long) (millis() - timerStart) &gt; timeout * 1000UL) {
            return false;
        }
        //If interchar Timeout =&gt; return FALSE. So we can return sooner from this function.
        if (((unsigned long) (millis() - prevChar) &gt; chartimeout) &amp;&amp; (prevChar != 0)) {
            return false;
        }

    }
    //If is a CMD, we will finish to read buffer.
    if(type == CMD) sim808_flush_serial();
    return true;
}


It has a loop that can take some time to run, and it doesn't yield() at any point to allow the ESP8266's housekeeping routines to run and "kick the dog".

Adding a call to yield() inside the while(1) loop should cure the problem.