Skip to content

WiFi AP Mode Interface

Work in Progress

WiFi AP mode is functional and builds successfully with ENABLE_WIFI=1, but the web interface is still under active development. The HTTP status page works; advanced features (sensor data, configuration UI) are not yet implemented. See Planned Features for the roadmap.

Overview

When the ESP32 is running in AP mode, you can connect from a browser at http://192.168.4.1 to verify the device connection and view a status page.

Setup

1. Connect to WiFi

When the device boots in AP mode:

Item Value
SSID OSECHI-DETECTOR
Password osechi2025
IP Address 192.168.4.1
Port 80 (HTTP)

2. Open in Browser

After connecting, enter the following URL:

http://192.168.4.1

3. Status Page

The page displays:

  • Connection status: Connected
  • WiFi SSID: OSECHI-DETECTOR
  • AP address: 192.168.4.1
  • Protocol: HTTP

Features

Buttons

  • Refresh — Reload the page to check connection status
  • Status — Link to the status information page

Build Configuration

WiFi support is disabled by default. Enable it via the ENABLE_WIFI build flag.

With Task

task v2:build   # default: ENABLE_WIFI=0

To enable WiFi, add the flag in platformio.override.ini:

[env:esp32dev-v2]
build_flags =
    -D ENABLE_WIFI=1

With uv

uv run platformio run -e esp32dev-v2

Implementation Details

File Structure

include/
  └── web_server.h       # Web server header

src/
  ├── web_server.cpp     # Web server implementation
  └── main.cpp           # Init and update integration

Initialization Flow

  1. Call wifi_init() in setup() — starts AP mode
  2. Wait 500 ms, then call web_server_init() — starts HTTP server
  3. Call web_server_update() in loop() — handles incoming requests

HTTP Routes

Request Response
GET / 200 — Connection confirmation page
GET /status 302 redirect → /
Any other 404 Not Found

Technical Specifications

Memory Usage

  • Embedded HTML: ~3 KB
  • Web server buffer: ~1 KB
  • WiFi stack: included in existing WiFi module

Response Times

  • Page load: 100–200 ms
  • Refresh button: 50–100 ms

Supported Browsers

  • Chrome / Chromium
  • Safari
  • Firefox
  • Edge
  • Mobile browsers (iOS Safari, Android Chrome)

Troubleshooting

Page Not Displaying

  1. Check the serial monitor for [WiFi] AP Started
  2. Verify the OSECHI-DETECTOR SSID is visible on your device
  3. Clear browser cache and retry

Connection Drops Immediately

  1. Check the serial monitor for connection logs:

    task monitor
    
  2. Check for 5 GHz band interference

Security Notes

  1. Default password — The AP password osechi2025 can be changed in wifi_manager.cpp. Use a strong password in production.
  2. HTTP only — Traffic is not encrypted. Use in development environments only.
  3. Local network only — AP mode is accessible only within the 192.168.4.0/24 network. No internet access.

Planned Features

  • Real-time sensor data display
  • WiFi configuration page (SSID / password)
  • Device log viewer
  • HTTPS support