mirror of
https://github.com/meshtastic/firmware.git
synced 2025-07-29 18:05:42 +00:00
Workaround Webserver needing to stay up while Wifi is turned off
Expertly triaged by @philon- , turning off wifi using the HTTP API did not work. That was because we only served the HTTP API if Wifi was deemed to be available, but mid-way through turning it off Wifi was still available, but the configuration we were checking said it wasn't. This patch introduces an additional way the system can determine if Wifi is available, by referring to the WiFi.status(). This means that in that limbo state where Wifi has been set to be turned off, but the configuration has not been saved and it is still up, the HTTP API will stay up long enough to save the configuration. Fixes https://github.com/meshtastic/firmware/issues/6965
This commit is contained in:
parent
aa3b14ce72
commit
db5a627e7c
@ -235,6 +235,11 @@ bool isWifiAvailable()
|
||||
#ifdef USE_WS5500
|
||||
} else if (config.network.eth_enabled) {
|
||||
return true;
|
||||
#endif
|
||||
#ifndef ARCH_PORTDUINO
|
||||
} else if (WiFi.status() == WL_CONNECTED) {
|
||||
// it's likely we have wifi now, but user intends to turn it off in config!
|
||||
return true;
|
||||
#endif
|
||||
} else {
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user