-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update SPIFFS #25
Comments
This function is not party off the aim of this library , Maybe look at UDHttp ? name=UDHttp `#include "UDHttp.h" int wdataf(uint8_t *buffer, int len){ void progressf(int percent){ Serial.print("Initializing SD card..."); |
SPIFFS could eventually be brought into the scope of this library with little effort: the second argument of Update.begin() is the partition type. So it would only be a matter of adding a json entry (e.g. |
Why not join forces? I recommend esp32FOTA integrates what @tobozo has created: taking a gzipped binary and decompressing the stream directly to the OTA partition. Minimizes payload, no SPIFFS / persistence of the firmware before update. esp32FOTA could handle the wrap-around http/https, optional checking if fw version is > than what's currently there (if the developer wants to put a version json file -- or not). I wanted to protect my gzipped binary in transit, so I have an https server with a complex basic auth pw. I DO store my cert in SPIFFS but it could be baked into flash. I do NOT have a json file specifying version, but that could be trivially added. esp32FOTA could take the cert and optional creds as a params to a secure function for users:
You could also provide examples of how to prop a simple http server and gzip the bin. It's pretty trivial but daunting for many. On ubuntu, for example, I have a gist that automates this:
This entire effort could be a great solution: trivial calls to esp32FOTA for secure and insecure, compressed and not compressed, version checking or not, example of how to provision a server to serve gzipped binaries, securely. Both project are great work. Perhaps esp32FOTA leveraging esp32-targz is a marriage made in heaven? |
@scubachristopher sure let's join forces :-) here are some implementation ideas based on your input:
|
I think its a plan , at the moment I don't have the time to assist much |
Just implemented the code so it compiles without errors and warnings, I'll keep this on my fork until this is properly tested but it should already be usable: https://github.com/tobozo/esp32FOTA Usage: {
"type": "esp32-fota-http",
"version": 2,
"host": "192.168.0.100",
"port": 80,
"bin": "/fota/esp32-fota-http-2.ino.bin",
"spiffs": "/fota/esp32-fota-http-2.spiffs.bin"
} I also had those random ideas (for the far-far-away future) while working on the code:
|
see #47 |
Hey @tobozo ! I tried your version today since I have both SPIFFS and BIN that I want to be able to update. Im not 100% sure about your version. If I put in both a bin and spiffs path. It will only update SPIFFS. Removing SPIFFS path will update BIN. The major issue with this is that updating SPIFFS do not increment the bin version so it will send the update to a loop downloading the SPIFFS over and over again. Am I missing something or how is this supposed to work? I guess I need a SPIFFS version and a BIN version somewhere so it know which one to update? Any good idea? |
hey @ludvigaldrin whoops totally forgot I had a fork in progress :) as far as I remember, this mod used I should probably restart from scratch using a fresh fork, will see what I can do in September |
ping @scubachristopher last commit on the ongoing PR #92 implements the injection of custom http headers during the queries as per your earlier suggestion. Should this PR be conclusive, the next milestone will consist in getting esp32fota to work with gz/targz files, which will bring me to these tasks:
|
Implemented in 0.2.0. Keeping the issue open as gz/targz support is still being worked on (0.2.1 version coming sooon ^^) |
bump gzip and zlib support are implemented in 0.2.3, and there won't be any |
Hello,
You work like very elegant ! I juste have a question.
It is possible to update SPIFFS ?
I need to update FW and SPIFFS.
Best,
The text was updated successfully, but these errors were encountered: