diff --git a/tasmota/xdrv_02_mqtt.ino b/tasmota/xdrv_02_mqtt.ino index f342c3234..b976dd843 100644 --- a/tasmota/xdrv_02_mqtt.ino +++ b/tasmota/xdrv_02_mqtt.ino @@ -603,12 +603,21 @@ void MqttReconnect(void) UdpDisconnect(); #endif // USE_EMULATION - AddLog_P(LOG_LEVEL_INFO, S_LOG_MQTT, PSTR(D_ATTEMPTING_CONNECTION)); - Mqtt.connected = false; Mqtt.retry_counter = Settings.mqtt_retry; TasmotaGlobal.global_state.mqtt_down = 1; +#ifdef FIRMWARE_MINIMAL +#ifndef USE_MQTT_TLS + // Don't try to connect if MQTT requires TLS but TLS is not supported + if (Settings.flag4.mqtt_tls) { + return; + } +#endif +#endif + + AddLog_P(LOG_LEVEL_INFO, S_LOG_MQTT, PSTR(D_ATTEMPTING_CONNECTION)); + char *mqtt_user = nullptr; char *mqtt_pwd = nullptr; if (strlen(SettingsText(SET_MQTT_USER))) {