A simple yet effective Wi-Fi and Bluetooth Low Energy (BLE) scanner for the ESP32-C3 microcontroller. This project periodically scans for nearby wireless devices and displays a formatted, sorted list of Wi-Fi networks and discovered BLE devices in the Serial Monitor.
- Dual-mode Scanning: Scans for both Wi-Fi networks and BLE devices in each cycle.
- Detailed Wi-Fi Information: For each network, it displays:
- SSID
- RSSI (in dBm)
- A visual signal strength bar
- Encryption type (WPA2, WPA3, Open, etc.)
- BLE Device Discovery: Detects nearby BLE advertising devices and prints their MAC address and RSSI.
- Sorted & Formatted Output: Wi-Fi networks are sorted alphabetically by SSID for easy reading. The serial output is cleared on each scan cycle for a clean, real-time display using ANSI escape codes.
- Efficient BLE Scanning: Utilizes the
NimBLE-Arduinolibrary, which is optimized for performance and low memory usage on ESP32. - Status Indicator: Blinks the onboard LED during each scan cycle.
- An ESP32-C3 based development board (e.g., ESP32-C3 Super Mini, DevKitM-1).
- PlatformIO or Arduino IDE
- ESP32 Board Package for the Arduino framework.
- NimBLE-Arduino library.
The NimBLE-Arduino library will be installed automatically if you use the provided platformio.ini file.
- Go to Sketch -> Include Library -> Manage Libraries...
- Search for "NimBLE-Arduino" and install it.
- Clone this repository or download the source code.
- Open the project in your preferred IDE (PlatformIO is recommended).
- If using the Arduino IDE, ensure you have installed the required library (see above).
- Connect your ESP32-C3 board to your computer.
- Compile and upload the firmware.
- Open the Serial Monitor and set the baud rate to 115200 to see the scan results.
The output in the Serial Monitor will look similar to this:
WiFi Networks Scanner
===================
MyHomeNetwork-5G [################....] -52 dBm WPA2/WPA3-PSK
NeighborNet [#######.............] -81 dBm WPA2-PSK
SomeOtherWiFi [#############.......] -65 dBm WPA2-PSK
XFINITY [##########..........] -72 dBm Open
Scanning BLE...
BLE: 3c:61:05:12:34:56, RSSI: -78
BLE: f4:12:fa:78:90:ab, RSSI: -91
Scanning WiFi...
The built-in LED pin is defined at the top of src/main.cpp. You can change it to match your board's specific configuration if needed.
#define LED_PIN 8 // Standard pin for ESP32-C3 Super mini