From 750d35283b7d16d70e4387c2b8c0b65b5490176d Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Fri, 30 Oct 2020 16:29:36 +0100 Subject: [PATCH] Don't try to connect to TLS with Tasmota-minimal --- tasmota/xdrv_02_mqtt.ino | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tasmota/xdrv_02_mqtt.ino b/tasmota/xdrv_02_mqtt.ino index 8288f8df3..9d83588a4 100644 --- a/tasmota/xdrv_02_mqtt.ino +++ b/tasmota/xdrv_02_mqtt.ino @@ -603,12 +603,19 @@ 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; global_state.mqtt_down = 1; +#ifdef FIRMWARE_MINIMAL + // Don't try to connect if MQTT requires TLS but TLS is not supported + if (Settings.flag4.mqtt_tls) { + return; + } +#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))) {