Skip to content

Commit

Permalink
Merge pull request #202 from marcelrv/patch-1
Browse files Browse the repository at this point in the history
fix platformio_upload.py for SPIFFS
  • Loading branch information
ayushsharma82 authored Oct 21, 2024
2 parents 1ba51eb + 9d44828 commit 293bf1c
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 293bf1c

Please sign in to comment.