From 252bcbdded0bdb11bf44e14d5cd54ac006e2dce9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xose=20P=C3=A9rez?= Date: Thu, 12 Jan 2017 00:16:53 +0100 Subject: [PATCH] Force MQTT close client before reconnecting. Revert back to latest ESPAsyncTCP --- code/espurna/mqtt.ino | 2 ++ code/platformio.ini | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/code/espurna/mqtt.ino b/code/espurna/mqtt.ino index fb19854e..945d045d 100644 --- a/code/espurna/mqtt.ino +++ b/code/espurna/mqtt.ino @@ -131,6 +131,8 @@ void mqttConnect() { if (!mqtt.connected()) { + mqtt.disconnect(); + char * host = strdup(getSetting("mqttServer", MQTT_SERVER).c_str()); if (strlen(host) == 0) return; unsigned int port = getSetting("mqttPort", MQTT_PORT).toInt(); diff --git a/code/platformio.ini b/code/platformio.ini index 6c8b1028..b8044901 100644 --- a/code/platformio.ini +++ b/code/platformio.ini @@ -9,7 +9,7 @@ lib_deps = Adafruit Unified Sensor https://github.com/xoseperez/Time ArduinoJson - https://github.com/me-no-dev/ESPAsyncTCP#e074eaac + ESPAsyncTCP ESPAsyncWebServer https://github.com/marvinroger/async-mqtt-client Embedis