From 8c3295034d72cb2906932184d4d14dfb1d7b2e04 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Mon, 2 Dec 2019 11:56:40 +0100 Subject: [PATCH] Update support_wifi.ino --- tasmota/support_wifi.ino | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tasmota/support_wifi.ino b/tasmota/support_wifi.ino index c920c8a63..49faa0663 100644 --- a/tasmota/support_wifi.ino +++ b/tasmota/support_wifi.ino @@ -118,8 +118,10 @@ void WifiSetMode(WiFiMode_t wifi_mode) delay(100); } - if (!WiFi.mode(wifi_mode)) { - AddLog_P(LOG_LEVEL_DEBUG, PSTR(D_LOG_WIFI "Cannot set Mode")); + uint32_t retry = 2; + while (!WiFi.mode(wifi_mode) && retry--) { + AddLog_P(LOG_LEVEL_INFO, S_LOG_WIFI, PSTR("Retry set Mode...")); + delay(100); } if (wifi_mode == WIFI_OFF) {