Skip to content

Use temporary Wi-Fi provisioning mode - #3

Merged
lsongdev merged 21 commits into
mainfrom
feature/wifi-provisioning-mode
Sep 29, 2026
Merged

lsongdev merged 21 commits into
mainfrom
feature/wifi-provisioning-mode

Conversation

@lsongdev

@lsongdev lsongdev commented Sep 29, 2026 •

Copy link
Copy Markdown
Owner

Summary

Change Wi-Fi from an always-on AP+STA model to an explicit provisioning lifecycle.

Normal operation

  • boot in STA mode
  • if saved credentials exist, start connecting immediately without blocking the rest of firmware startup
  • give the saved network a 30-second startup recovery window
  • remain STA-only after a successful connection
  • transient runtime disconnects rely on STA auto-reconnect and do not open an AP

Setup / recovery

  • start the setup AP when no credentials exist
  • fall back to setup if the saved network is still unavailable after the startup window
  • triple-click the printer button to request setup at any time
  • saved-credential setup windows expire after five minutes
  • first-boot setup remains available until configured
  • use captive DNS only while setup is active
  • after successful provisioning, return the HTTP response first and close the AP shortly afterward
  • pause the setup timeout while a Wi-Fi connection attempt is in progress

Setup interface

While setup mode is active:

  • Wi-Fi scan/connect/forget APIs are enabled
  • the embedded Web UI can still print through HTTP
  • raw TCP :9100 printing remains available through the temporary AP

Wi-Fi configuration APIs remain setup-only, while printing is available in both setup and normal STA operation.

Button cleanup

  • replace the printer-local button state machine with lsongdev/kbutton.c
  • preserve the original 40 ms debounce, 300 ms click window, and 1 s long-press timing
  • double click: test page
  • triple click: Wi-Fi setup
  • long press/release: paper feed start/stop
  • remove hal/em_button.* and its duplicated state-machine tests

The kbutton dependency is pinned to commit f0665ecca96674aa7ee033407734f0f76b386a40.

@lsongdev
lsongdev merged commit 5e68a50 into main Sep 29, 2026
2 checks passed
@lsongdev
lsongdev deleted the feature/wifi-provisioning-mode branch September 29, 2026 13:17
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