feat: Add v0.3 OTA updates — dual partition, esp-ota tool, rollback

Dual OTA partition table (ota_0/ota_1, 1920 KB each) on 4MB flash.
Firmware gains OTA command, LED_OTA double-blink, version in STATUS,
and automatic rollback validation. Pi-side esp-ota tool serves firmware
via HTTP and orchestrates the update flow. esp-fleet gains ota subcommand.
This commit is contained in:
user
2026-02-04 16:19:09 +01:00
parent 44bd549761
commit d65ac208b9
8 changed files with 368 additions and 36 deletions

View File

@@ -34,10 +34,11 @@ idf.py reconfigure # Re-fetch managed components
## Remote Management (esp-cmd)
```bash
esp-cmd <host> STATUS # Uptime, heap, RSSI, tx_power, rate
esp-cmd <host> STATUS # Uptime, heap, RSSI, tx_power, rate, version
esp-cmd <host> IDENTIFY # LED solid 5s (find the device)
esp-cmd <host> RATE 50 # Set ping rate to 50 Hz (NVS saved)
esp-cmd <host> POWER 15 # Set TX power to 15 dBm (NVS saved)
esp-cmd <host> OTA http://pi:8070/fw # Trigger OTA update (use esp-ota instead)
esp-cmd <host> REBOOT # Restart device
```
@@ -55,8 +56,34 @@ esp-fleet status # Query all sensors at once
esp-fleet identify # Blink all LEDs
esp-fleet rate 50 # Set rate on all devices
esp-fleet reboot # Reboot entire fleet
esp-fleet ota # OTA update all (sequential)
esp-fleet ota /path/to/firmware.bin # OTA with custom firmware
```
## OTA Updates (esp-ota)
```bash
esp-ota amber-maple.local # OTA with default build
esp-ota amber-maple.local -f fw.bin # OTA with custom firmware
esp-ota amber-maple.local --no-wait # Fire and forget
```
**First flash after enabling OTA requires USB** (partition table change).
After that, all updates are OTA.
### OTA Flow
1. Verifies device is alive via STATUS
2. Starts temp HTTP server on Pi (port 8070)
3. Sends `OTA http://<pi>:8070/<fw>.bin` via UDP
4. Device downloads, flashes, reboots
5. Verifies device responds post-reboot
### Rollback
If new firmware crashes or hangs, the 30s watchdog reboots and bootloader
automatically rolls back to the previous firmware.
### LED States
| LED | Meaning |
@@ -65,6 +92,7 @@ esp-fleet reboot # Reboot entire fleet
| Slow blink (1 Hz) | Connected, no CSI activity |
| Fast blink (5 Hz) | CSI data flowing |
| Solid (5s) | IDENTIFY command active |
| Double blink | OTA in progress |
## Test CSI Reception
@@ -109,6 +137,7 @@ secondary_channel,timestamp,ant,sig_len,rx_state,len,first_word,"[I,Q,...]"
| `get-started/csi_recv_router/main/app_main.c` | Main firmware source |
| `get-started/csi_recv_router/main/Kconfig.projbuild` | UDP/cmd port config |
| `tools/esp-cmd` | Pi-side management CLI |
| `tools/esp-ota` | Pi-side OTA update tool |
| `tools/esp-fleet` | Fleet-wide command tool |
| `get-started/csi_recv_router/sdkconfig.defaults` | SDK defaults |
| `get-started/csi_recv_router/main/idf_component.yml` | Dependencies |