Skip to content

Commit

Permalink
Fix no AP on initial install
Browse files Browse the repository at this point in the history
Fix no AP on initial install (#7282)
  • Loading branch information
arendst committed Dec 21, 2019
1 parent 9fc1127 commit 281cef6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tasmota/support_tasmota.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down
4 changes: 2 additions & 2 deletions tasmota/support_wifi.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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]) {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 281cef6

Please sign in to comment.