-->
Page 1 of 1

Connecting WiFiManager and ESP8266HTTPUpdateServer

PostPosted: Sat Feb 09, 2019 3:15 pm
by Tooltime
Hi,

I'm trying to extend the WiFi Manager with a possibility to upload new firmware in the config mode.
I do not want to use the Arduino IDE or download from server mode. Just extending the existing API.

I thought it should be straiged forward:
Code: Select allWiFiManager *wm;
ESP8266HTTPUpdateServer httpUpdater;
MyWiFiManager::MyWiFiManager(int resetPin, char* APpassword) {
  wm = new WiFiManager;
  httpUpdater.setup((ESP8266WebServer*)wm->server);
...


My question:
Is this generally a good idea to do it in such a way?
How do I get access to the Webserver?

Thanks in advance for your help!

Tooltime

Re: Connecting WiFiManager and ESP8266HTTPUpdateServer

PostPosted: Sun Feb 10, 2019 7:19 am
by btidey
Normally wifimanager is used to set up the network initially or if the credentials change.

After this if the credentials work then they just get used so it doesn't enter into the wifi manager dialog and would not have an opportunity to load new firmware.

My typical use is to initialise httpUpdate server with a path (and for me normally user/password). E.g. if the path is /firmware then browsing to ip/firmware brings up a simple dialog to select and upload a binary file. I don't use the IDE to try to send new firmware; instead I export a bin file which can then distributed and uploaded separately. You could also extend any existing application web page to have an update link to initiate the process.

If you are trying to do it all via AP then maybe explain further the sequence you want the user to go through.