mirror of
https://github.com/thooge/esp32-nmea2000-obp60.git
synced 2026-09-11 19:55:14 +02:00
Fix Wifi AP shutdown during client WiFi reconnect attempt
This commit is contained in:
+24
-20
@@ -143,30 +143,34 @@ void GwWifi::loop(){
|
|||||||
|
|
||||||
delay(300);
|
delay(300);
|
||||||
|
|
||||||
if (acquireMutex()){
|
if (!apActive) {
|
||||||
esp_err_t stopErr=esp_wifi_stop();
|
if (acquireMutex()){
|
||||||
releaseMutex();
|
esp_err_t stopErr=esp_wifi_stop();
|
||||||
if (stopErr != ESP_OK){
|
releaseMutex();
|
||||||
LOG_DEBUG(GwLog::ERROR,"GwWifi: esp_wifi_stop failed: %d",(int)stopErr);
|
if (stopErr != ESP_OK){
|
||||||
|
LOG_DEBUG(GwLog::ERROR,"GwWifi: esp_wifi_stop failed: %d",(int)stopErr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
else{
|
||||||
else{
|
LOG_DEBUG(GwLog::ERROR,"GwWifi: mutex timeout in loop (stop)");
|
||||||
LOG_DEBUG(GwLog::ERROR,"GwWifi: mutex timeout in loop (stop)");
|
|
||||||
}
|
|
||||||
|
|
||||||
delay(100);
|
|
||||||
|
|
||||||
if (acquireMutex()){
|
|
||||||
esp_err_t startErr=esp_wifi_start();
|
|
||||||
releaseMutex();
|
|
||||||
if (startErr != ESP_OK){
|
|
||||||
LOG_DEBUG(GwLog::ERROR,"GwWifi: esp_wifi_start failed: %d",(int)startErr);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
delay(100);
|
||||||
|
|
||||||
|
if (acquireMutex()){
|
||||||
|
esp_err_t startErr=esp_wifi_start();
|
||||||
|
releaseMutex();
|
||||||
|
if (startErr != ESP_OK){
|
||||||
|
LOG_DEBUG(GwLog::ERROR,"GwWifi: esp_wifi_start failed: %d",(int)startErr);
|
||||||
|
}
|
||||||
|
connectInternal();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
LOG_DEBUG(GwLog::ERROR,"GwWifi: mutex timeout in loop (start)");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
connectInternal();
|
connectInternal();
|
||||||
}
|
}
|
||||||
else{
|
|
||||||
LOG_DEBUG(GwLog::ERROR,"GwWifi: mutex timeout in loop (start)");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
|||||||
Reference in New Issue
Block a user