firmware: v19 — quitar handler G del loop()

El handler 'G' en loop() empeoraba el problema:
el bootloader del ESP32 manda basura que incluye bytes 0x47 ('G'),
lo que disparaba un handshake falso y dejaba espReady=true
antes de tiempo, permitiendo que mas basura del bootloader
ejecutase backward().

Ahora: solo waitForReady() hace el handshake al arrancar.
Si el ESP32 se cuelga y reinicia, el watchdog de 1.5s (millis())
para los motores. Cuando el ESP32 termina de arrancar, el usuario
puede volver a manejar normalmente.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Natxo1000
2026-06-03 16:55:58 +02:00
parent 3ef37e0f0e
commit ba3f927e8c
5 changed files with 4 additions and 17 deletions

View File

@@ -7,7 +7,7 @@
// ================================================================ // ================================================================
// OTA CONFIG // OTA CONFIG
// ================================================================ // ================================================================
#define FW_VERSION 18 #define FW_VERSION 19
#define GITEA_HOST "https://git.nacho.myds.me" #define GITEA_HOST "https://git.nacho.myds.me"
#define GITEA_OWNER "Natxo" #define GITEA_OWNER "Natxo"
#define GITEA_REPO "Arduino-Car" #define GITEA_REPO "Arduino-Car"
@@ -185,19 +185,6 @@ void loop() {
if (Serial.available()) { if (Serial.available()) {
char c = Serial.read(); char c = Serial.read();
// Reinicio del ESP32-CAM: manda "GO\n" de nuevo
if (c == 'G') {
espReady = false;
stopMotors();
motorRunning = false;
Serial.readStringUntil('\n');
Serial.print("OK\n");
delay(50);
while (Serial.available()) Serial.read();
espReady = true;
return;
}
// Ignorar todo hasta que el handshake esté completo // Ignorar todo hasta que el handshake esté completo
if (!espReady) return; if (!espReady) return;

View File

@@ -10,7 +10,7 @@
// ================================================================ // ================================================================
// OTA CONFIG // OTA CONFIG
// ================================================================ // ================================================================
#define FW_VERSION 18 #define FW_VERSION 19
#define GITEA_HOST "https://git.nacho.myds.me" #define GITEA_HOST "https://git.nacho.myds.me"
#define GITEA_OWNER "Natxo" #define GITEA_OWNER "Natxo"
#define GITEA_REPO "Arduino-Car" #define GITEA_REPO "Arduino-Car"

View File

@@ -1 +1 @@
18 19

Binary file not shown.

View File

@@ -1 +1 @@
18 19