mirror of
https://github.com/thooge/esp32-nmea2000-obp60.git
synced 2025-12-14 14:33:07 +01:00
#102: only reconnect wifi every 40s
This commit is contained in:
@@ -85,6 +85,7 @@ bool GwWifi::connectInternal(){
|
|||||||
if (wifiClient->asBoolean()){
|
if (wifiClient->asBoolean()){
|
||||||
clientIsConnected=false;
|
clientIsConnected=false;
|
||||||
LOG_DEBUG(GwLog::LOG,"creating wifiClient ssid=%s",wifiSSID->asString().c_str());
|
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());
|
wl_status_t rt=WiFi.begin(wifiSSID->asCString(),wifiPass->asCString());
|
||||||
LOG_DEBUG(GwLog::LOG,"wifiClient connect returns %d",(int)rt);
|
LOG_DEBUG(GwLog::LOG,"wifiClient connect returns %d",(int)rt);
|
||||||
lastConnectStart=millis();
|
lastConnectStart=millis();
|
||||||
@@ -92,7 +93,8 @@ bool GwWifi::connectInternal(){
|
|||||||
}
|
}
|
||||||
return false;
|
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(){
|
void GwWifi::loop(){
|
||||||
if (wifiClient->asBoolean())
|
if (wifiClient->asBoolean())
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user