ESP32 Networking Field Notes
Understand embedded Wi-Fi scanning, scan-result interpretation, power constraints and safe experimentation.
Educational reference drafted for the Nullwire archive. This is not a claim of completed training or original research; verify examples and customise before presenting it as finished work.
Objective
Understand how an ESP32 can observe nearby Wi-Fi access point advertisements in a lab, and how to interpret those observations responsibly.
What a scan tells you
A Wi-Fi scan can enumerate visible network names (SSIDs), channels, signal strength, and supported security information. This is not proof of a network’s ownership, reachability or vulnerability.
Signals fluctuate with distance, antenna orientation, physical obstacles and interference. A hidden SSID is not equivalent to an invisible network.
Example using Arduino WiFi APIs
#include <WiFi.h>
void setup() {
Serial.begin(115200);
WiFi.mode(WIFI_STA);
WiFi.disconnect();
delay(100);
}
void loop() {
int count = WiFi.scanNetworks();
Serial.printf("Visible networks: %d\n", count);
for (int i = 0; i < count; ++i) {
Serial.printf("Channel %d | RSSI %d dBm\n",
WiFi.channel(i), WiFi.RSSI(i));
}
WiFi.scanDelete();
delay(15000);
}
The snippet demonstrates local observation and deliberately avoids printing identifiable network names. Arduino core API details can vary by board and installed version; verify them against your setup before uploading.
Engineering considerations
- Scanning consumes power and can interfere with other Wi-Fi operations on the device.
- The ESP32 family’s capabilities vary by model.
- Serial output is useful for prototyping; structured output is easier for later analysis.
- Be careful about collecting or publishing BSSIDs, SSIDs and location-linked scans.
Controlled exercise
Scan only in an environment where you are permitted to test. Compare channel occupancy and RSSI at two positions. Note what cannot be concluded from these samples.
Next steps
A useful extension is a local-only dashboard that visualises scan summaries over time while keeping raw observations private.
Related: TCP/IP: Following a Packet.