From 9d448288e6357733b06b3faa748b258183f0a7d7 Mon Sep 17 00:00:00 2001 From: Marcel Date: Fri, 28 Jun 2024 19:47:34 +0200 Subject: [PATCH] fix platformio_upload.py for SPIFFS Allows the script to upload files system images --- platformio_upload.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/platformio_upload.py b/platformio_upload.py index 467f219..4ed872b 100644 --- a/platformio_upload.py +++ b/platformio_upload.py @@ -42,8 +42,11 @@ def on_upload(source, target, env): parsed_url = urlparse(upload_url) host_ip = parsed_url.netloc - # Führe die GET-Anfrage aus - start_url = f"{upload_url}/ota/start?mode=fr&hash={md5}" + is_spiffs = source[0].name == "spiffs.bin" + file_type = "fs" if is_spiffs else "fr" + + # execute GET request + start_url = f"{upload_url}/ota/start?mode={file_type}&hash={md5}" start_headers = { 'Host': host_ip, @@ -137,4 +140,4 @@ def on_upload(source, target, env): tqdm.write(message) -env.Replace(UPLOADCMD=on_upload) \ No newline at end of file +env.Replace(UPLOADCMD=on_upload)