Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
  • 07:08
    Zimbu98 edited #1174
  • 06:35
    Zimbu98 edited #1174
  • 06:35
    Zimbu98 opened #1174
  • Jul 01 16:18
    Mark-81 closed #1173
  • Jul 01 15:59
    Mark-81 commented #1173
  • Jul 01 15:28
    Mark-81 commented #1173
  • Jul 01 13:47
    Pablo2048 commented #1173
  • Jul 01 13:04
    Mark-81 opened #1173
  • Jun 30 13:58
    maxgerhardt commented #970
  • Jun 30 13:34
    glennswest commented #1167
  • Jun 30 10:25
    MassiPi commented #1167
  • Jun 27 23:02
    rblilja commented #1172
  • Jun 27 22:43
    rblilja opened #1172
  • Jun 27 09:33
    hyansuper commented #1082
  • Jun 27 06:51
    hyansuper commented #303
  • Jun 27 06:48
    hyansuper commented #303
  • Jun 25 11:18
    BlueAndi commented #1169
  • Jun 24 16:22
    vatsake closed #1171
  • Jun 24 16:22
    vatsake commented #1171
  • Jun 24 14:09
    zekageri commented #1171
Artonworks TM

I just couldn't find any working examples for TLS so I made an example sketch for TLS WebServer using this library.
Check it out here: https://gitlab.com/artonworkstm/asyncwebservertls

Also want to fasten up a bit the request process by caching sessions so there is no need to redo the whole handshake at every request.
Do you guys know how may I achieve that?
I found it in the ESP8266WiFi library that you can use there (tho I couldn't make it work).
The Session class is here at line 139: https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266WiFi/src/BearSSLHelpers.h

1 reply
I would like to serve following files as gzipped with the severStatic-method. Is this possible?
In the folder "fs" I have placed "all.min.css" and fonts from fontawesome. Do these files also have to be compressed in the folders?
My websever works fine most of the time. But rarely it crashes when an new client is involved. I use SPIFFS (data-directory)
for the files.
@chrgweber If you want to serve them gzipped then yes, they have to be gzipped. Also set the Content-Encoding: gzip header.
And Content-Type: application/javascript for jQuery.min
Diego Bonilla
I have had no luck finding a websocket example using ESP32 as client, all the examples I found are with a web/browser based client, do you have any examples of creating a basic esp32 websocket client and server? thank you
István Horváth
if (request->contentType().equals("application/json")) {

István Horváth
@openedhardware Are you trying with mDNS? Because it won't work on mobile browsers, you should use IP address.
Hello, can anyone give me a hint about a little problem, i have splitet html code in progmem chars, and would send it, my way dont work, what is the right?
    server.on("/", HTTP_GET, [](AsyncWebServerRequest *request)
                request->send_P(200, "text/html", HTMLhead);
                request->send_P(200, "text/html", HTMLmain);
                request->send_P(200, "text/html", HTMLfoot);
István Horváth
@softwarecrash Is this sends at least one part? like the HTMLhead? if so I would concatenate the three parts into one and send it that way.
@armogur_gitlab yes, one part. its a website splittet in head, main contenct (or other content) and foot, head and foot i have seperated to reuse on other pages. the head etc is - "const char HTMLhead[] PROGMEM" type. i dont find a way to concate it without use a lot of memory
István Horváth
with size_t index as input parameter you can figure out where is the chunked response in the processing, though I not used this method, but looks like it will solve your problem
@armogur_gitlab thanks, but have you another bigger sampele? i dont understand this code fragment in your link. sorry im not the pro in this things
@armogur_gitlab can it be so simple? ti have found the print function, and testet, yeah it works, but is it right? looks too simple
server.on("/", HTTP_GET, [](AsyncWebServerRequest *request)
AsyncResponseStream *response = request->beginResponseStream("text/html");
ok not so simple.... the processor doenst work, i cant replace things with vars
printf_P(HTMLMain, processor); dont work in this scenario. any other practicable way to send variables with the request to prefill a dataform?
Hello me-no-dev. I am stuck with ESPAsyncTCP ".pio\libdeps\esp12e\ESPAsyncTCP@src-4b2fa33d3d75d4541c5b044be255a09c\src/tcp_axtls.h:44:10: fatal error: include/ssl.h: No such file or directory". I made some researches but without luck. I am trying to make an SSL call to google sheet, but without success. Any pointers / ideas would be much appreciated, as this is a show stopper for my project. Thx !
I am wondering, did anyone have problem with ESPAsyncWebServer or ESPAsyncTCP ? in regards to heap fragmentation?? First of all the bad String class, secondly, it seems i have major issue with heap fragmentation if using websocket.
me-no-dev : anykind of intention to replace the old arduino String class with std::string ? at least to have sso ..
István Horváth
@DaeMonSx I experienced this behaviour as well while running my microcontroller for days, I am rewriting the whole async tcp and its server counterparts to use char *

Hi all. Fairly new and very sorry if answered as I've looked but I'm trying to use AsyncWebServer with SdFat and 128 GB exFAT SDHC. I'm having issues with the following lines in my code since I'm not using SD.h

request->send(SD, "/index.html", "text/html"); }); server.serveStatic("/", SD, "/");

I've tried changing SD to sd, and file objects without success. Also tried FS and fs with no luck. I'm fairly new and jsut not sure what filesystem to send from SdFat for request->send

Mike Dunston
SdFat is not likely supported, at least on esp32 for sure as there is built-in SD/SDMMC support from the platform that does work.
Rainer Barth
I saw on VSCode / PlatformIO there is an update available from 1.2.7 (my installed version) to Version 2.1.0. But it is marked as incompatible. I have the latest esp8266 platform module version 3.2.0. Is it necessary to update and if so, how can I do it?
Hi all, I am a bit new on this ESPsyncWebServer. I am using ESPAsyncWebServer to be able to serve a JSON file to a client by using one API/end point. The client could modify the JSON and send back the JSON using other API/end point. I have managed to do it using a small JSON file. The file is included in the body of the request that the client sends to my ESP8266. The problem comes when the size of the JSON is bigger and the request's body gets the ESP8266 in chunks. I have checked the ESPAsyncWebServer documentation trying to figure out how to manage the chunks to be able to load in a String or even better, in the JSON doc that I use in my ESP8266.
Do you know how I can concat all the chunks (3 in my case) in a String or in a JSON?
Thank you in advanced
Hey everyone,
@me-no-dev Thanks for your great lib 😊 I'm trying to migrate from "Stock" Webserver in arduino to ESPAsyncWebServer on an ESP32 project right now, as I need to use WebSockets for some functionality.
Unfortunately I cannot get the lib to build with ESP-IDF 4.4. It already fails when I try to include it.
Besides the CMakeLists format is still the "old" IDF style, I don't see any obvious issue.
I added the lib as a component, added AsyncTCP as a component and added arduino-esp as a component (within components/arduino).
Is there any point I'm missing?
Never mind -.- forgot to add a requirement in my CMAKELists
Mike Dunston
@bbsan2k If you are using IDF v4.4 I'd suggest looking at the IDF http_server component, I believe it also has built-in WS handling and has fewer restrictions on what you can/can't do within callbacks.
Is there a way to flush an AsyncResponseStream if you are going to exceed the buffer size?
If my data is less than the buffer it gets sent fine but if it is bigger it gets truncated.
Hi everyone ,how to solve this problem in the uploading : A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header
István Horváth
interesting, maybe your browser can not connect to your EPS32, can this be like your microcontroller lost WIFI connection?
Hi guys, i still have a problem - no idea what to do, heres again my question: I am reading an value continously in my main/loop-code and writing it in a global variabal. in my server.on callback/handler function i am reading this value and returning it to the clients browser. for sure its crashing when i write it the same time.
Q1: how is the best way to avoid this (i am using a locked-variable at the moment).
Q2: since its async somehow, is there task scheduling and running on different cores@esp32 involved? Best way to exchange "data"/share aviables between "global code" and webserver(callbacks?
Hope im not mixing things too much - and sri for some rookie questening stuff :) Tnx for your support. M.
Mehrdad K

hi all
I made a couple of header file for different prepherals + header file for my asyncserver & asyncwebsocket


AsyncWebServer server(80);
AsyncWebSocket WS("/ws");

in other header file I have sensor to measure sumeting and send through websocket


but it can not see my WS instance error: 'WS' was not declared in this scope
does anyone know how can I pass my WS instance to other header files


Hi guys, i still have a problem - no idea what to do, heres again my question: I am reading an value continously in my main/loop-code and writing it in a global variabal. in my server.on callback/handler function i am reading this value and returning it to the clients browser. for sure its crashing when i write it the same time.
Q1: how is the best way to avoid this (i am using a locked-variable at the moment).
Q2: since its async somehow, is there task scheduling and running on different cores@esp32 involved? Best way to exchange "data"/share aviables between "global code" and webserver(callbacks?
Hope im not mixing things too much - and sri for some rookie questening stuff :) Tnx for your support. M.

why not with websocket?

Hey, is there any chance to have a socket.io server on esp8266?
Short problem description: There is a project thats all done in javascript. It uses a raspberry as socket.io server to do hardware things that a js client on a pc directs via socket.io. I cant really change the PC part but i want to replace the raspberry with esp8266 to scale prizes and make it "easier" to build.
but i cant find any resources for a socket.io server. Only clients everywhere.
István Horváth
@dm5xx maybe you should share your code
Mehrdad K
hi All, I'm using the AsyncWebSocket on ESP32, and in the loop, I send the sensor data back to the page by simple code WS.text(WSclinet,data); however after a while _messageQueue.length() exceeded of maximum size and throw ERROR: Too many messages queued , does anyone know how to solve it
Mehrdad K
I couldn't find any solution by current code, so I add the following function to the source code and the call the clearQ after each transmitting
void AsyncWebSocket::clearQ(uint32_t id){
  AsyncWebSocketClient * c = client(id);


void AsyncWebSocketClient::QueuFree(){
Hi mates !

any solutions for using ESP32-C3 Stamp with ESPAsyncWebServer and AsyncTCP.h successfully? getting compile errors on arduino ide 1.8.16 with installed esp32 arduino boardmanager version >= 2.0.0....

C:\Users\thoma\Documents\Arduino\libraries\ESPAsyncWebServer-master\src\AsyncWebSocket.cpp: In member function 'IPAddress AsyncWebSocketClient::remoteIP()':
C:\Users\thoma\Documents\Arduino\libraries\ESPAsyncWebServer-master\src\AsyncWebSocket.cpp:843:28: error: call of overloaded 'IPAddress(unsigned int)' is ambiguous
return IPAddress(0U);
In file included from C:\Users\thoma\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.0\cores\esp32/Arduino.h:163,
from C:\Users\thoma\Documents\Arduino\libraries\ESPAsyncWebServer-master\src\AsyncWebSocket.cpp:21:
C:\Users\thoma\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.0\cores\esp32/IPAddress.h:51:5: note: candidate: 'IPAddress::IPAddress(const uint8_t)'
IPAddress(const uint8_t
C:\Users\thoma\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.0\cores\esp32/IPAddress.h:50:5: note: candidate: 'IPAddress::IPAddress(uint32_t)'
IPAddress(uint32_t address);
C:\Users\thoma\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.0\cores\esp32/IPAddress.h:29:7: note: candidate: 'constexpr IPAddress::IPAddress(const IPAddress&)'
class IPAddress: public Printable
exit status 1

1 reply
Sloata George
Does anybody has any idea how should I serve a web interface that's built with Parcel v2 on the ESPAsyncWebServer ?
The above code doesn't work.
Mehrdad K
Hi All
has anyone know, how to respond back a web request with a JSON file, it seems many methods in this repo are deprecated
class "AsyncResponseStream" has no member "getRoot"
4 replies
can i use async web server with gsm module
Umer Arshad

Hello everyone.
Hope you all are doing well.

I am having an issue where I get an exception due to the AsyncWebServer library in esp32.
Basically the issue occurs as soon as I connect my device with the esp AccessPoint or when the Esp connects to a WiFi station.

Can someone please help me with this.

Thanks in advance.

abort() was called at PC 0x401abfb2 on core 1

ELF file SHA256: 0000000000000000

Backtrace: 0x400903e8:0x3ffd3290 0x40090745:0x3ffd32b0 0x401abfb2:0x3ffd32d0 0x4020f2dc:0x3ffd32f0 0x4020f2a1:0x3ffd3310 0x4010035a:0x3ffd3330 0x400f4b2d:0x3ffd3370 0x400f72d0:0x3ffd3480 0x400f76de:0x3ffd34c0 0x40119180:0x3ffd34e0 0x400921f2:0x3ffd3500
  #0  0x400903e8:0x3ffd3290 in invoke_abort at /home/cschwinne/esp32-arduino-lib-builder/esp-idf/components/esp32/panic.c:648
  #1  0x40090745:0x3ffd32b0 in abort at /home/cschwinne/esp32-arduino-lib-builder/esp-idf/components/esp32/panic.c:648
  #2  0x401abfb2:0x3ffd32d0 in __cxa_allocate_dependent_exception at /home/cschwinne/esp32-arduino-lib-builder/esp-idf/components/cxx/cxx_exception_stubs.cpp:19
  #3  0x4020f2dc:0x3ffd32f0 in operator new(unsigned int) at /builds/idf/crosstool-NG/.build/src/gcc-5.2.0/libstdc++-v3/libsupc++/new_op.cc:54
  #4  0x4020f2a1:0x3ffd3310 in operator new[](unsigned int) at /builds/idf/crosstool-NG/.build/src/gcc-5.2.0/libstdc++-v3/libsupc++/new_opv.cc:32
  #5  0x4010035a:0x3ffd3330 in WiFiUDP::parsePacket() at C:/Users/umer.arshad/.platformio/packages/framework-arduinoespressif32@src-e9b1fbd6563a55e19ddae15e1fc09589/cores/esp32/Udp.h:46    
  #6  0x400f4b2d:0x3ffd3370 in handleNotifications() at wled00/udp.cpp:204
  #7  0x400f72d0:0x3ffd3480 in WLED::loop() at wled00/bus_manager.h:149
  #8  0x400f76de:0x3ffd34c0 in loop() at D:/MyStuff/WattsLights/WLED/wled00/wled00.ino:20
  #9  0x40119180:0x3ffd34e0 in loopTask(void*) at C:/Users/umer.arshad/.platformio/packages/framework-arduinoespressif32@src-e9b1fbd6563a55e19ddae15e1fc09589/cores/esp32/main.cpp:23        
  #10 0x400921f2:0x3ffd3500 in vPortTaskWrapper at /home/cschwinne/esp32-arduino-lib-builder/esp-idf/components/freertos/port.c:355 (discriminator 1)

ets Jun  8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
mode:DOUT, clock div:2
entry 0x4008067c