-->
Page 1 of 1

Hang up ESP8266-01

PostPosted: Sun Oct 30, 2016 1:18 pm
by Morteza_avn
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: