mirror of
https://github.com/airgradienthq/arduino.git
synced 2025-07-14 16:36:31 +02:00
Update OTA processing message. Fix always retry of bootCount = 0
This commit is contained in:
@ -549,6 +549,11 @@ static void displayExecuteOta(OtaState state, String msg, int processing) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case OtaState::OTA_STATE_SUCCESS: {
|
case OtaState::OTA_STATE_SUCCESS: {
|
||||||
|
if (ag->isOne()) {
|
||||||
|
oledDisplay.showNewFirmwareUpdating(String(100));
|
||||||
|
delay(250);
|
||||||
|
}
|
||||||
|
|
||||||
int i = 6;
|
int i = 6;
|
||||||
while(i != 0) {
|
while(i != 0) {
|
||||||
i = i - 1;
|
i = i - 1;
|
||||||
@ -564,6 +569,7 @@ static void displayExecuteOta(OtaState state, String msg, int processing) {
|
|||||||
|
|
||||||
delay(1000);
|
delay(1000);
|
||||||
}
|
}
|
||||||
|
oledDisplay.setBrightness(0);
|
||||||
esp_restart();
|
esp_restart();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -877,11 +883,12 @@ static void configUpdateHandle() {
|
|||||||
fwNewVersion = configuration.newFirmwareVersion();
|
fwNewVersion = configuration.newFirmwareVersion();
|
||||||
if (fwNewVersion.length()) {
|
if (fwNewVersion.length()) {
|
||||||
bool doOta = false;
|
bool doOta = false;
|
||||||
if (measurements.otaBootCount == 0) {
|
if (measurements.otaBootCount < 0) {
|
||||||
doOta = true;
|
doOta = true;
|
||||||
Serial.println("First OTA");
|
Serial.println("First OTA");
|
||||||
} else {
|
} else {
|
||||||
if ((measurements.bootCount - measurements.otaBootCount) >= 30) {
|
int bootDiff = measurements.bootCount - measurements.otaBootCount;
|
||||||
|
if (bootDiff >= 30) {
|
||||||
doOta = true;
|
doOta = true;
|
||||||
} else {
|
} else {
|
||||||
Serial.println(
|
Serial.println(
|
||||||
|
@ -380,7 +380,8 @@ void OledDisplay::showNewFirmwareFailed(void) {
|
|||||||
do {
|
do {
|
||||||
DISP()->setFont(u8g2_font_t0_16_tf);
|
DISP()->setFont(u8g2_font_t0_16_tf);
|
||||||
setCentralText(20, "Firmware Update");
|
setCentralText(20, "Firmware Update");
|
||||||
setCentralText(40, "Failed");
|
setCentralText(40, "fail, will retry");
|
||||||
|
// setCentralText(60, "will retry");
|
||||||
} while (DISP()->nextPage());
|
} while (DISP()->nextPage());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ public:
|
|||||||
int countPosition;
|
int countPosition;
|
||||||
const int targetCount = 20;
|
const int targetCount = 20;
|
||||||
int bootCount;
|
int bootCount;
|
||||||
int otaBootCount;
|
int otaBootCount = -1;
|
||||||
|
|
||||||
String toString(bool isLocal, AgFirmwareMode fwMode, int rssi, void* _ag, void* _config);
|
String toString(bool isLocal, AgFirmwareMode fwMode, int rssi, void* _ag, void* _config);
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user