WiFi scanner with ESP32

Use an ESP32 to get the best performance with your WiFi router.

For the best performance with your WiFi router, you should choose a wireless channel less used by any of your neighbors. Many routers use the same channel by default–e.g., 6–and unless you know to test for and change the Wi-Fi channel when you first install your router, you’re probably using the same channel as someone else nearby. In other words, decreased performance.

Here the script for the ESP32 to scan your neighborhood WiFi access points.

Here an example output from my neighborhood:

scan start
15 networks found
1: robnet2 (-54) [13] WPA2_PSK
2: woodfamily2 (-85) [2] WPA2_PSK
3: VGV7519DFC699 (-85) [6] WPA_WPA2_PSK
4: woodfamilyGuest (-86) [2] WPA2_PSK
5: FRITZ!Box 7581 MO (-87) [6] WPA2_PSK
6: Ziggo beneden (-89) [1] WPA2_PSK
7: Infinity (-89) [6] WPA_WPA2_PSK
8: Ziggo (-91) [1] WPA2_ENTERPRISE
9: Ziggo (-91) [11] WPA2_ENTERPRISE
10: Ziggo (-92) [1] WPA2_ENTERPRISE
11: Infinity (-92) [11] WPA2_PSK
12: FBI surveillance van (-93) [6] WPA_WPA2_PSK
13: Ziggo39330 (-94) [1] WPA2_PSK
14: Eightball’s network (-94) [6] WPA2_PSK
15: DIRECT-8E-HP ENVY 4520 series (-96) [6] WPA2_PSK
scan done

Change the Wi-Fi Channel on Your Router

Once you know the wireless channel that’s least congested near you, head to your router’s administration page by typing in its IP address in the browser address bar. Depending on your router, this will likely be something like 192.168.2.1, 192.168.1.1, or 10.0.0.1 (check your router manual or the bottom of your router for details).

Head to your router’s wireless settings to change the Wi-Fi channel and hit apply for it to take effect.

ESP32 HW-607

See also my other page using the ESP8266 / Wemos D1 Mini as WiFi scanner

2 thoughts on “WiFi scanner with ESP32”

  1. Hi, I tried your code hoping to scan all MAC addresses from surrounding WiFi access points.

    I always get the error :

    Using library WiFi at version 1.0 in folder: C:\Users\test\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.0\libraries\WiFi
    exit status 1
    enumeration value ‘WIFI_AUTH_MAX’ not handled in switch [-Werror=switch]

    Please help to fix this error.

    Thanks.

    Wim

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.