1
0
mirror of https://github.com/thooge/esp32-nmea2000-obp60.git synced 2026-02-25 05:03:07 +01:00

Fix for GwWifi

This commit is contained in:
norbert-walter
2026-02-20 09:52:41 +01:00
parent b85504bf50
commit 66e71acac3

View File

@@ -131,33 +131,20 @@ void GwWifi::loop(){
if (lastConnectStart > now || (lastConnectStart + RETRY_MILLIS) < now) if (lastConnectStart > now || (lastConnectStart + RETRY_MILLIS) < now)
{ {
LOG_DEBUG(GwLog::LOG,"wifiClient: retry connect to %s", wifiSSID->asCString()); LOG_DEBUG(GwLog::LOG,"wifiClient: retry connect to %s", wifiSSID->asCString());
<<<<<<< HEAD
// CRITICAL SECTION: WiFi-Operationen müssen serialisiert werden // CRITICAL SECTION: WiFi-Operationen müssen serialisiert werden
if (acquireMutex()){ if (acquireMutex()){
WiFi.disconnect(); WiFi.disconnect(true);
delay(300);
esp_wifi_stop();
delay(100);
esp_wifi_start();
releaseMutex(); releaseMutex();
connectInternal(); connectInternal();
} }
else{ else{
LOG_DEBUG(GwLog::ERROR,"GwWifi: mutex timeout in loop"); LOG_DEBUG(GwLog::ERROR,"GwWifi: mutex timeout in loop");
} }
=======
//+++++++++ Old part +++++++++++++++++++++
// WiFi.disconnect();
// connectInternal();
//++++++++++++++++++++++++++++++++++++++++
//+++++++++ New part +++++++++++++++++++++
WiFi.disconnect(true);
delay(300);
esp_wifi_stop();
delay(100);
esp_wifi_start();
connectInternal();
//++++++++++++++++++++++++++++++++++++++++
>>>>>>> autopilot2
} }
} }
else{ else{
@@ -178,6 +165,7 @@ void GwWifi::loop(){
} }
} }
} }
bool GwWifi::clientConnected(){ bool GwWifi::clientConnected(){
// CRITICAL SECTION: WiFi.status() muss geschützt werden // CRITICAL SECTION: WiFi.status() muss geschützt werden
if (!acquireMutex()){ if (!acquireMutex()){
@@ -188,6 +176,7 @@ bool GwWifi::clientConnected(){
releaseMutex(); releaseMutex();
return result; return result;
}; };
bool GwWifi::connectClient(){ bool GwWifi::connectClient(){
// CRITICAL SECTION: Disconnect und Connect müssen atomar sein // CRITICAL SECTION: Disconnect und Connect müssen atomar sein
if (!acquireMutex()){ if (!acquireMutex()){