<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:
void 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?