How wolfofnox/esp32-captive-wifi-manager works
The product is an ESP-IDF component that manages ESP32 WiFi connectivity and provides a captive-portal setup experience. Its main workflow initializes the manager, attempts saved-network operation, and can fall back to an AP portal for scanning and configuration; credentials and network options persist in NVS. HTTP runtime handlers expose status, configuration, and file serving, with optional WebSocket/RAP, SD-card, mDNS, and LED capabilities. Some internal call sites were not excerpted, so inferred subsystem links are marked dashed and uncited.
Main entry points: Wifi.c WiFi manager · Captive.c Captive portal · Runtime-handlers.c Runtime HTTP handlers · Server-mgr.c HTTP server manager
Components 17
WiFi connectivity
- WiFi manager
src/Wifi.c - Station mode
src/STA.c - Access point mode
src/AP.c
Portal and API
- Captive portal
src/Captive.c - Captive DNS
priv_include/dns_server/dns_server.c - HTTP server manager
src/Server-mgr.c - Runtime HTTP handlers
src/Runtime-handlers.c - Common handlers
src/Common-handlers.c - WebSocket RAP
src/ws_server.c
Configuration and state
- Credential persistence
src/nvs-mgr.c - Mode and event flags
src/Flags.c
Optional integrations
- SD card mount
src/SD-mgr.c - SD file serving
src/Runtime-handlers.c - Status LED
priv_include/wifi_led.h - mDNS discovery
src/Captive.c
Other components
- ESP-IDF application
- ESP32 device
Connections 19
- ESP-IDF application → WiFi manager: initializes
- WiFi manager → Station mode: selects mode
- WiFi manager → Access point mode: selects mode
- WiFi manager → Credential persistence: loads settings
- WiFi manager → HTTP server manager: starts server
- WiFi manager → Status LED: initializes
src/Wifi.c - WiFi manager → SD card mount: mounts card
- WiFi manager → Mode and event flags: tracks events
- Captive portal → Captive DNS: stops server
src/Captive.c - Runtime HTTP handlers → HTTP server manager: registers errors
src/Runtime-handlers.c - Runtime HTTP handlers → Common handlers: registers handlers
src/Runtime-handlers.c - Runtime HTTP handlers → Captive portal: registers portal routes
src/Runtime-handlers.c - Runtime HTTP handlers → SD file serving: serves files
src/Runtime-handlers.c - SD file serving → SD card mount: reads mounted files
src/Runtime-handlers.c - Captive portal → Credential persistence: persists settings
- Captive portal → Mode and event flags: requests mode changes
- WiFi manager → WebSocket RAP: enables messaging
- Captive portal → mDNS discovery: configures discovery
src/Captive.c - ESP32 device → WiFi manager: provides network