Latest ESP Async WebServer library breaks working sketches

I have several working sketches that use the ESP Async WebServer library v.3.7.2. A few days ago I was offered an upgrade to v.3.7.3 but my sketches, which work perfectly with v.3.7.2, wouldn't compile with this update. So I reverted back to v 3.7.2. Now v. 3.7.4 is available but my sketches will not compile with that either. What is going on?

1 Like

Hi @steveinaustria. I'm going to ask you to provide the full output from a compilation.


:red_exclamation_mark: This procedure is not intended to solve the problem. The purpose is to gather more information.


Please do this:

  1. Open one of the sketches that were impacted by the update in Arduino IDE.
  2. If you rolled back to version 3.7.2 of the "ESP Async WebServer" library, use Library manager to update it to 3.7.4 again.
  3. Select Sketch > Verify/Compile from the Arduino IDE menus.
  4. Wait for the compilation to fail.
  5. You will see a "Compilation error: ..." notification at the bottom right corner of the Arduino IDE window. Click the "COPY ERROR MESSAGES" button on that notification.
  6. Open a forum reply here by clicking the "Reply" button.
  7. Click the <CODE/> icon on the post composer toolbar.
    This will add the forum's code block markup (```) to your reply to make sure the error messages are correctly formatted.
  8. Press the Ctrl+V keyboard shortcut (Command+V for macOS users).
    This will paste the compilation output into the code block.
  9. Move the cursor outside of the code block markup before you add any additional text to your reply.
  10. Click the "Reply" button to post the output.

In case the output is longer than the forum software will allow to be added to a post, you can instead save it to a .txt file and then attach that file to a reply here.

Click here for attachment instructions

  1. Open any text editor program.
  2. Paste the copied output into the text editor.
  3. Save the file in .txt format.
  4. Open a forum reply here by clicking the "Reply" button.
  5. Click the "Upload" icon (Upload icon) on the post composer toolbar:

    The "Open" dialog will open.
  6. Select the .txt file you saved from the "Open" dialog.
  7. Click the "Open" button.
    The dialog will close.
  8. Click the "Reply" button to publish the post.

Alternatively, instead of using the "Upload" icon on the post composer toolbar as described in steps (5) - (7) above, you can simply drag and drop the .txt file onto the post composer field to attach it.

In file included from /home/stevetux/Arduino/3_Heltec/Heltec_Webserver_BMP180/Heltec_Webserver_BMP180.ino:10: /home/stevetux/Arduino/libraries/ESP_Async_WebServer/src/ESPAsyncWebServer.h: In member function 'tcp_state AsyncWebServer::state() const': /home/stevetux/Arduino/libraries/ESP_Async_WebServer/src/ESPAsyncWebServer.h:1107:49: error: passing 'const AsyncServer' as 'this' argument discards qualifiers [-fpermissive] 1107 | return static_cast<tcp_state>(_server.status()); | ~~~~~~~~~~~~~~^~ In file included from /home/stevetux/Arduino/3_Heltec/Heltec_Webserver_BMP180/Heltec_Webserver_BMP180.ino:9: /home/stevetux/Arduino/libraries/AsyncTCP/src/AsyncTCP.h:198:13: note: in call to 'uint8_t AsyncServer::status()' 198 | uint8_t status(); | ^~~~~~ Mehrere Bibliotheken wurden für "WiFi.h" gefunden Benutzt: /home/stevetux/.arduino15/packages/Heltec-esp32/hardware/esp32/3.0.2/libraries/WiFi Nicht benutzt: /home/stevetux/Arduino/libraries/WiFiNINA exit status 1 Compilation error: exit status 1 

I see you are using an outdated version of the "Async TCP" library.

The latest versions of the ESP Async WebServer library must be used with a recent version of the Async TCP library. The older versions are not compatible.

I believe this is the specific relevant change:

So use Library Manager to update the Async TCP library to the latest version (currently 3.3.8) and then try compiling your sketch again with ESP Async WebServer 3.7.4. Hopefully this time it will be successful and everything will work as before.

I installed the Async TCP library v 3.3.8 and ESP Async WebServer 3.7.4., however my sketches (which work fine under ESP Async WebServer 3.7.2.) still won't compile. Here is the error message:

In file included from /home/stevetux/Arduino/3_Heltec/Heltec_Webserver_BMP180/Heltec_Webserver_BMP180.ino:10: /home/stevetux/Arduino/libraries/ESP_Async_WebServer/src/ESPAsyncWebServer.h: In member function 'tcp_state AsyncWebServer::state() const': /home/stevetux/Arduino/libraries/ESP_Async_WebServer/src/ESPAsyncWebServer.h:1107:49: error: passing 'const AsyncServer' as 'this' argument discards qualifiers [-fpermissive] 1107 | return static_cast<tcp_state>(_server.status()); | ~~~~~~~~~~~~~~^~ In file included from /home/stevetux/Arduino/3_Heltec/Heltec_Webserver_BMP180/Heltec_Webserver_BMP180.ino:9: /home/stevetux/Arduino/libraries/AsyncTCP/src/AsyncTCP.h:198:13: note: in call to 'uint8_t AsyncServer::status()' 198 | uint8_t status(); | ^~~~~~ Mehrere Bibliotheken wurden für "WiFi.h" gefunden Benutzt: /home/stevetux/.arduino15/packages/Heltec-esp32/hardware/esp32/3.0.2/libraries/WiFi Nicht benutzt: /home/stevetux/Arduino/libraries/WiFiNINA Mehrere Bibliotheken wurden für "AsyncTCP.h" gefunden Benutzt: /home/stevetux/Arduino/libraries/AsyncTCP Nicht benutzt: /home/stevetux/Arduino/libraries/Async_TCP exit status 1 Compilation error: exit status 1 

Download both libraries from github as zip and install them manually (from me-no-dev).

We can see the problem here:

You have the "AsyncTCP" library installed in addition to the "Async TCP" library (note the space in the name of the latter). The ESP Async WebServer library is written for use with the Async TCP, but the AsyncTCP library was selected by the Arduino sketch build system during library discovery.

If you don't need the AsyncTCP library for other projects, then the easiest solution will be to uninstall it:

  1. Select Sketch > Include Library > Manage Libraries... from the Arduino IDE menus to open the "Library Manager" view in the left side panel.
  2. Type AsyncTCP in the "Filter your search..." field.
  3. Scroll down through the list of libraries until you see the "AsyncTCP" entry.
  4. Hover the mouse pointer over the "AsyncTCP" entry.
  5. You will see a ●●● icon appear near the top right corner of the library entry. Click on that icon.
    A context menu will open.
  6. Select "Remove" from the menu.
    An "Uninstall" dialog will open.
  7. Click the "YES" button in the "Uninstall" dialog to confirm that you want to uninstall the library.
    The dialog will close.
  8. Wait for the uninstall process to finish, as indicated by a notification at the bottom right corner of the Arduino IDE window:

    ⓘ Successfully uninstalled library ...

After that, try compiling the sketch again.


If you do need the AsyncTCP library, just let me know and I'll suggest an alternative solution that will cause the sketch build system to select the Async TCP library instead of the AsyncTCP library.

1 Like

That fixed it. I'm not sure whether I have sketches that need the AsyncTCP library, but if I have we can cross that bridge when we come to it. Thanks for your expert help once again!

1 Like

You are welcome. I'm glad it is working now.

Regards, Per

@ptillisch, exactly which ESP Async WebServer are you referring to? I ask because the library manager offers multiple possibilities all with similar names. A web search produces even more that aren't in the library manager. Most seem to fork form a some version of me-no-dev's library, but all of different. There's also the Mathieu Carbou Version that appears to be actively maintained. But, it's not at v3.7.4. So which one is under discussion here?

EDIT:
Never mind, found it HERE.

Thanks a lot for this information. I have several solar projects running using ESP Async WebServer and remote debug (webserial) and OTP and I got problems when recompiling software!!
Now it works again with v 3.7.4. and new Arduino IDE 2.3.5 as well. :slight_smile:

1 Like

Thank you so much ptilisch, I've been trying to fix this error for over 2 hours now and then came across this forum. I had AsyncTCP and Async TCP installed. I also had ESP Async WebServer and ESPAsyncWebServer installed. I removed AsyncTCP and ESPAsyncWebServer and it compiled fine. The funny thing is.... I don't remember installing different but similar libraries. I've been working with the ESP32 ranges for a good while now and they all compiled fine until lately.

1 Like

has anyone got any combination of these libraries working with ESP32 core 3.2.0?

e.g.
using AsyncTCP 1.1.4 ESPAsyncWebServer 3.1.0 and ESP32 core 2.0.17
File>Examples>ESPAsyncWebServer>simple_server cpmpiles, links, loads and runs OK

with ESP32 core 3.2.0 I get compile time errors

c:\Users\bb\Documents\Arduino\libraries\ESPAsyncWebServer\src\WebAuthentication.cpp: In function 'bool getMD5(uint8_t*, uint16_t, char*)': c:\Users\bb\Documents\Arduino\libraries\ESPAsyncWebServer\src\WebAuthentication.cpp:74:3: error: 'mbedtls_md5_starts_ret' was not declared in this scope; did you mean 'mbedtls_md5_starts'? 74 | mbedtls_md5_starts_ret(&_ctx); | ^~~~~~~~~~~~~~~~~~~~~~ | mbedtls_md5_starts c:\Users\bb\Documents\Arduino\libraries\ESPAsyncWebServer\src\WebAuthentication.cpp:75:3: error: 'mbedtls_md5_update_ret' was not declared in this scope; did you mean 'mbedtls_md5_update'? 75 | mbedtls_md5_update_ret(&_ctx, data, len); | ^~~~~~~~~~~~~~~~~~~~~~ | mbedtls_md5_update c:\Users\bb\Documents\Arduino\libraries\ESPAsyncWebServer\src\WebAuthentication.cpp:76:3: error: 'mbedtls_md5_finish_ret' was not declared in this scope; did you mean 'mbedtls_md5_finish'? 76 | mbedtls_md5_finish_ret(&_ctx, _buf); | ^~~~~~~~~~~~~~~~~~~~~~ | mbedtls_md5_finish