example

Example of the component espp/wifi v1.0.30
# WiFi Example

This example shows the use of the `espp::WifiSta` for connecting to existing
wifi networks, and the `espp::WifiAp` for creating a wifi access point, both of
which are provided by the `wifi` component.

It also demonstrates how to use the `espp::Wifi` singleton class to manage both
station and access point modes simultaneously.

Finally, it provides a simple example of how to use the `espp::WifiStaMenu` and
`espp::WifiApMenu` classes to configure wifi settings via the interactive CLI at
runtime.

## How to use example

### Configure the project

```
idf.py menuconfig
```

Since this example tests the `espp::WifiSta` which acts as a station and
connects to a pre-existing WiFi network, you should configure the wifi network
you want to connect to.

### Build and Flash

Build the project and flash it to the board, then run monitor tool to view serial output:

```
idf.py -p PORT flash monitor
```

(Replace PORT with the name of the serial port to use.)

(To exit the serial monitor, type ``Ctrl-]``.)

See the Getting Started Guide for full steps to configure and use ESP-IDF to build projects.

### Example Output

<img width="1885" height="4148" alt="CleanShot 2025-10-25 at 23 48 55" src="https://github.com/user-attachments/assets/86b791b6-6dd4-4c4a-985c-7050413c8680" />

To create a project from this example, run:

idf.py create-project-from-example "espp/wifi=1.0.30:example"

or download archive (~4.93 KB)