Example sketches for the new Arduino IDE for ESP8266

Moderator: igrr

User avatar
By danbicks
#20432 Guys,

I have been pulling my hair out with this one, could it be the SDK? could it be arduino IDE or could it be me.

I have been trying to get a stable MQTT sketch working, It connects, gets callbacks processes message but needs to be bullet proof. My main aim was to add network and MQTT checking in this sketch fired by the ticker every 20 seconds to check and re connect if need be.
I have a wireless TPLINK router as a bridge, easy to pull out power and force my little ESP to do some network re connect attempts. It realizes the network is down and tries, I plug the network back in and a good old WDT crash is hit.

Can you guru's stop me from insanity here!

Many thanks in advance Dans
WDT Error.JPG

ESP_MQTT_12_NETCHECK_FORUM.rar
You do not have the required permissions to view the files attached to this post.
User avatar
By GerryKeely
#20461 Hi

This may have nothing to do with your problem but I note you use wdt_feed() in your program.I don't think this actually does anything. If you try the following program with and without the ESP.wdtFeed(), the watchdog still resets the program

Code: Select allextern "C"
{
#include "user_interface.h"
}
void setup() {
  delay(1000);
  Serial.begin(115200);
  Serial.println("starting");
}

void loop() {
  while(1){ESP.wdtFeed();}
}



Gerry