OTA bring-up fixes: loop-task jobs + PSRAM TLS, ESP-NOW survives Wi-Fi, wifi console
Firmware / build (push) Successful in 4m24s

- ota: internal RAM has 15.9 KB free / 7.6 KB largest block with Wi-Fi up, so
  jobs now run in the loop task (8 KB stack; 3.6 KB headroom measured on
  `ota check`) with mbedtls allocations routed to PSRAM during the job
- wifi_manager: WiFi.disconnect(true) powered the radio off and killed ESP-NOW
  whenever Wi-Fi was used; now disconnect() only. showConnectionResult() waits
  for the LVGL lock and null-checks widgets. New `wifi join|status|off` console
- espnow_link: send() re-initialises ESP-NOW if the driver dropped it
- wiki: ota-updates memory + bugs sections, open-questions #13 (internal RAM),
  log; CLAUDE.md notes

Verified on the board: `wifi join` connects, ESP-NOW 195 sent / 0 failed while
joined, `ota check` verifies v0.1.0's signature on-device.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-26 22:37:08 +02:00
parent f5b7f43e7c
commit bb0895674a
9 changed files with 142 additions and 23 deletions
+17 -1
View File
@@ -62,14 +62,30 @@ bool init() {
return true;
}
// Anything that restarts the Wi-Fi driver drops ESP-NOW with it. Re-init at
// most once a second instead of failing every frame from then on.
static void reinitIfDue() {
static uint32_t last = 0;
if (millis() - last < 1000) return;
last = millis();
g_ready = false;
ESP_LOGW("EspNow", "ESP-NOW not initialised - re-initialising");
init();
}
bool send(const uint8_t* frame, size_t len) {
if (!g_ready || len == 0 || len > ESP_NOW_MAX_DATA_LEN) return false;
if (len == 0 || len > ESP_NOW_MAX_DATA_LEN) return false;
if (!g_ready) {
reinitIfDue();
if (!g_ready) return false;
}
esp_err_t err = esp_now_send(BROADCAST_MAC, frame, len);
if (err == ESP_OK) {
g_sent++;
return true;
}
g_fail++;
if (err == ESP_ERR_ESPNOW_NOT_INIT) reinitIfDue();
return false;
}