ESP32 Wi-Fi Scan Returns No Networks
DodaTech
Updated 2026-06-26
1 min read
In this tutorial, you'll learn about ESP32 Wi. We cover key concepts, practical examples, and best practices.
The Problem
ESP32 scans for Wi-Fi networks but returns 0 results or misses nearby access points.
Quick Fix
Wrong
int n = WiFi.scanNetworks();
if (n == 0) Serial.println("No networks found");
No networks found
(But your phone shows 5 networks in the same location.)
Right
WiFi.mode(WIFI_STA);
WiFi.disconnect();
delay(100);
int n = WiFi.scanNetworks();
Serial.printf("Found %d networks
", n);
for (int i = 0; i < n; i++) {
Serial.printf("%s (%d dBm) %s
",
WiFi.SSID(i).c_str(), WiFi.RSSI(i),
WiFi.encryptionType(i) == WIFI_AUTH_OPEN ? "OPEN" : "SECURE");
}
Found 7 networks:
MyNetwork (-42 dBm) SECURE
GuestNet (-58 dBm) OPEN
Office_5G (-63 dBm) SECURE
Prevention
Call WiFi.mode(WIFI_STA) and WiFi.disconnect() before scanning. Set scan time with WiFi.scanNetworks(true) for async mode. Parse encryption types to identify open networks. Run scans in a loop for fresh results. Remember ESP32 only detects 2.4 GHz networks.
DodaTech engineers apply these same patterns when building Doda Browser's networking stack, DodaZIP's firmware packaging pipeline, and Durga Antivirus Pro's sensor communication layer.
FAQ
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro