ESP8266HTTPUpdateServer - Can I make my own Form?
Posted: Fri Mar 17, 2017 2:44 pm
Hi,
I have a small ESP project. I have build a small webinterface just to display some information and a few other small things. For navigation I added some buttons to the top of the webinterface. If one is clicked, the content is loaded via javascript to an div below the buttons by replacing an String in this div (%%CONTENT%%) by the to displayed data. Therefor I used a modification of the code from this page: http://www.john-lassen.de/en/projects/e ... -webconfig
When one of the buttons is clicked, the js function setValues(string) is called. The given parameter "string" contains a string in the format "id|content|type". In setValues these information get parsed out of the string and the element (of DOM) with the id "id" will be replaced by the value of "content" (type is just the type of element, in my case div). So far so good...
I just added OTA functionality to my ESP Project, so that I can visit http://IP/update to update it.
Now the question is, is it possible to load the update formular via javascript like I descriped before to get it loaded in the div like everything else in my webinterface? So normaly I would just add the HTML code of the inputfield for the update.bin-file and the update-button to an variable in my code, put an "id|" at the beginning and an "|div" at the end.
But how can I tell the buton to start the update after uploading the binary? Which function do I have to call?
Sadly there is didn't find a documentation for the ESP8266HTTPUpdate library, just this page http://esp8266.github.io/Arduino/versions/2.0.0/doc/ota_updates/ota_updates.html, but there is no description how to modify it, just how to use it.
Thanks for your help!
I have a small ESP project. I have build a small webinterface just to display some information and a few other small things. For navigation I added some buttons to the top of the webinterface. If one is clicked, the content is loaded via javascript to an div below the buttons by replacing an String in this div (%%CONTENT%%) by the to displayed data. Therefor I used a modification of the code from this page: http://www.john-lassen.de/en/projects/e ... -webconfig
When one of the buttons is clicked, the js function setValues(string) is called. The given parameter "string" contains a string in the format "id|content|type". In setValues these information get parsed out of the string and the element (of DOM) with the id "id" will be replaced by the value of "content" (type is just the type of element, in my case div). So far so good...
I just added OTA functionality to my ESP Project, so that I can visit http://IP/update to update it.
Now the question is, is it possible to load the update formular via javascript like I descriped before to get it loaded in the div like everything else in my webinterface? So normaly I would just add the HTML code of the inputfield for the update.bin-file and the update-button to an variable in my code, put an "id|" at the beginning and an "|div" at the end.
But how can I tell the buton to start the update after uploading the binary? Which function do I have to call?
Sadly there is didn't find a documentation for the ESP8266HTTPUpdate library, just this page http://esp8266.github.io/Arduino/versions/2.0.0/doc/ota_updates/ota_updates.html, but there is no description how to modify it, just how to use it.
Thanks for your help!