ayushsharma82 / ElegantOTA

OTA updates made slick and simple for everyone!
https://elegantota.pro
GNU Affero General Public License v3.0
643 stars 119 forks source link

fix platformio_upload.py for SPIFFS #202

Closed marcelrv closed 1 month ago

marcelrv commented 4 months ago

Allows the script to upload files system images

freman commented 4 months ago

Might I suggest a slightly different approach.

I'm not sure when this became a default but my envs all have "Upload Filesystem Image OTA" as a task now, this task target is called "uploadfsota" - this would seem to work with that configuration regardless of if it's spiffs or littlefs

        urlMode = "fs" if str(target[0]) == "uploadfsota" else "fr"

        # Führe die GET-Anfrage aus
        start_url = f"{upload_url}/ota/start?mode={urlMode}&hash={md5}"
marcelrv commented 4 months ago

Might I suggest a slightly different approach.

I'm not sure when this became a default but my envs all have "Upload Filesystem Image OTA" as a task now, this task target is called "uploadfsota" - this would seem to work with that configuration regardless of if it's spiffs or littlefs

        urlMode = "fs" if str(target[0]) == "uploadfsota" else "fr"

        # Führe die GET-Anfrage aus
        start_url = f"{upload_url}/ota/start?mode={urlMode}&hash={md5}"

yes, that would work, but indeed I did not chose that way as there are 2 filesystem uploads. The non-ota one does not work if the custom script is there. Hence by using the file name based approach both filesystem uploads are working.

freman commented 4 months ago

oh, I didn't encounter that, I keep my ota and non-ota in seperate envs.

github-actions[bot] commented 3 months ago

This PR is marked as stale because it has been open 45 days with no activity. You can remove stale label or comment if this PR is still valid.