Chat here about code rewrites, mods, etc... with respect to the github project https://github.com/esp8266/Arduino

Moderator: igrr

User avatar
By zmink
#43070 Hi all,

I've been working on integrating the HTTPUpdateServer into my esp arduino based project, and I've hit a snag. I get the following error during compilation:

no matching function for call to 'ESP8266HTTPUpdateServer::setup(WiFiServer*)'

The difference between my code and the example sketch is that I am using "WiFiServer" library to create a web server and handle http requests and it looks like the ESP8266WebServer library, which is used in the example, is different.

My question is, does anyone have a recommendation on the best path forward on this? Should I try to convert my code from using WiFi to use WebServer or should I do something else. I wasn't able to look into the libraries themselves yet, but could anyone comment on the actual differences?

Thanks for any thoughts!
User avatar
By zmink
#43172 To answer my own issue - it turns out that both the WebServer and WiFiServer libraries will work if run on different ports! For my application, running the webserver on an ephemeral port made a lot of sense. Therefore, I just set the upload server to run on a high port number and kept the original HTTP related code to run on port 80. This was great for me because I could keep two separate objects running and have separate chunks of code need to be rewritten or libraries extended. MDNS will still work for both port numbers as well, I believe as long as mdns.addService is used to add the port number.. Hope this helps someone else!
User avatar
By nikant
#43223
zmink wrote:To answer my own issue - it turns out that both the WebServer and WiFiServer libraries will work if run on different ports! For my application, running the webserver on an ephemeral port made a lot of sense. Therefore, I just set the upload server to run on a high port number and kept the original HTTP related code to run on port 80. This was great for me because I could keep two separate objects running and have separate chunks of code need to be rewritten or libraries extended. MDNS will still work for both port numbers as well, I believe as long as mdns.addService is used to add the port number.. Hope this helps someone else!


wow.. thanks for this info! I was wondering about something like this in order to work around some issues on a project I have in mind