Progress Log: WiFi AP Mode Web Interface (v1.8.0)¶
Task Description¶
Created a simple HTML web server interface for OSECHI that allows users to confirm successful connection to the ESP32 when operating in Access Point(AP)mode. Users can now connect to the WiFi SSID OSECHI-DETECTOR and access http://192.168.4.1 to see a connection status page.
Requirements:
- Simple, responsive HTML page
- Display connection confirmation
- Minimal memory footprint
- Non-blocking HTTP server
- Integration with existing WiFi manager
Outcome¶
✅ Successfully completed
Created Files¶
- include/web_server.h - Public API for web server
web_server_init()- Initialize HTTP server-
web_server_update()- Handle incoming requests -
src/web_server.cpp - Full implementation
- Embedded HTML page (~3KB)
- HTTP/1.1 server on port 80
- Non-blocking request handler
- Simple routing: GET / (main page), GET /status (redirect)
-
Proper HTTP response headers
-
src/main.cpp - Integration
- Added
#include "web_server.h" web_server_init()called insetup()after WiFi stabilization-
web_server_update()called inloop()for request processing -
docs/wifi-ap-interface.md - User documentation
- Setup instructions
- Feature overview
- Troubleshooting guide
- Security notes
HTML Page Features¶
- Responsive Design - Works on desktop, tablet, and mobile
- Visual Feedback - Gradient background, pulsing success icon
- Bilingual Support - Japanese labels(OSECHI、宇宙線検出器)
- Device Information - Shows SSID, IP address, protocol
- Interactive Buttons - Refresh page, navigate to status
- Modern CSS - Flexbox layout, smooth animations
Integration¶
- Controlled via
-DENABLE_WIFI=1compile flag - Non-blocking: <5ms per request handling in loop
- Safe: Gracefully handles missing WiFi hardware
- Memory efficient: HTML embedded in binary (no SD card needed)
Learnings¶
- WiFiServer class usage - ESP32's native WiFiServer is simple and reliable for AP mode
- Raw HTML embedding - Using C raw string literals (R"rawliteral(...)") is clean and maintainable
- HTTP state machine - Non-blocking request handling requires proper client lifecycle management
- AP mode benefits - Default 192.168.4.1 IP is standard ESP32 behavior, makes documentation simple
Next Steps¶
Optional enhancements for future versions:
- Add real-time sensor data display(JSONL over WebSocket)
- Implement WiFi configuration portal(SSID/password change UI)
- Add system logs page
- HTTPS support for production deployments
- REST API endpoints for telemetry data