Hi Sara|Rui,
Thank you for your usefull Module 12 Unit 5, ESP32 Over-the-air (OTA) Programming – Web Updater.
Your example sketch realy works very nice. But …
My sketch uses ESPAsyncWebServer.h and my Async Web Server has been working up … to now.
Now, when I include OTA code (based on your example) to my sketch, then compiler reports error.
My problem is not that application does not work, my problem is compilation error. For example here:
// WebServer serverOTA(3232); // declared somewhere in previous code serverOTA.on("/", HTTP_GET, []() { serverOTA.sendHeader("Connection", "close"); serverOTA.send(200, "text/html", loginIndex); });
Compilation error:
no matching function for call to ‘WebServer::on(const char [2], WebRequestMethod, setup()::<lambda()>)’
When I remove only one of these two libraries and relevant code (AsyncWebServer section or WebServer section), then the remaining part of code works well. But not both together. In other words – when I remove ESPAsyncWebServer library & relevant code, there is no compilation error and remaining part of code (Web Updater) works fine, but my Async Web Server does not work of course … and vice versa.
It seems that these two libraries are not to be compatible with each other. What do you mean?
My questions:
- Is it possible use AsyncWebServer and WebServer libraries simultaneously?
- If not, are you able please to rebuild your Web Updater under AsyncWebServer library?
Thanks in advance for your advice.
Hello, I need a few more details:
- Please post the full code that you’ve tried to upload and it’s failing to compile (remove your network credentials)
- What’s the ESP32 board add-on that you have installed in your Arduino IDE?
- Can you update the ESPAsyncWebServer and the AsyncTCP libraries?
Recently that were some changes that require all libraries updated in order for the code to compile properly. Regards,
Rui