A reusable, responsive captive portal framework for ESP32 built with:
- Web interface using LittleFS
- Login system with session tracking
- Change admin password via web UI
- Factory Reset and Reboot functionality (GPIO controlled)
- Mobile-friendly styling
- Modular components:
PageRenderer
,CPHandlers
,CaptivePortal
src/main.cpp
→ project entrypointlib/
→ contains all components as modular codelib/Config/Config.h
→ contains the portal configuration.data/
→ contains HTML files (upload viapio run --target uploadfs
)platformio.ini
→ PlatformIO configuration
- git clone https://github.com/hansaplasst/ESP32-Captive-Portal-framework.git
- Configure project settings in:
/lib/Config/Config.h
- Configure
BAUDRATE
andDEBUG_LEVEL
in:platformio.ini
- Modify and/or upload
/data/*
files using:pio run --target uploadfs
- Flash firmware via PlatformIO or via
pio run
- Open your phone's network settings and connect to
DeviceHostname
- Open serial monitor to see debug logs
- By default GPIO 4 acts as a reset button
- Press it shortly to reboot the ESP32
- To trigger a factory default reset. Hold it (for 10s) until the device led flashes quickly twice then release.
- You can also reboot or reset via the System tab in the Captive Portal web UI
- ESPResetUtil
- ArduinoJson
- LittleFS
- ESP32 Arduino Framework