OTA steps 3-5: Update Service, Probation and Rollback, Update from SD

- EcdsaVerifier (mbedTLS, embedded public key) and EspOtaSink (writes
  the inactive app slot, esp_ota_end validates the image, then sets
  the boot partition)
- UpdateService: listens on TCP 3232 (and mDNS roro9stack-<id>) while
  Wi-Fi is Connected; streams into UpdateParser; replies OK/ERR to the
  sender; remembers the pending version so a Rollback is reported
  after the reboot
- Probation (host-tested): confirm after the first frame + 30 s + Wi-Fi
  (if configured); roll back if configured Wi-Fi never connects in 3 min
- Main loop: full-screen progress while receiving; restart once
  installed, waiting up to 60 s for Text Entry to end
- Settings > Firmware: version, Probation status, push address and
  name, and the .ota files in /updates on the SD card to install
- StorageService.runJob() runs work on the storage task (SD installs)
- wifi status prints IP and running version; RORO_TEST_CRASH test hook

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EhqxQ49eCju4CzKYNjZzwT
This commit is contained in:
2026-10-03 21:35:33 +02:00
co-authored by Claude Opus 5.5
parent 90cb6ef9b2
commit 21b3d9e422
19 changed files with 655 additions and 10 deletions
+21
View File
@@ -2,6 +2,8 @@
#include <M5Cardputer.h>
#include "fonts.h"
namespace roro {
bool Screen::begin() {
@@ -21,4 +23,23 @@ void Screen::render(AppManager& apps, const StatusInfo& status, const Toast* toa
canvas_.pushSprite(&M5Cardputer.Display, 0, 0);
}
void Screen::renderUpdate(const std::string& title, const std::string& detail, int percent) {
canvas_.fillSprite(theme::kBackground);
canvas_.setTextDatum(top_center);
canvas_.setFont(&fonts::bold);
canvas_.setTextColor(theme::kAccent);
canvas_.drawString(title.c_str(), theme::kWidth / 2, 34);
canvas_.setFont(&fonts::body);
canvas_.setTextColor(theme::kText);
canvas_.drawString(detail.c_str(), theme::kWidth / 2, 56);
if (percent >= 0) {
const int x = 20, y = 82, w = theme::kWidth - 40, h = 12;
canvas_.drawRect(x, y, w, h, theme::kMuted);
canvas_.fillRect(x + 1, y + 1, (w - 2) * percent / 100, h - 2, theme::kAccent);
canvas_.drawString((std::to_string(percent) + "%").c_str(), theme::kWidth / 2, y + 18);
}
canvas_.setTextDatum(top_left);
canvas_.pushSprite(&M5Cardputer.Display, 0, 0);
}
} // namespace roro
+2
View File
@@ -11,6 +11,8 @@ class Screen {
public:
bool begin(); // allocates the frame buffer (~32 KB at 8-bit colour)
void render(AppManager& apps, const StatusInfo& status, const Toast* toast);
// Takes over the screen while a Firmware Update is received or about to restart.
void renderUpdate(const std::string& title, const std::string& detail, int percent);
Canvas& canvas() { return canvas_; }
private: