Increase Wifi connection time before reconfig

This commit is contained in:
Mathieu Maret 2022-09-07 22:58:23 +02:00
parent e60b8ef8ae
commit e68eec8955
1 changed files with 2 additions and 5 deletions

View File

@ -132,10 +132,7 @@ void WifiSetup(productConfig conf) {
bssidConf = bssid;
}
// WA https://github.com/esp8266/Arduino/issues/2186
WiFi.persistent(false);
WiFi.mode(WIFI_OFF); // this is a temporary line, to be removed after SDK update to 1.5.4
WiFi.mode(WIFI_STA);
SKETCH_DEBUG_PRINTF("Using channel %u (0==auto)\n", conf.channel );
WiFi.begin(conf.ssid, conf.password, conf.channel, bssidConf);
while (WiFi.status() != WL_CONNECTED) {
delay(50);
@ -144,7 +141,7 @@ void WifiSetup(productConfig conf) {
reconfig = 0;
return;
}
if (connectionTry == 60) {
if (connectionTry == 120) {
SKETCH_DEBUG_PRINTLN("Cannot connect to wifi. Try without BSSID and channel");
WiFi.begin(conf.ssid, conf.password);
}