Skip to content

Add captive portal detection for iOS, Android, and Windows#152

Open
miqcie wants to merge 1 commit intoktomy:mainfrom
miqcie:upstream/captive-portal
Open

Add captive portal detection for iOS, Android, and Windows#152
miqcie wants to merge 1 commit intoktomy:mainfrom
miqcie:upstream/captive-portal

Conversation

@miqcie
Copy link
Copy Markdown

@miqcie miqcie commented Apr 1, 2026

Summary

Follows up on PR #143 — this is a focused PR with just the captive portal detection, as requested.

When the clock is in AP mode, most devices probe specific URLs to detect captive portals. Without these endpoints, users have to manually navigate to the clock's IP to configure it. This PR adds three lightweight handlers so the settings page opens automatically:

  • Android/generate_204 redirects to /
  • Windows/connecttest.txt redirects to /
  • iOSdata/hotspot-detect.html meta-refreshes to /

No changes to the existing settings UI or configuration flow. Just redirect plumbing that improves the first-time setup experience in AP mode.

Changes

  • src/ServerManager.cpp — two route handlers (6 lines)
  • data/hotspot-detect.html — minimal HTML file for iOS detection (4 lines)

Test plan

  • Builds cleanly (pio run)
  • Connect iOS device to clock AP — should auto-open settings page
  • Connect Android device to clock AP — should auto-open settings page
  • Connect Windows laptop to clock AP — should auto-open settings page
  • Normal STA-mode operation unaffected

When the clock is in AP mode, connecting devices now auto-detect
the captive portal and prompt users to open the settings page:
- Android: /generate_204 redirect
- Windows: /connecttest.txt redirect
- iOS: /hotspot-detect.html meta-refresh

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

1 participant