From 27f3842ef576aed0c24258541478a10f61806b6c Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Wed, 28 Oct 2020 20:32:20 +0100 Subject: [PATCH] do second try to set AP ESSID and PASSWORD if necessary --- WifiInterface.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/WifiInterface.cpp b/WifiInterface.cpp index be17b02..77294ae 100644 --- a/WifiInterface.cpp +++ b/WifiInterface.cpp @@ -223,8 +223,9 @@ bool WifiInterface::setup2(const __FlashStringHelper* SSid, const __FlashStringH if (oldCmd) { while (wifiStream->available()) StringFormatter::printEscape( wifiStream->read()); /// THIS IS A DIAG IN DISGUISE - StringFormatter::send(wifiStream, F("AT+CWSAP=\"DCCEX_%s\",\"PASS_%s\",1,4\r\n"), macTail, macTail); - checkForOK(16000, OK_SEARCH, true); // can ignore failure as AP mode may still be ok + int i=0; + do StringFormatter::send(wifiStream, F("AT+CWSAP=\"DCCEX_%s\",\"PASS_%s\",1,4\r\n"), macTail, macTail); + while (i++<2 && !checkForOK(16000, OK_SEARCH, true)); // do twice if necessary but ignore failure as AP mode may still be ok } else {