Don't try to connect to TLS with Tasmota-minimal

This commit is contained in:
Stephan Hadinger 2020-10-30 16:29:36 +01:00
parent 5421c608cd
commit 750d35283b
1 changed files with 9 additions and 2 deletions

View File

@ -603,12 +603,19 @@ 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;
global_state.mqtt_down = 1; 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_user = nullptr;
char *mqtt_pwd = nullptr; char *mqtt_pwd = nullptr;
if (strlen(SettingsText(SET_MQTT_USER))) { if (strlen(SettingsText(SET_MQTT_USER))) {