Skip to content

WIFI Access Point mode#9

Open
JiLiZART wants to merge 3 commits into
appositeit:masterfrom
JiLiZART:feat-ap-mode
Open

WIFI Access Point mode#9
JiLiZART wants to merge 3 commits into
appositeit:masterfrom
JiLiZART:feat-ap-mode

Conversation

@JiLiZART

Copy link
Copy Markdown

WiFi Access Point mode with captive portal

Adds an optional Access Point (AP) mode so the ESP32 broadcasts its own WiFi network instead of joining an
existing one — no router needed, ideal for field use. When a device joins, a captive portal auto-opens the
battery interface.

What changed

  • New ENABLE_WIFI_POINT build flag — when set, the firmware runs softAP instead of station mode. All AP code is
    wrapped in #ifdef ENABLE_WIFI_POINT; the default esp32c3_web (station) path is unchanged.
  • Fixed AP address — gateway 4.4.4.4 + mDNS obi.local, both serving the existing web UI.
  • Captive portal — a DNSServer resolves all hostnames to 4.4.4.4, and OS connectivity probes
    (Apple/Android/Windows) get a 302 redirect, triggering the auto-open popup.
  • New PlatformIO envs — esp32c3_ap (USB flash) and esp32c3_ap_ota (OTA over 4.4.4.4).
  • Credentials — AP_SSID / AP_PASS added to secrets.h / secrets.h.example (default OBI-ESP32 / obi12345; WPA2
    needs ≥8 chars).
  • Docs — README gains an "Access Point Mode" usage section with flash + OTA examples and a feature bullet.

Usage

  pio run -e esp32c3_ap -t upload        # flash AP firmware via USB
  pio run -e esp32c3_ap_ota -t upload    # wireless update over the AP

Join OBI-ESP32 → interface opens via captive portal, or browse http://4.4.4.4 / http://obi.local.

@Mozzie-AU

Copy link
Copy Markdown

Your patch is quite similar to the one I wrote recently. Mine allows for connecting to a range of wi-fi networks and falls back to a hotspot if none are found. I noticed that the op hasn't been working on this recently though. I like your mdns code and I will add it to my own fork.

Moz

@JiLiZART

JiLiZART commented Jun 25, 2026

Copy link
Copy Markdown
Author

Yep, but this patch enable operational as Captive Portal, so if you connect to access point it automaticly display web ui (like many wifi routers do).
Really strange to hardcode a wifi creds, cause you can use this tool widely in plenty places, so why you need hardcode WIFI creds for each of them (like list of them) instead of just connect to AP. Just behave like many IoT devices, that provides AP to communicate with device

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants