Skip to content

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.)
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

### Why does ESP32 miss 5 GHz networks?

ESP32 hardware only supports 2.4 GHz Wi-Fi. 5 GHz networks will never appear in scan results. Use an ESP32-S3 variant for dual-band support.

How long does a Wi-Fi scan take?

A full scan takes 3-5 seconds. Use async mode: WiFi.scanNetworks(true) then WiFi.scanComplete() to check progress.

Can I scan while connected to an AP?

Yes, but the connection may briefly pause during scans. The ESP32 switches channels during scanning.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro