Fix web OTA upload and isolate OTA sessions across firmware and goTool.

Split ESP-NOW into core/master/slave modules, block non-OTA UART traffic during updates, and hold the host serial port exclusively so dashboard polling cannot interleave with firmware uploads.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-05-31 16:35:18 +02:00
co-authored by Cursor
parent 0cbc4d0644
commit 0eea27a876
29 changed files with 1828 additions and 1416 deletions
+21 -7
View File
@@ -67,14 +67,28 @@ static void handle_battery_status(const uint8_t *data, size_t len) {
if (len > 0) {
alox_UartMessage uart_msg;
if (uart_cmd_decode(data, len, &uart_msg) == ESP_OK) {
const alox_BatteryStatusRequest *req_ptr = UART_CMD_REQ(
&uart_msg, alox_UartMessage_battery_status_request_tag,
battery_status_request);
if (req_ptr != NULL) {
req = *req_ptr;
}
if (uart_cmd_decode(data, len, &uart_msg) != ESP_OK) {
ESP_LOGW(TAG, "decode failed");
alox_UartMessage response;
uart_cmd_init_response(&response, alox_MessageType_BATTERY_STATUS,
alox_UartMessage_battery_status_response_tag);
response.payload.battery_status_response.success = false;
uart_cmd_send(&response, TAG);
return;
}
const alox_BatteryStatusRequest *req_ptr = UART_CMD_REQ(
&uart_msg, alox_UartMessage_battery_status_request_tag,
battery_status_request);
if (req_ptr == NULL) {
ESP_LOGW(TAG, "missing battery_status_request");
alox_UartMessage response;
uart_cmd_init_response(&response, alox_MessageType_BATTERY_STATUS,
alox_UartMessage_battery_status_response_tag);
response.payload.battery_status_response.success = false;
uart_cmd_send(&response, TAG);
return;
}
req = *req_ptr;
}
alox_UartMessage response;