mirror of
https://github.com/mikecarper/MeshCore.git
synced 2026-10-29 22:02:31 +00:00
feat(docs): update CLI commands for OTA firmware update options
Enhance the documentation for the `start ota` command to clarify its behavior when connected to a Wi-Fi network versus when using the `start ota ap` option. This provides users with better guidance on how to initiate OTA updates under different network conditions.
This commit is contained in:
1 parent
85c0e1de11
commit
2019a8c0ca
8 files changed
+21
-11
No files matched your search
@@ -11,14 +11,17 @@
|
||||
|
||||
#include <SPIFFS.h>
|
||||
|
||||
bool ESP32Board::startOTAUpdate(const char* id, char reply[]) {
|
||||
bool ESP32Board::startOTAUpdate(const char* id, char reply[], bool force_ap) {
|
||||
inhibit_sleep = true; // prevent sleep during OTA
|
||||
|
||||
// If the device is already on a WiFi network (e.g. an observer joined in STA
|
||||
// mode), serve ElegantOTA on the station IP so it's reachable from the LAN
|
||||
// without joining a separate AP. Otherwise raise the MeshCore-OTA SoftAP.
|
||||
// force_ap ("start ota ap") always raises the SoftAP, so the OTA UI stays
|
||||
// reachable even when the joined network applies client isolation and the
|
||||
// station IP can't be reached.
|
||||
IPAddress ip;
|
||||
if (WiFi.status() == WL_CONNECTED) {
|
||||
if (!force_ap && WiFi.status() == WL_CONNECTED) {
|
||||
ip = WiFi.localIP();
|
||||
} else {
|
||||
WiFi.softAP("MeshCore-OTA", NULL);
|
||||
@@ -50,7 +53,7 @@ bool ESP32Board::startOTAUpdate(const char* id, char reply[]) {
|
||||
}
|
||||
|
||||
#else
|
||||
bool ESP32Board::startOTAUpdate(const char* id, char reply[]) {
|
||||
bool ESP32Board::startOTAUpdate(const char* id, char reply[], bool force_ap) {
|
||||
return false; // not supported
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in new issue
Block a user