Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added docs/gifs/wifi_scanner.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions examples/wifi_scanner/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.pio
.vscode/.browse.c_cpp.db*
.vscode/c_cpp_properties.json
.vscode/launch.json
.vscode/ipch
.config
38 changes: 38 additions & 0 deletions examples/wifi_scanner/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# WiFi Scanner App
This is a WiFi scanner app for the device32 (ESP32-based board with OLED display). It scans and displays nearby WiFi access points with their details.

## Requirements
- device32 hardware
- PlatformIO development environment
- USB connection for flashing

## Configuration
Edit the constants in `src/config.h` to customize pin assignments if needed:

- **OLED Display Pins**:
```cpp
#define OLED_SDA 21
#define OLED_SCL 22
#define OLED_RST -1
#define OLED_ADDR 0x3C
```

- **Button Pin**:
```cpp
#define BUTTON_PIN 0
```

## Setup
1. Open this folder (`examples/wifi_scanner/`) in VSCode with PlatformIO installed.
2. Connect your device32 via USB.
3. Use PlatformIO to build and upload the project (`pio run --target upload`).

## Usage
- Power on the device—it will scan for nearby WiFi access points and display them.
- The display shows a list of access points with their SSIDs.
- Use the button for navigation:
- **Short press**: Move to next item in list or next detail field.
- **Long press**: Enter detail view for selected AP or return to list.
- In list view, select "Rescan" at the bottom to refresh the AP list (shows "Scanning.." during scan).
- In detail view, navigate through fields: SSID, BSSID, RSSI, Channel, Encryption.
- Long SSIDs/BSSIDs scroll horizontally when selected.
5 changes: 5 additions & 0 deletions examples/wifi_scanner/partitions.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Name, Type, SubType, Offset, Size
nvs, data, nvs, 0x9000, 0x5000
otadata, data, ota, 0xe000, 0x2000
ota_0, app, ota_0, 0x10000, 0x1C0000
ota_1, app, ota_1, 0x1D0000, 0x1C0000
12 changes: 12 additions & 0 deletions examples/wifi_scanner/platformio.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[env:seeed_xiao_esp32c3]
platform = espressif32 @6.12.0
board = seeed_xiao_esp32c3
framework = arduino
monitor_speed = 115200
board_build.partitions = partitions.csv

lib_archive = no
lib_deps =
adafruit/Adafruit SSD1306@^2.5.7
adafruit/Adafruit GFX Library@^1.11.3
bblanchon/ArduinoJson@^7.0.3
15 changes: 15 additions & 0 deletions examples/wifi_scanner/src/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
#define OLED_SDA_PIN 7 // D5
#define OLED_SCL_PIN 6 // D4

// button config
#define BUTTON_PIN 5 // D3
#define BUTTON_TAP_TIME 20

// NTP server
#define NTP_SERVER "pool.ntp.org"

// globals
#include <Adafruit_SSD1306.h>
extern Adafruit_SSD1306 display;
Loading