firmware: v21 — arquitectura v1 simplificada, sin handshakeTask

ESP32-CAM: eliminada handshakeTask (fragmentaba heap durante 30s
con String objects, causando inestabilidad al manejar el coche)

ESP8266: sustituido waitForReady() por delay fijo de 20s + flush
de Serial + 2 pitidos. Sin WiFi, sin String, sin tareas extra.
Arquitectura identica a v1 que funcionaba, mas watchdog 1.5s.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Natxo1000
2026-06-03 17:23:37 +02:00
parent 0ba2f0247c
commit e770520f73
4 changed files with 19 additions and 67 deletions

View File

@@ -10,7 +10,7 @@
// ================================================================
// OTA CONFIG
// ================================================================
#define FW_VERSION 20
#define FW_VERSION 21
#define GITEA_HOST "https://git.nacho.myds.me"
#define GITEA_OWNER "Natxo"
#define GITEA_REPO "Arduino-Car"
@@ -24,29 +24,6 @@ const char *password = "Suprak1llm1ndS23S";
void startCameraServer();
void setupLedFlash();
static void handshakeTask(void *) {
unsigned long deadline = millis() + 30000UL;
String buf = "";
while (millis() < deadline) {
Serial.print("GO\n");
unsigned long t = millis();
while (millis() - t < 300) {
while (Serial.available()) {
char c = Serial.read();
if (c == '\n') {
buf.trim();
if (buf == "OK") { vTaskDelete(NULL); return; }
buf = "";
} else if (c != '\r' && buf.length() < 8) {
buf += c;
}
}
vTaskDelay(pdMS_TO_TICKS(5));
}
}
vTaskDelete(NULL);
}
// ── OTA: comprueba si hay firmware nuevo y actualiza si hace falta ──
static void checkOTA() {
@@ -169,8 +146,6 @@ void setup() {
// ── Servidor cámara ───────────────────────────────────────────────
startCameraServer();
xTaskCreate(handshakeTask, "handshake", 4096, NULL, 1, NULL);
}
void loop() {