From 2c35f29c3217d89373532642dfce781204503c4a Mon Sep 17 00:00:00 2001 From: iranl Date: Wed, 1 Jan 2025 19:49:57 +0100 Subject: [PATCH] OTA to alternative (Quad/Octal) PSRAM S3 binary --- src/Config.h | 4 ++++ src/WebCfgServer.cpp | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/src/Config.h b/src/Config.h index 0814eab..ac9014d 100644 --- a/src/Config.h +++ b/src/Config.h @@ -38,6 +38,8 @@ #define GITHUB_BETA_UPDATER_BINARY_URL_DBG (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/debug/beta/nuki_hub_updater_esp32s3oct.bin" #define GITHUB_MASTER_RELEASE_BINARY_URL_DBG (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/debug/master/nuki_hub_esp32s3oct.bin" #define GITHUB_MASTER_UPDATER_BINARY_URL_DBG (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/debug/master/nuki_hub_updater_esp32s3oct.bin" +#define GITHUB_LATEST_RELEASE_BINARY_URL_OTHER (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_esp32s3.bin" +#define GITHUB_LATEST_UPDATER_BINARY_URL_OTHER (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_updater_esp32s3.bin" #define NUKI_HUB_HW (char*)"ESP32-S3 (Octal PSRAM)" #else #define GITHUB_LATEST_RELEASE_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_esp32s3.bin" @@ -52,6 +54,8 @@ #define GITHUB_BETA_UPDATER_BINARY_URL_DBG (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/debug/beta/nuki_hub_updater_esp32s3.bin" #define GITHUB_MASTER_RELEASE_BINARY_URL_DBG (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/debug/master/nuki_hub_esp32s3.bin" #define GITHUB_MASTER_UPDATER_BINARY_URL_DBG (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/debug/master/nuki_hub_updater_esp32s3.bin" +#define GITHUB_LATEST_RELEASE_BINARY_URL_OTHER (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_esp32s3oct.bin" +#define GITHUB_LATEST_UPDATER_BINARY_URL_OTHER (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_updater_esp32s3oct.bin" #define NUKI_HUB_HW (char*)"ESP32-S3" #endif #elif defined(CONFIG_IDF_TARGET_ESP32C6) diff --git a/src/WebCfgServer.cpp b/src/WebCfgServer.cpp index 945c9f6..789b9f5 100644 --- a/src/WebCfgServer.cpp +++ b/src/WebCfgServer.cpp @@ -879,6 +879,12 @@ esp_err_t WebCfgServer::buildOtaHtml(PsychicRequest *request, PsychicResponse* r response.print("

"); response.print("

"); response.print("

"); + #if defined(CONFIG_IDF_TARGET_ESP32S3) + if(esp_psram_get_size() <= 0) + { + response.print("

"); + } + #endif response.print("

"); response.print("Current version: "); @@ -5128,6 +5134,14 @@ esp_err_t WebCfgServer::processUpdate(PsychicRequest *request, PsychicResponse* _preferences->putString(preference_ota_main_url, GITHUB_MASTER_RELEASE_BINARY_URL); } } + #if defined(CONFIG_IDF_TARGET_ESP32S3) + else if(request->hasParam("other")) + { + res = buildConfirmHtml(request, resp, "Rebooting to update Nuki Hub and Nuki Hub updater
Updating to latest RELEASE version", 2, true); + _preferences->putString(preference_ota_updater_url, GITHUB_LATEST_UPDATER_BINARY_URL_OTHER); + _preferences->putString(preference_ota_main_url, GITHUB_LATEST_RELEASE_BINARY_URL_OTHER); + } + #endif else { if(request->hasParam("debug"))