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
+15 -1
View File
@@ -15,7 +15,7 @@ namespace roro {
void StorageService::start() {
if (task_) return;
lock_ = xSemaphoreCreateMutex();
xTaskCreate(taskEntry, "storage", 6144, this, 1, &task_);
xTaskCreate(taskEntry, "storage", 10240, this, 1, &task_); // room for a signature check
}
void StorageService::stop() {
@@ -75,6 +75,13 @@ void StorageService::requestDelete(std::vector<std::string> paths) {
if (task_) xTaskNotifyGive(task_);
}
void StorageService::runJob(std::function<void()> job) {
lock();
jobs_.push_back(std::move(job));
unlock();
if (task_) xTaskNotifyGive(task_);
}
bool StorageService::requestFormat() {
if (formatRequested_ || !task_) return false;
formatRequested_ = true;
@@ -109,6 +116,13 @@ void StorageService::loop() {
}
if (wantListing) list();
lock();
std::vector<std::function<void()>> jobs;
jobs.swap(jobs_);
unlock();
for (auto& job : jobs)
if (mounted_) job();
// Sleep until the next batch, or until a request wakes us early.
ulTaskNotifyTake(pdTRUE, pdMS_TO_TICKS(kWakeMs));
}