Page 1 of 1

webserver to ota

Posted: Wed Dec 19, 2018 2:35 pm
by burkulesomesh43
Hi all,
I want to ota update by uploading file from webserver.
here is my html code for webserver->>

Code: Select all


"<!DOCTYPE html>"
"<html>"
"<body>"
"<form action=\"/cf\" method=\"post\" enctype=\"multipart/form-data\">"
    "Select image to upload:"
    "<input type=\"file\" name=\"fileToUpload\" id=\"fileToUpload\">"
    "<input type=\"submit\" value=\"Upload Image\" name=\"submit\">"
"</form>"
"</body>"
"</html>";
I upload bin file from webserver but dont know how to recieve it and use for ota update.
I used it with netconn_recv();

Re: webserver to ota

Posted: Wed Dec 19, 2018 5:32 pm
by fly135
Use esp_https_ota in IDF. It ony takes about 4 lines of code.

Re: webserver to ota

Posted: Wed Dec 19, 2018 6:21 pm
by burkulesomesh43
fly135 wrote:
Wed Dec 19, 2018 5:32 pm
Use esp_https_ota in IDF. It ony takes about 4 lines of code.
Yes, but I want upload bin file by selecting it from system using webserver browse selection..
And as I upload it from webserver, the bin file should be uploaded to esp32 and used for ota.
So that I have to pass that file to ota write.

Re: webserver to ota

Posted: Wed Dec 19, 2018 7:34 pm
by chegewara

Re: webserver to ota

Posted: Thu Dec 20, 2018 3:27 pm
by fly135
burkulesomesh43 wrote:
Wed Dec 19, 2018 6:21 pm
fly135 wrote:
Wed Dec 19, 2018 5:32 pm
Use esp_https_ota in IDF. It ony takes about 4 lines of code.
Yes, but I want upload bin file by selecting it from system using webserver browse selection..
And as I upload it from webserver, the bin file should be uploaded to esp32 and used for ota.
So that I have to pass that file to ota write.
Can you just get your web server to return a filename or URL to file on server? Then use 4 lines of code to do the OTA. I have a linux box running Apache that I OTA from all the time.