From 281cef6763a26635ea872b8c860c07b463caa889 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Sat, 21 Dec 2019 17:57:54 +0100 Subject: [PATCH] Fix no AP on initial install Fix no AP on initial install (#7282) --- tasmota/support_tasmota.ino | 2 +- tasmota/support_wifi.ino | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tasmota/support_tasmota.ino b/tasmota/support_tasmota.ino index 08b898efbcc1..900ba3dd4c24 100644 --- a/tasmota/support_tasmota.ino +++ b/tasmota/support_tasmota.ino @@ -108,7 +108,7 @@ char* GetTopic_P(char *stopic, uint32_t prefix, char *topic, const char* subtopi fulltopic += FPSTR(MQTT_TOKEN_PREFIX); // Need prefix for commands to handle mqtt topic loops } for (uint32_t i = 0; i < 3; i++) { - if ('\0' == SettingsText(SET_MQTTPREFIX1 + i)) { + if (!strlen(SettingsText(SET_MQTTPREFIX1 + i))) { char temp[TOPSZ]; SettingsUpdateText(SET_MQTTPREFIX1 + i, GetTextIndexed(temp, sizeof(temp), i, kPrefixes)); } diff --git a/tasmota/support_wifi.ino b/tasmota/support_wifi.ino index 86cc81dd89c7..c283f1bb51ac 100644 --- a/tasmota/support_wifi.ino +++ b/tasmota/support_wifi.ino @@ -191,7 +191,7 @@ void WifiBegin(uint8_t flag, uint8_t channel) case 2: // Toggle Settings.sta_active ^= 1; } // 3: Current AP - if ('\0' == SettingsText(SET_STASSID1 + Settings.sta_active)) { + if (!strlen(SettingsText(SET_STASSID1 + Settings.sta_active))) { Settings.sta_active ^= 1; // Skip empty SSID } if (Settings.ip_address[0]) { @@ -436,7 +436,7 @@ void WifiCheckIp(void) if (!Wifi.retry || ((Wifi.retry_init / 2) == Wifi.retry)) { AddLog_P(LOG_LEVEL_INFO, S_LOG_WIFI, PSTR(D_CONNECT_FAILED_AP_TIMEOUT)); } else { - if (('\0' == SettingsText(SET_STASSID1)) && ('\0' == SettingsText(SET_STASSID2))) { + if (!strlen(SettingsText(SET_STASSID1)) && !strlen(SettingsText(SET_STASSID2))) { wifi_config_tool = WIFI_MANAGER; // Skip empty SSIDs and start Wifi config tool Wifi.retry = 0; } else {