Hang up ESP8266-01
Posted: Sun Oct 30, 2016 1:18 pm
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:
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?
<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 all
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?