You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Docs/Commands.md
+13-1Lines changed: 13 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,8 @@ These are commands used to configure the system settings and can only be sent fr
18
18
|`F9` — SD Card Log File Size |`F9`| Get current log file size in bytes. Returns `v=<bytes>` where bytes is the size of the active log file. Returns `v=0` if no file is open. No params. |
19
19
|`F10` — RTC Diagnostic |`F10`| Perform DS1302 RTC diagnostics. Returns status message with RTC health (availability, running state, write protection, time validity). Returns error message if RTC fails any check. No params. |
20
20
|`F11` — Uptime | F11 | Returns system uptime as "days HH:MM:SS" (e.g. 2d 03:12:45). No params. |
21
+
|`F12` — OTA Check / Apply |`F12` or `F12:apply=1`| Trigger an OTA firmware check against the latest GitHub release. Without params (or `apply=0`) checks only and returns current status. With `apply=1` downloads and applies the update if one is available (or queues apply if a check is already in progress). Response params: `v=<current>` current firmware version, `av=<available>` available version tag (empty if none found yet), `s=<state>` OTA state string. **SFB only** — requires `OTA_AUTO_UPDATE`, ESP32 and WiFi in client mode. |
22
+
|`F13` — OTA Status |`F13`| Query current OTA state without triggering a check. Response params: `v=<current>` current firmware version, `av=<available>` available version tag, `s=<state>` OTA state string (`idle`, `checking`, `available`, `downloading`, `rebooting`, `failed`, `uptodate`), `auto=<0\|1>` whether auto-apply is enabled. **SFB only** — requires `OTA_AUTO_UPDATE`, ESP32 and WiFi in client mode. |
21
23
22
24
**Heartbeat Behavior:**
23
25
- Sent every 1 second (1000ms) from both devices
@@ -30,7 +32,17 @@ These are commands used to configure the system settings and can only be sent fr
30
32
### Wifi System Commands (SFB)
31
33
Only F0 is supported via wifi.
32
34
Route: /api/system/{command}
33
-
Example: Return free memory = /api/system/F2
35
+
Example: Return free memory = /api/system/F2
36
+
37
+
### OTA Behavior (F12 / F13)
38
+
- Automatic periodic check runs every 24 hours (first check fires 24 h after boot to allow WiFi to fully connect).
39
+
- F12 without params (or `apply=0`) triggers an immediate check and broadcasts the result — it does **not** apply the update automatically.
40
+
- F12 with `apply=1` downloads and applies immediately if an update is available; if a check is still in progress the apply is queued.
41
+
- Auto-apply on each periodic check is **off by default**; enable it by setting bit `OtaFlagAutoApply (0x01)` in `SystemHeader::reserved[0]`.
42
+
- State transitions broadcast an `F12` command automatically as they occur (e.g. `checking` → `available` → `downloading` → `rebooting`).
43
+
- Debug and error messages are broadcast via the debug channel with source `OTA` at each key milestone: API query, tag found/not found, checksum fetch, binary size, download progress (25 / 50 / 75%), hash verification, and reboot.
44
+
- F13 is read-only — it never triggers any OTA activity.
45
+
- OTA is only active when `OTA_AUTO_UPDATE` is defined, the board is an ESP32, `WIFI_SUPPORT` is defined, and WiFi is in connected client mode.
0 commit comments