Controller B OTA: link_peer (STATUS to A, PAIR from the wire, AES-GCM SECURE frames), updater ported from A, console, CI workflow, shared header v2 maintenance frames; wiki + docs
Firmware / build (push) Successful in 2m57s

This commit is contained in:
2026-09-27 20:26:40 +02:00
parent 30ab113218
commit e6773c73ba
24 changed files with 1805 additions and 57 deletions
+15 -1
View File
@@ -14,6 +14,10 @@
#include "modules/gauge_outputs.h"
#include "modules/debug_monitor.h"
#include "modules/gauge_screen.h"
#include "modules/link_peer.h"
#include "modules/console.h"
#include "modules/ota_update.h"
#include "config/ota_config.h"
// FreeRTOS task handles
TaskHandle_t lvglTaskHandle = NULL;
@@ -47,7 +51,7 @@ void setup() {
Serial.println("[BOOT] Serial communication ready!");
Serial.println("\n\n=================================");
Serial.println("ESP32-S3-LCD-1.3 - Controller B");
Serial.printf("Link protocol v%u | UART + ESP-NOW | gauge outputs\n", PACKET_VERSION);
Serial.printf("Firmware %s | Link protocol v%u | UART + ESP-NOW | gauge outputs\n", FW_VERSION, PACKET_VERSION);
Serial.println("=================================\n");
Serial.printf("CPU Frequency: %d MHz\n", getCpuFrequencyMhz());
@@ -74,6 +78,12 @@ void setup() {
Serial.println("\n[Gauges] Initializing Patrol gauge outputs...");
GaugeOutputs::init();
// Pairing key + Wi-Fi credentials from NVS, before any frame can arrive
LinkPeer::init();
Ota::init(); // version + slot; hooks A's OTA commands
Console::addHandler(LinkPeer::handleCommand);
Console::addHandler(Ota::handleCommand);
Serial.println("\n[UART] Initializing link receiver...");
if (!UARTReceiver::init()) {
Serial.println("[ERROR] Link receiver initialization failed!");
@@ -100,6 +110,10 @@ void loop() {
// Wireless leg housekeeping (channel hopping while silent)
EspNowReceiver::tick();
// STATUS to A, PAIR/SECURE frames from A, serial console
LinkPeer::tick();
Ota::tick(); // runs a queued check/install (blocks the loop while it does)
Console::tick();
// Apply a new CONFIG from A. Overrides are a bench tool: applied but not
// persisted, so a reboot never leaves the gauges pinned to a test value.