diff --git a/build/esp12e/firmware.bin b/build/esp12e/firmware.bin index 4fe125a..18beabd 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 01f6f40..ab4911e 100644 --- a/include/myDisplay.h +++ b/include/myDisplay.h @@ -5,6 +5,9 @@ enum DISPLAY_POSITION { POSITION_RIGHT, }; +#define LCD_COLUMNS 16 +#define LCD_ROWS 2 + void setupDisplay(); 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 f8c92d1..bedee21 100644 --- a/include/version.h +++ b/include/version.h @@ -1,9 +1,9 @@ #ifndef BUILD_NUMBER - #define BUILD_NUMBER 39 + #define BUILD_NUMBER 41 #endif #ifndef VERSION - #define VERSION "v0.1.39 - 2023-11-28 18:19:04.992246" + #define VERSION "v0.1.41 - 2023-11-28 18:30:13.789845" #endif #ifndef VERSION_SHORT - #define VERSION_SHORT "v0.1.39" + #define VERSION_SHORT "v0.1.41" #endif diff --git a/src/myOTA.cpp b/src/myOTA.cpp index 7ce40c7..a81bfed 100644 --- a/src/myOTA.cpp +++ b/src/myOTA.cpp @@ -11,29 +11,34 @@ void setupOTALocal() { Serial.println("Booting"); + char infoBuffer[LCD_COLUMNS]; + sprintf(infoBuffer, "W:%s", WIFI_SSID); + showInsideInfo(infoBuffer); WiFi.mode(WIFI_STA); WiFi.begin(WIFI_SSID, WIFI_PASSWORD); while (WiFi.waitForConnectResult() != WL_CONNECTED) { Serial.println("Connection Failed! Rebooting..."); + showInsideInfo("W:Failed"); delay(5000); ESP.restart(); } + showInsideInfo("W:Connected"); ArduinoOTA.onStart([]() { Serial.println("Start"); - showInsideInfo("[LU] Start"); + showInsideInfo("LU:Start"); }); ArduinoOTA.onEnd([]() { Serial.println("\nEnd"); - showInsideInfo("[LU] Done"); + showInsideInfo("LU:Restarting.."); }); 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))); + Serial.printf("Progress:%u%%\r", (progress / (total / 100))); + char infoBuffer[LCD_COLUMNS]; + sprintf(infoBuffer, "LU:P:%u%%", (progress / (total / 100))); showInsideInfo(infoBuffer); }); ArduinoOTA.onError([](ota_error_t error) { - Serial.printf("Error[%u]: ", error); + Serial.printf("Error[%u]:", error); if (error == OTA_AUTH_ERROR) Serial.println("Auth Failed"); else if (error == OTA_BEGIN_ERROR) Serial.println("Begin Failed"); else if (error == OTA_CONNECT_ERROR) Serial.println("Connect Failed"); @@ -42,7 +47,7 @@ void setupOTALocal() { }); ArduinoOTA.begin(); Serial.println("Ready"); - Serial.print("IP address: "); + Serial.print("IP address:"); Serial.println(WiFi.localIP()); } @@ -54,21 +59,21 @@ void handleOTARemote() { WiFiClient client; Serial.println("Updating from remote..."); - showInsideInfo("[RU] Start"); + 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.print("update:Update failed. Reason - "); Serial.println(ESPhttpUpdate.getLastErrorString()); - showInsideInfo("[RU] Failed"); + showInsideInfo("RU:Failed"); break; case HTTP_UPDATE_NO_UPDATES: - Serial.println("[update] Update no Update."); - showInsideInfo("[RU] Skip"); + 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"); + 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 72f523f..aaa6442 100644 --- a/versioning +++ b/versioning @@ -1 +1 @@ -39 \ No newline at end of file +41 \ No newline at end of file