fix(provisioning): drop the 2-minute QR display delay
The 15s FIRST_IMAGE_POLL_INTERVAL_MS bootstrap already keeps the QR on
the panel (204 responses don't trigger a redraw) until the user claims
via /setup/{mac} and the server's bootstrap-bypass serves an image. The
hard-coded delay(120000) was just dead time between WiFi save and the
first poll — observed in the field as ~110s of nothing happening after
login.
Also touches operation.h header comments to match the "hold until the
screen flashes" terminology and document the short-press fast-poll
gesture.
This commit is contained in:
+4
-2
@@ -261,8 +261,10 @@ void loop() {
|
|||||||
|
|
||||||
g_provisioning = false;
|
g_provisioning = false;
|
||||||
|
|
||||||
// Give user time to scan the QR, then start normal operation
|
// Go straight into the polling loop. The 15s FIRST_IMAGE_POLL_INTERVAL_MS
|
||||||
delay(120000); // 2 minutes
|
// bootstrap keeps the QR painted (204s don't redraw the panel) until
|
||||||
|
// the user claims via /setup/{mac} and the server's bootstrap-bypass
|
||||||
|
// serves an image — no need for an artificial display delay here.
|
||||||
normal_operation(mac);
|
normal_operation(mac);
|
||||||
} else {
|
} else {
|
||||||
// Connection failed — fill red, restart AP
|
// Connection failed — fill red, restart AP
|
||||||
|
|||||||
+7
-4
@@ -316,13 +316,16 @@ void normal_operation_impl(const String& mac, HTTP& http, const String& url, Pre
|
|||||||
}
|
}
|
||||||
|
|
||||||
esp_sleep_enable_timer_wakeup(sleepMs * 1000ULL);
|
esp_sleep_enable_timer_wakeup(sleepMs * 1000ULL);
|
||||||
// Wake on the BOOT button so the user-facing 5-second-hold reset works
|
// Wake on the BOOT button so the user-facing "hold until the screen
|
||||||
// even during deep sleep. Without this, the button only does anything
|
// starts to flash" reset works even during deep sleep. Without this,
|
||||||
// during the brief poll-and-paint window when the device is awake, and
|
// the button only did anything during the brief awake window during
|
||||||
// a full sleep cycle (default minutes) of holding does nothing.
|
// a poll, and a full sleep cycle of holding did nothing.
|
||||||
// Pin is GPIO 0 (PIN_BTN_RESET); active-low because BOOT is pulled-up
|
// Pin is GPIO 0 (PIN_BTN_RESET); active-low because BOOT is pulled-up
|
||||||
// and shorts to ground on press. After EXT0 wakes the chip, setup()
|
// and shorts to ground on press. After EXT0 wakes the chip, setup()
|
||||||
// runs and check_reset_button() handles the remainder of the hold.
|
// runs and check_reset_button() handles the remainder of the hold.
|
||||||
|
// A too-short press wakes the device but check_reset_button returns
|
||||||
|
// false → normal_operation_impl runs → the next poll fetches a fresh
|
||||||
|
// image, which doubles as a "force refresh" gesture.
|
||||||
esp_sleep_enable_ext0_wakeup((gpio_num_t)PIN_BTN_RESET, 0);
|
esp_sleep_enable_ext0_wakeup((gpio_num_t)PIN_BTN_RESET, 0);
|
||||||
esp_deep_sleep_start();
|
esp_deep_sleep_start();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user