# ESP32 WiFi Config Component
This ESP-IDF component implements a captive portal to configure WiFi credentials via a web form.
## Features
- SoftAP and HTTP server setup
- Scan and display nearby WiFi networks (optional)
- Store credentials in NVS
- Auto-reconnect on disconnection
## Usage
In your `main.c`:
```c
wifi_config_init("MyDevice", NULL, on_wifi_ready);
```
## Routes
- `GET /` – Serve HTML form
- `POST /settings` – Handle SSID/password input
## Integration
```cmake
idf_component_register(
SRCS "src/wifi_config.c" "src/form_urlencoded.c"
INCLUDE_DIRS "include"
EMBED_FILES "resources/index.html"
)
```
Place `index.html` in the `resources/` folder.
idf.py add-dependency "achimpieters/esp32-captive_portal^0.0.1"