firmware: v2 — pitidos OTA
- 3 pitidos al actualizar ESP32-CAM (via Serial al buzzer) - 4 pitidos al actualizar ESP8266 (directo al buzzer) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
// ================================================================
|
||||
// OTA CONFIG
|
||||
// ================================================================
|
||||
#define FW_VERSION 1
|
||||
#define FW_VERSION 2
|
||||
#define GITEA_HOST "https://git.nacho.myds.me"
|
||||
#define GITEA_OWNER "Natxo"
|
||||
#define GITEA_REPO "Arduino-Car"
|
||||
@@ -74,6 +74,16 @@ static void checkOTA() {
|
||||
body.trim();
|
||||
int remoteVer = body.toInt();
|
||||
if (remoteVer > FW_VERSION) {
|
||||
// 4 pitidos = ESP8266 actualizando
|
||||
pinMode(buzzerPin, OUTPUT);
|
||||
for (int i = 0; i < 4; i++) {
|
||||
digitalWrite(buzzerPin, HIGH);
|
||||
delay(150);
|
||||
digitalWrite(buzzerPin, LOW);
|
||||
delay(150);
|
||||
}
|
||||
delay(300);
|
||||
|
||||
BearSSL::WiFiClientSecure updateClient;
|
||||
updateClient.setInsecure();
|
||||
ESPhttpUpdate.setFollowRedirects(HTTPC_STRICT_FOLLOW_REDIRECTS);
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
// ================================================================
|
||||
// OTA CONFIG
|
||||
// ================================================================
|
||||
#define FW_VERSION 1
|
||||
#define FW_VERSION 2
|
||||
#define GITEA_HOST "https://git.nacho.myds.me"
|
||||
#define GITEA_OWNER "Natxo"
|
||||
#define GITEA_REPO "Arduino-Car"
|
||||
@@ -45,6 +45,15 @@ static void checkOTA() {
|
||||
int remoteVer = body.toInt();
|
||||
if (remoteVer <= FW_VERSION) return; // ya tenemos la última versión
|
||||
|
||||
// 3 pitidos = ESP32-CAM actualizando (via Serial al ESP8266)
|
||||
for (int i = 0; i < 3; i++) {
|
||||
Serial.print("H1");
|
||||
delay(150);
|
||||
Serial.print("H0");
|
||||
delay(150);
|
||||
}
|
||||
delay(300);
|
||||
|
||||
// Hay versión nueva → descargar y flashear
|
||||
WiFiClientSecure updateClient;
|
||||
updateClient.setInsecure();
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
1
|
||||
2
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
1
|
||||
2
|
||||
Reference in New Issue
Block a user