#102: only reconnect wifi every 40s

This commit is contained in:
andreas 2025-03-04 20:47:47 +01:00
parent a129d865c9
commit 2ab6a00883
1 changed files with 3 additions and 1 deletions

View File

@ -85,6 +85,7 @@ bool GwWifi::connectInternal(){
if (wifiClient->asBoolean()){
clientIsConnected=false;
LOG_DEBUG(GwLog::LOG,"creating wifiClient ssid=%s",wifiSSID->asString().c_str());
WiFi.setAutoReconnect(false); //#102
wl_status_t rt=WiFi.begin(wifiSSID->asCString(),wifiPass->asCString());
LOG_DEBUG(GwLog::LOG,"wifiClient connect returns %d",(int)rt);
lastConnectStart=millis();
@ -92,7 +93,8 @@ bool GwWifi::connectInternal(){
}
return false;
}
#define RETRY_MILLIS 20000
//#102: we should have a wifi connect retry being > 30s - with some headroom
#define RETRY_MILLIS 40000
void GwWifi::loop(){
if (wifiClient->asBoolean())
{