diff --git a/code/espurna/config/general.h b/code/espurna/config/general.h index 25c1e8d6..03cebcdc 100644 --- a/code/espurna/config/general.h +++ b/code/espurna/config/general.h @@ -362,12 +362,21 @@ PROGMEM const char* const custom_reset_string[] = { // Using MQTT over SSL works pretty well but generates problems with the web interface. // It could be a good idea to use it in conjuntion with WEB_SUPPORT=0. // Requires ASYNC_TCP_SSL_ENABLED to 1 and ESP8266 Arduino Core staging version. -// Right now only available when MQTT_USE_ASYNC=1 (default value). +// +// You can use it with MQTT_USE_ASYNC=1 (AsyncMqttClient library) +// but you might experience hiccups on the web interface, so my recommendation is: +// WEB_SUPPORT=0 +// +// If you use it with MQTT_USE_ASYNC=0 (PubSubClient library) +// you will have to disable all the modules that use ESPAsyncTCP, that is: +// ALEXA_SUPPORT=0, INFLUXDB_SUPPORT=0, TELNET_SUPPORT=0 and WEB_SUPPORT=0 +// // You will need the fingerprint for your MQTT server, example for CloudMQTT: // $ echo -n | openssl s_client -connect m11.cloudmqtt.com:24055 > cloudmqtt.pem // $ openssl x509 -noout -in cloudmqtt.pem -fingerprint -sha1 -#define MQTT_SSL_ENABLED 0 -#define MQTT_SSL_FINGERPRINT "" + +#define MQTT_SSL_ENABLED 0 // By default MQTT over SSL will not be enabled +#define MQTT_SSL_FINGERPRINT "" // SSL fingerprint of the server #define MQTT_ENABLED 0 // Do not enable MQTT connection by default #define MQTT_AUTOCONNECT 1 // If enabled and MDNS_SUPPORT=1 will perform an autodiscover and @@ -461,6 +470,7 @@ PROGMEM const char* const custom_reset_string[] = { // LIGHT // ----------------------------------------------------------------------------- +// Available light providers (do not change) #define LIGHT_PROVIDER_NONE 0 #define LIGHT_PROVIDER_MY9192 1 #define LIGHT_PROVIDER_DIMMER 2 diff --git a/code/espurna/mqtt.ino b/code/espurna/mqtt.ino index b7678a56..c1fece6c 100644 --- a/code/espurna/mqtt.ino +++ b/code/espurna/mqtt.ino @@ -393,6 +393,8 @@ void mqttConnect() { DEBUG_MSG_P(PSTR("[MQTT] Invalid fingerprint\n")); response = false; } + _mqttClientSecure.stop(); + yield(); } else { DEBUG_MSG_P(PSTR("[MQTT] Wrong fingerprint\n")); response = false; diff --git a/code/platformio.ini b/code/platformio.ini index b74a0381..d512f0da 100644 --- a/code/platformio.ini +++ b/code/platformio.ini @@ -81,7 +81,7 @@ framework = arduino board = nodemcuv2 lib_deps = ${common.lib_deps} lib_ignore = ${common.lib_ignore} -build_flags = ${common.build_flags} -DNODEMCU_LOLIN -DDEBUG_FAUXMO=Serial -DNOWSAUTH -DASYNC_TCP_SSL_ENABLED=1 ${common.debug_flags} +build_flags = ${common.build_flags} -DNODEMCU_LOLIN -DDEBUG_FAUXMO=Serial -DNOWSAUTH -DASYNC_TCP_SSL_ENABLED=1 upload_speed = 460800 monitor_baud = 115200