diff --git a/build/esp12e/firmware.bin b/build/esp12e/firmware.bin index b21665c..4fe125a 100644 Binary files a/build/esp12e/firmware.bin and b/build/esp12e/firmware.bin differ diff --git a/include/myDisplay.h b/include/myDisplay.h index 5bee5f7..01f6f40 100644 --- a/include/myDisplay.h +++ b/include/myDisplay.h @@ -6,4 +6,5 @@ enum DISPLAY_POSITION { }; void setupDisplay(); -void showNumber(uint8_t number); \ No newline at end of file +void showNumber(uint8_t number); +void showInsideInfo(const char* text); \ No newline at end of file diff --git a/include/version.h b/include/version.h index cb39b8d..f8c92d1 100644 --- a/include/version.h +++ b/include/version.h @@ -1,9 +1,9 @@ #ifndef BUILD_NUMBER - #define BUILD_NUMBER 32 + #define BUILD_NUMBER 39 #endif #ifndef VERSION - #define VERSION "v0.1.32 - 2023-11-28 13:50:39.195748" + #define VERSION "v0.1.39 - 2023-11-28 18:19:04.992246" #endif #ifndef VERSION_SHORT - #define VERSION_SHORT "v0.1.32" + #define VERSION_SHORT "v0.1.39" #endif diff --git a/src/main.cpp b/src/main.cpp index 188abf8..437c159 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -109,6 +109,7 @@ void handleKeyPress(char pressedKey) { if (pressedKey == 'R') { Serial.println("Pressed restart. Rstarting.."); Serial.flush(); + showInsideInfo("Restarting.."); playBuzzer(BUZZER_PIN, TONE_BEEP_LONG); ESP.restart(); } diff --git a/src/myDisplay.cpp b/src/myDisplay.cpp index 5487dd8..083cd8a 100644 --- a/src/myDisplay.cpp +++ b/src/myDisplay.cpp @@ -174,9 +174,16 @@ void showOutsideNumber(uint8_t number) { FastLED.show(); } +void clearLCDLine(int line) { + lcd.setCursor(0, line); + for(int n = 0; n < LCD_COLUMNS; n++){ + lcd.print(" "); + } + lcd.setCursor(0, line); +} + void showInsideNumber(int number) { - lcd.clear(); - lcd.setCursor(0,0); + clearLCDLine(0); lcd.print(number); } @@ -185,6 +192,11 @@ void showNumber(uint8_t number) { showInsideNumber(number); } +void showInsideInfo(const char* text) { + clearLCDLine(1); + lcd.print(text); +} + void setupDisplay() { // LED matrix setup FastLED.addLeds(leds, NUM_LEDS); // GRB ordering is assumed diff --git a/src/myOTA.cpp b/src/myOTA.cpp index a4de63a..7ce40c7 100644 --- a/src/myOTA.cpp +++ b/src/myOTA.cpp @@ -7,6 +7,7 @@ #include #include #include +#include "myDisplay.h" void setupOTALocal() { Serial.println("Booting"); @@ -19,12 +20,17 @@ void setupOTALocal() { } ArduinoOTA.onStart([]() { Serial.println("Start"); + showInsideInfo("[LU] Start"); }); ArduinoOTA.onEnd([]() { Serial.println("\nEnd"); + showInsideInfo("[LU] Done"); }); ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) { Serial.printf("Progress: %u%%\r", (progress / (total / 100))); + char infoBuffer[16]; + sprintf(infoBuffer, "[LU] P:%u%%", (progress / (total / 100))); + showInsideInfo(infoBuffer); }); ArduinoOTA.onError([](ota_error_t error) { Serial.printf("Error[%u]: ", error); @@ -48,17 +54,21 @@ void handleOTARemote() { WiFiClient client; Serial.println("Updating from remote..."); + showInsideInfo("[RU] Start"); t_httpUpdate_return ret = ESPhttpUpdate.update(client, "http://patient.bendtherules.in/build/esp12e/firmware.bin", VERSION_SHORT); switch(ret) { case HTTP_UPDATE_FAILED: Serial.print("[update] Update failed. Reason - "); Serial.println(ESPhttpUpdate.getLastErrorString()); + showInsideInfo("[RU] Failed"); break; case HTTP_UPDATE_NO_UPDATES: Serial.println("[update] Update no Update."); + showInsideInfo("[RU] Skip"); break; case HTTP_UPDATE_OK: Serial.println("[update] Update ok."); // may not be called since we reboot the ESP + showInsideInfo("[RU] Done"); break; } } diff --git a/versioning b/versioning index 1758ddd..72f523f 100644 --- a/versioning +++ b/versioning @@ -1 +1 @@ -32 \ No newline at end of file +39 \ No newline at end of file