diff --git a/build/esp12e/firmware.bin b/build/esp12e/firmware.bin index ee7db7e..bc064c4 100644 Binary files a/build/esp12e/firmware.bin and b/build/esp12e/firmware.bin differ diff --git a/include/myOTA.h b/include/myOTA.h index cabb227..a9ec703 100644 --- a/include/myOTA.h +++ b/include/myOTA.h @@ -3,4 +3,6 @@ void setupOTALocal(); void handleOTALocal(); -void handleOTARemote(); \ No newline at end of file +void handleOTARemote(); + +void printIPInfo(); diff --git a/include/version.h b/include/version.h index 4d40c1a..83aced3 100644 --- a/include/version.h +++ b/include/version.h @@ -1,9 +1,9 @@ #ifndef BUILD_NUMBER - #define BUILD_NUMBER 42 + #define BUILD_NUMBER 47 #endif #ifndef VERSION - #define VERSION "v0.1.42 - 2023-11-28 18:31:54.334129" + #define VERSION "v0.1.47 - 2023-11-28 18:50:16.207931" #endif #ifndef VERSION_SHORT - #define VERSION_SHORT "v0.1.42" + #define VERSION_SHORT "v0.1.47" #endif diff --git a/src/main.cpp b/src/main.cpp index 437c159..5c0fda8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -75,6 +75,7 @@ const String KEY_D = "0x1FE20DF"; const String KEY_ON = "0x1FE48B7"; const String KEY_OFF = "0x1FE48B7"; const String KEY_MODE = "0x1FE58A7"; +const String KEY_RPT = "0x1FE10EF"; char lastPressedKey = '\0'; @@ -118,6 +119,9 @@ void handleKeyPress(char pressedKey) { playBuzzer(BUZZER_PIN, TONE_BEEP_TWICE); handleOTARemote(); } + if (pressedKey == 'I') { + printIPInfo(); + } // If pressed number uint8_t currentNumberEntered = pressedKey - '0'; uint8_t lastNumberEntered = lastPressedKey - '0'; @@ -208,6 +212,8 @@ void loop() { pressedKey = 'R'; } else if (hexKey == KEY_MODE) { pressedKey = 'U'; + } else if (hexKey == KEY_RPT) { + pressedKey = 'I'; } if (pressedKey != '\0') { handleKeyPress(pressedKey); diff --git a/src/myOTA.cpp b/src/myOTA.cpp index a81bfed..6f5c0c1 100644 --- a/src/myOTA.cpp +++ b/src/myOTA.cpp @@ -11,9 +11,11 @@ void setupOTALocal() { Serial.println("Booting"); - char infoBuffer[LCD_COLUMNS]; - sprintf(infoBuffer, "W:%s", WIFI_SSID); - showInsideInfo(infoBuffer); + { + 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) { @@ -33,9 +35,11 @@ void setupOTALocal() { }); ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) { Serial.printf("Progress:%u%%\r", (progress / (total / 100))); - char infoBuffer[LCD_COLUMNS]; - sprintf(infoBuffer, "LU:P:%u%%", (progress / (total / 100))); - showInsideInfo(infoBuffer); + { + 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); @@ -44,11 +48,22 @@ void setupOTALocal() { else if (error == OTA_CONNECT_ERROR) Serial.println("Connect Failed"); else if (error == OTA_RECEIVE_ERROR) Serial.println("Receive Failed"); else if (error == OTA_END_ERROR) Serial.println("End Failed"); + showInsideInfo("LU:Failed"); }); ArduinoOTA.begin(); Serial.println("Ready"); Serial.print("IP address:"); Serial.println(WiFi.localIP()); + showInsideInfo("Ready"); +} + +void printIPInfo() { + String localIPStr = WiFi.localIP().toString(); + char localIP[LCD_COLUMNS]; + localIPStr.toCharArray(localIP, LCD_COLUMNS); + char infoBuffer[LCD_COLUMNS]; + sprintf(infoBuffer, "W:%s", localIP); + showInsideInfo(infoBuffer); } void handleOTALocal() { diff --git a/versioning b/versioning index f70d7bb..801f180 100644 --- a/versioning +++ b/versioning @@ -1 +1 @@ -42 \ No newline at end of file +47 \ No newline at end of file