Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By Morteza_avn
#57394 I use below library for connecting ESP8266-01 to MQTT server:
<ESP8266WiFi.h> https://github.com/esp8266/Arduino
<MQTTClient.h> https://github.com/256dpi/arduino-mqtt
Server OS is Raspbian and compile this code on ESP loop section:

Code: Select allvoid loop() {
  client.loop();
  if(!client.connected()) {
   ESP.restart();
  }
}

All thing is OK, ESP restart when i stop MQTT broker service that run on server but it Hang up if shut down or unplug Raspberry Pi suddenly.
what's difference between shut down server and stop connected service? How i resolve? :roll: