From 2910addb8ae3719f357728b46107337bbc84c759 Mon Sep 17 00:00:00 2001 From: Just Call Me Koko Date: Mon, 8 Dec 2025 16:32:25 -0500 Subject: [PATCH] Ensure async wardrive --- esp32_marauder/WiFiScan.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/esp32_marauder/WiFiScan.cpp b/esp32_marauder/WiFiScan.cpp index 73de77f..a2f49ca 100644 --- a/esp32_marauder/WiFiScan.cpp +++ b/esp32_marauder/WiFiScan.cpp @@ -2499,6 +2499,7 @@ void WiFiScan::StopScan(uint8_t scan_mode) #endif this->shutdownBLE(); + this->ble_scanning = false; #endif } @@ -4426,7 +4427,12 @@ void WiFiScan::executeWarDrive() { return; } else if (scan_status == WIFI_SCAN_FAILED) { - Serial.println("WiFi scan failed to start"); + Serial.println("WiFi scan failed to start. Restarting..."); + this->wifi_initialized = true; + this->shutdownWiFi(); + this->startWardriverWiFi(); + this->wifi_initialized = true; + delay(100); } /*#ifndef HAS_DUAL_BAND @@ -4507,15 +4513,15 @@ void WiFiScan::executeWarDrive() { buffer_obj.append(wardrive_line); } } + + // Free up that memory, you sexy devil + WiFi.scanDelete(); } /*#ifndef HAS_DUAL_BAND this->channelHop(); #endif*/ - // Free up that memory, you sexy devil - WiFi.scanDelete(); - if (!this->ble_scanning) WiFi.scanNetworks(true, true, false, 80); }