From bcbdaa7d2afaf1538a0a47d8ffdd9e523d916463 Mon Sep 17 00:00:00 2001 From: Vladyslav Heneraliuk Date: Mon, 23 Dec 2024 14:28:49 +0200 Subject: [PATCH] added 'jaam' firmware url handling --- deploy/update_server/update_server.py | 22 ++++++++++++++++++++++ updater/src/updater.cpp | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/deploy/update_server/update_server.py b/deploy/update_server/update_server.py index 1c95e61e..5801c301 100644 --- a/deploy/update_server/update_server.py +++ b/deploy/update_server/update_server.py @@ -110,6 +110,17 @@ async def update(request): ) filenames = [filename for filename in filenames if not filename.startswith("4.")] return FileResponse(f"{shared_path}/{filenames[0]}") + if request.path_params["filename"] == "jaam": + filenames = sorted( + [ + file + for file in os.listdir(shared_path) + if (os.path.isfile(os.path.join(shared_path, file)) and file.endswith(".bin")) + ], + key=bin_sort, + reverse=True, + ) + return FileResponse(f"{shared_path}/{filenames[0]}") return FileResponse(f'{shared_path}/{request.path_params["filename"]}.bin') @@ -126,6 +137,17 @@ async def update_beta(request): ) filenames = [filename for filename in filenames if not filename.startswith("4.")] return FileResponse(f"{shared_beta_path}/{filenames[0]}") + if request.path_params["filename"] == "jaam_beta": + filenames = sorted( + [ + file + for file in os.listdir(shared_path) + if (os.path.isfile(os.path.join(shared_path, file)) and file.endswith(".bin")) + ], + key=bin_sort, + reverse=True, + ) + return FileResponse(f"{shared_path}/{filenames[0]}") return FileResponse(f'{shared_beta_path}/{request.path_params["filename"]}.bin') diff --git a/updater/src/updater.cpp b/updater/src/updater.cpp index 97f57434..5b79f839 100644 --- a/updater/src/updater.cpp +++ b/updater/src/updater.cpp @@ -14,7 +14,7 @@ const char* userSsid = ""; // WIFI-мережа замовника const char* userPassword = ""; // Пароль до WIFI мережі замовника -const char* firmwareUrl = ""; +const char* firmwareUrl = "http://jaam.net.ua:2095/jaam.bin"; String identifier = "github";