A minimalist firmware solution for the ESP8266. It transforms an ESP8266 into a functional WiFi Repeater featuring a Captive Portal, NAT/NAPT routing, and Smart DNS Proxy, with a focus on memory efficiency and stable performance.
- Networking:
- NAT/NAPT: IP forwarding using LwIP v2.
- DNS Proxy: Intercepts DNS queries for portal redirection.
- Dual Mode: Connects to upstream WiFi while serving as an Access Point.
- Access Control:
- Vouchers: Authentication using simple codes.
- MAC Binding: Optional MAC address validation for sessions.
- Auto-Cleanup: Automatically removes expired sessions.
- Interfaces:
- Captive Portal: Web-based login page for clients.
- Admin Panel: Lightweight dashboard for monitoring and network configuration.
- 🛠️ Technical Excellence:
- Embedded-Safe Memory Policy: No STL and no manual
malloc/new; fixed-size buffers on core runtime paths.Stringusage is limited to AsyncWebServer request boundary handling. - Persistent Storage: Robust configuration management using LittleFS with reliable factory default fallback.
- OTA Updates: Over-The-Air firmware upgrade support for easy maintenance.
- Hardware Integrity: 5-second long-press hardware factory reset capability.
- Embedded-Safe Memory Policy: No STL and no manual
The codebase is modularized for maximum maintainability and clarity:
graph TD
A[mini_router.ino<br>Main Loop & Hardware] --> B(wifi_manager<br>STA/AP & NAT)
A --> C(session_manager<br>Auth & MAC Tracker)
A --> D(captive_portal<br>DNS Proxy & Web Server)
A --> E(admin_panel<br>Dashboard & OTA)
A --> F[(config_storage<br>LittleFS)]
B -.-> |NAPT Routing| INTERNET
D -.-> |Spoof DNS| CLIENTS
E -.-> |Save/Load| F
mini_router.ino: Main entry point, core logic loops, and hardware interaction.wifi_manager: AP/STA initialization and NAPT/NAT configuration.session_manager: Authentication logic, session tracking, and MAC validation.captive_portal: DNS spoofing and premium web server implementation.admin_panel: Professional management interface for configuration and monitoring.config_storage: Filesystem interaction (LittleFS) for persistent data.
- Hardware: ESP8266 board (NodeMCU, Wemos D1 Mini, or similar).
- Core Dependencies:
ESPAsyncWebServerESPAsyncTCPLittleFS(built-in to modern ESP8266 cores).
To enable NAT/NAPT functionality, you MUST select these settings before compiling:
- Tools -> lwIP Variant -> v2 Higher Bandwidth
- Tools -> Flash Size -> (Choose a size with at least 64KB LittleFS allocation).
- Arduino IDE: Go to Sketch -> Export Compiled Binary. The
.binfile will be generated in your project folder. - PlatformIO: Run the Build task. The file will be located at
.pio/build/<env_name>/firmware.bin.
- Flash Firmware: Upload the code with the correct LwIP variant settings.
- Initial Connection: Connect your device to the SSID "MiniRouter_AP" (Default Password:
12345678). - Captive Portal: Your device will automatically redirect to the login page. Enter an active voucher code.
- Admin Dashboard: Access the management panel at
http://192.168.4.1/admin.- Username:
admin - Default Password:
admin
- Username:
- Reset: Long-press the Flash (or dedicated) button for 5 seconds to wipe settings and restore defaults.
- Networking Engine: LwIP v2 (Higher Bandwidth variant).
- DNS Protocol: Proxy/Interceptor on UDP Port 53.
- Data Persistence: LittleFS Binary Storage.
- Frontend: PROGMEM-resident compressed HTML/CSS/JS.
- Memory Integrity: Static fixed-array session slot allocation.
- Concurrent Sessions: Limited to 5 sessions to maintain stability and avoid memory crashes.
- HTTPS Redirection: Automatic portal detection works best on HTTP. HTTPS traffic redirection is limited by browser security/HSTS.
- Hardware Performance: Single-core CPU (80MHz/160MHz) and single radio mean limited throughput for heavy streaming.
- Throughput: Shared WiFi radio bandwidth between AP and STA mode (50% theoretical max).
- Software NAT: All routing is handled by software (LwIP), which increases CPU load during high traffic.
This project is licensed under the MIT License. Contributions are highly welcome! Feel free to submit Pull Requests or open issues for bug reports and feature requests.
Authored by Dedi Nopriadi. 🚀


