letscontrolit / ESPEasy

Easy MultiSensor device based on ESP8266/ESP32
http://www.espeasy.com
Other
3.22k stars 2.19k forks source link

OTA batch like #855 #2155

Open fly74 opened 5 years ago

fly74 commented 5 years ago

Is it planend to make OTA flashs with a batch job?

2 things would be the requirements:

Just a feature request.

fly74 commented 4 years ago

Is there some new out there? Only to ask.

TD-er commented 4 years ago

Well I did write this PR also with the intent to improve deployment. What I am working to is this:

This combined may also allow us to temporary remove all settings from a node and then automatic re-init by formatting SPIFFS and restoring the settings for that specific node. On 1M nodes it does give a bit more room for the 2-step OTA if the SPIFFS does not have to survive. Also other nodes in the network could act as a source/resource to store the firmware images and/or settings so you can also do this on locations with limited (or no guaranteed) bandwidth or uptime and also remain independent of external resources like "the cloud".

But it is still in its infancy state and a lot has to be done. This "Settings Archive" stuff is just the first step.

fly74 commented 3 years ago

Is there a way maybe to provide a upload function in combination with wget , curl or... from a commandline?

TD-er commented 3 years ago

No idea why not. It is just a HTTP POST message.

Just fetched the raw headers from my browser's inspect window when performing an update:

Request URL: http://192.168.10.231/update
Request Method: POST
Status Code: 200 OK
Remote Address: 192.168.10.231:80
Referrer Policy: strict-origin-when-cross-origin
HTTP/1.1 200 OK
Content-Type: text/html
Content-Length: 74
Connection: close
POST /update HTTP/1.1
Host: 192.168.10.231
Connection: keep-alive
Content-Length: 917390
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
Origin: http://192.168.10.231
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryBB49jWHetA2p7Q6V
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Referer: http://192.168.10.231/update
Accept-Encoding: gzip, deflate
Accept-Language: nl,en-US;q=0.9,en;q=0.8

So using curl will be something like this: (not tested)

curl -F ‘file=@path/to/local/file’ UPLOAD_ADDRESS
fly74 commented 3 years ago

Is it for the 2 step OTA possible too?

fly74 commented 3 years ago

But for 2 step must https://github.com/letscontrolit/ESPEasy/issues/2936 be solved

TD-er commented 3 years ago

I know.... And that one requires also a rebuild of the 2-step OTA image, which will probably give a lot of new issues to make it fit.