wifi_scan

Example of the component cleishm/idfxx_wifi v3.0.0
# Wi-Fi Scan

Scans for nearby Wi-Fi access points and lists them.

## What it demonstrates

- Creating the default event loop with `idfxx::event_loop::create_system()`, initializing the network stack
  with `idfxx::netif::init()`, and creating the station interface with `idfxx::wifi::make_sta_netif()`
- Starting Wi-Fi in station mode with `idfxx::wifi::init()`, `set_roles()` and `start()`
- Running a blocking scan with `idfxx::wifi::scan()`, and printing each access point's SSID, channel, signal
  strength and security mode
- Shutting Wi-Fi down with `idfxx::wifi::stop()` and `deinit()`

The example uses the exception-based API (`CONFIG_COMPILER_CXX_EXCEPTIONS=y` in `sdkconfig.defaults`).

## Hardware required

- Any ESP32-series development board with Wi-Fi

The ESP32-H2 has no Wi-Fi, so it can't run this example.

## How to use

Create a project from this example:

```bash
idf.py create-project-from-example "cleishm/idfxx_wifi:wifi_scan"
cd wifi_scan
```

Then build and flash it, then watch the serial output:

```bash
idf.py set-target esp32
idf.py -p PORT flash monitor
```

Replace `esp32` with your target and `PORT` with your board's serial port. Press `Ctrl-]` to exit the monitor.

To create a project from this example, run:

idf.py create-project-from-example "cleishm/idfxx_wifi=3.0.0:wifi_scan"

or download archive (~2.11 KB)