mirror of
https://github.com/daveallie/crosspoint-reader.git
synced 2026-02-06 23:57:39 +03:00
Attempt to fix WiFi file transfer crash by adding initialization delay
Fixed a simple bug where WiFi file transfer would crash and lock the device when accessed directly. The issue was caused by missing initialization time after WiFi.mode(WIFI_STA) call,. Root cause: - Hotspot mode includes delay(100) after WiFi.mode(WIFI_AP) to allow hardware initialization - Join Network mode was missing this delay after WiFi.mode(WIFI_STA) - Without the delay, WiFi wasn't properly initialized - This caused crashes when starting the web server in STA mode Fix: - Added delay(100) after WiFi.mode(WIFI_STA) in onNetworkModeSelected() - Matches the proven initialization pattern used in hotspot mode - Comment added to explain the purpose of the delay
This commit is contained in:
parent
d4ae108d9b
commit
f1ee16779d
@ -138,7 +138,8 @@ void CrossPointWebServerActivity::onNetworkModeSelected(const NetworkMode mode)
|
||||
// STA mode - launch WiFi selection
|
||||
Serial.printf("[%lu] [WEBACT] Turning on WiFi (STA mode)...\n", millis());
|
||||
WiFi.mode(WIFI_STA);
|
||||
|
||||
delay(100); // Allow WiFi hardware to initialize before proceeding
|
||||
|
||||
state = WebServerActivityState::WIFI_SELECTION;
|
||||
Serial.printf("[%lu] [WEBACT] Launching WifiSelectionActivity...\n", millis());
|
||||
enterNewActivity(new WifiSelectionActivity(renderer, mappedInput,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user