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