Skip to content

Commit

Permalink
fix platformio_upload.py for SPIFFS
Browse files Browse the repository at this point in the history
Allows the script to upload files system images
  • Loading branch information
marcelrv authored Jun 28, 2024
1 parent df96d04 commit 9d44828
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions platformio_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -137,4 +140,4 @@ def on_upload(source, target, env):
tqdm.write(message)


env.Replace(UPLOADCMD=on_upload)
env.Replace(UPLOADCMD=on_upload)

0 comments on commit 9d44828

Please sign in to comment.