Merge pull request #9674 from s-hadinger/minimal_notls

Don't try to connect to TLS with Tasmota-minimal
This commit is contained in:
Theo Arends 2020-10-30 17:04:46 +01:00 committed by GitHub
commit c0c198f957
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -603,12 +603,21 @@ void MqttReconnect(void)
UdpDisconnect(); UdpDisconnect();
#endif // USE_EMULATION #endif // USE_EMULATION
AddLog_P(LOG_LEVEL_INFO, S_LOG_MQTT, PSTR(D_ATTEMPTING_CONNECTION));
Mqtt.connected = false; Mqtt.connected = false;
Mqtt.retry_counter = Settings.mqtt_retry; Mqtt.retry_counter = Settings.mqtt_retry;
TasmotaGlobal.global_state.mqtt_down = 1; 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_user = nullptr;
char *mqtt_pwd = nullptr; char *mqtt_pwd = nullptr;
if (strlen(SettingsText(SET_MQTT_USER))) { if (strlen(SettingsText(SET_MQTT_USER))) {