WirelessPrinting icon indicating copy to clipboard operation
WirelessPrinting copied to clipboard

Implement Web Server OTA (https)

Open probonopd opened this issue 5 years ago • 15 comments

Currently it is cumbersome to update the firmware. It would be nice if one could update from the HTTP interface directly with the firmware being downloaded from a https link

We should get as the default firmware URL the latest GitHub Release, from https://api.github.com/repos/probonopd/WirelessPrinting/releases [0]["assets"][0]["browser_download_url"] but we should alsohave the possibility to load from custom URLs.

  • https://github.com/esp8266/Arduino/issues/1021
  • https://gist.github.com/igrr/24dd2138e9c8a7daa1b4
  • ESPhttpUpdate.update(String(host),httpsPort,String(url),String(""),String(fingerprint));

probonopd avatar Feb 28 '19 20:02 probonopd

Could also implement uploading the firmware via a web form: https://github.com/me-no-dev/ESPAsyncWebServer/issues/35

probonopd avatar Mar 02 '19 09:03 probonopd

We should get as the default firmware URL the latest GitHub Release, from https://api.github.com/repos/probonopd/WirelessPrinting/releases [0]["assets"][0]["browser_download_url"]

@yknivag seems to have been working on this at https://github.com/yknivag/test/blob/master/temp/temp.ino

Indeed it would be good to turn this type of functionality into an easy-to-consume library.

Also see https://gist.github.com/yknivag/2707e27787abeafa69b33c4e9d043c3a

probonopd avatar Mar 02 '19 12:03 probonopd

Any thoughts about using ElegantOTA ? It will provide a pleasant UI for uploading OTAs.

https://github.com/ayushsharma82/ElegantOTA

ayushsharma82 avatar Apr 24 '19 17:04 ayushsharma82

Thanks for the pointer @ayushsharma82. I was not aware of ElegantOTA so far but it does look elegant indeed.

  • We are using AsyncHTTPServer in this project. Would this work for ElegantOTA?
  • Would using ElegantOTA provide any benefit over our current web OTA plus using ESP-DASH for a better UI?

probonopd avatar Apr 24 '19 17:04 probonopd

It works with default Webserver of ESP. But it should take about an hour to port it to AsyncWebServer. I will develop a Async Version Soon.

Currently there is just one benefit, It shows progress of OTA via a progress bar on webpage and shows a good and clear status when OTA is done. ElegantOTA is certainly for beauty purposes only. 😄

ayushsharma82 avatar Apr 24 '19 17:04 ayushsharma82

I will develop a Async Version Soon.

Cool. Please let me know when it is available.

It shows progress of OTA via a progress bar

Definitely an advantage.

Does updating work using the command line (e.g., wget/curl) too, like our current solution?

probonopd avatar Apr 24 '19 17:04 probonopd

Yes, In fact the webpage does the same but with a AJAX Request to a upload URL.

ayushsharma82 avatar Apr 24 '19 18:04 ayushsharma82

@probonopd Just Released AsyncElegantOTA , It works on AsyncWebServer and has support for both esp8266 and esp32.

https://github.com/ayushsharma82/AsyncElegantOTA

ayushsharma82 avatar May 02 '19 04:05 ayushsharma82

@ayushsharma82 that's great news. Would you like to give it a try to integrate it into WirelessPrinting?

probonopd avatar May 02 '19 05:05 probonopd

@probonopd Created a Pull Request. Edit travis cli to copy AsyncElegantOTA repo for successful builds. https://github.com/probonopd/WirelessPrinting/pull/118

ayushsharma82 avatar May 02 '19 06:05 ayushsharma82

Apologies for the very late reply, but I think I now have this working. See https://github.com/yknivag/ESP_OTA_GitHub

yknivag avatar Nov 13 '19 23:11 yknivag

Wow this is useful. Would you like to send a pull request to this repository incorporating it @yknivag?

probonopd avatar Nov 14 '19 00:11 probonopd

Thank you for your appreciation and excitement. :-)

I only just got it working yesterday after waiting 6 months for a bug fix to the ESPhttpUpdate library.

I think maybe a some more thorough testing is in order before I would be presumptuous enough to submit a PR with it to someone else's project. It's definitely a beta atm!

Please do feel free to test it out though, but I would keep it in your dev branch until there is a release on the repo.

yknivag avatar Nov 14 '19 09:11 yknivag

@yknivag is it still working and being maintained?

probonopd avatar Apr 26 '22 21:04 probonopd

@probonopd It was still working last time I checked it. I haven't had cause to use it myself for a little while due to working on other things, but I see no reason why the library shouldn't still work.

yknivag avatar Apr 27 '22 14:04 yknivag