Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • May 22 13:43
    MalushSasha opened #1161
  • May 21 08:17
    alexhopeoconnor commented #445
  • May 19 16:33
    naaitsab commented #1140
  • May 19 08:15
    MikeyMoMo commented #970
  • May 17 17:39
    AaronD-GH commented #1151
  • May 17 14:12
    VNovytskyi commented #1160
  • May 17 13:14
    zekageri commented #1160
  • May 17 13:12
    zekageri commented #1160
  • May 17 12:51
    VNovytskyi commented #1160
  • May 17 11:28
    maxgerhardt commented #970
  • May 17 11:28
    maxgerhardt commented #970
  • May 17 10:03
    zekageri commented #1160
  • May 17 10:00
    zekageri commented #1160
  • May 17 00:42
    DanteNahuel commented #1147
  • May 16 20:59
    RadianM commented #1131
  • May 16 17:20
    arslan437 commented #1151
  • May 16 17:18
    arslan437 commented #1151
  • May 16 14:04
    VNovytskyi edited #1160
  • May 16 14:03
    VNovytskyi opened #1160
  • May 16 13:50
    RadianM commented #1131
Gonzalo
@gnalbandian
Hi @Turbotronics. I have faced the two same issues as you. WebSocket disconnection is an ongoing issues with ESPAsyncWebServer and its underlying use os ESPAsyncTCP. There are many forks that seems to fix this. Haven't tryed anyone yet. It's a pity the main lbrary is stalled and not willing to accept pull requests. The second issues, the 5-file limit, I solve it creating only one huge html file with all the content embedded (html, css, js)
Turbotronics
@Turbotronics
Hi Gonzalo, thanx for the feedback. Do you have links to the other forks? My i/f is a controller dashboard than must always be responsive to user input. I am considering using streams to replace the socket since so far I have had no issues transfering data that way. I had a function calling a sequence of strings to tx to client. It was painfully slow since without long intervals it would break. Replacing this with an XMLHttpRequest made is almost instant.
Michael Heinrich
@pinki

Hi!
I want to write a file upload handler class.
My current class is

class UpdateMasterRequestHandler : public AsyncWebHandler {
public:
    UpdateMasterRequestHandler(/* args */) { }
    virtual ~UpdateMasterRequestHandler() { }

    bool canHandle(AsyncWebServerRequest *request);
    void handleUpload(AsyncWebServerRequest *request, const String& filename, size_t index, uint8_t *data, size_t len, bool final);
};

canHandle returns true, but handleUpload never gets called.
What am I doing wrong?

bool UpdateMasterRequestHandler::canHandle(AsyncWebServerRequest *request) {
    bool forMe = request->url() == "/api/UpdateMaster"
              && request->method() == HTTP_POST
              && request->multipart();
    if (forMe) logDebugln("UpdateMasterRequestHandler!");

    return forMe;
}

void UpdateMasterRequestHandler::handleUpload(AsyncWebServerRequest *request, const String& filename, size_t index, uint8_t *data, size_t len, bool final) {
    if (index == 0) {
        logDebug("UploadStart: ");
        logDebugln(filename);

        request->_tempFile = SPIFFS.open("master.hex", "w");
    }

    if (len > 0) {
        request->_tempFile.write(data, len);
    }

    if (final) {
        logDebug("UploadEnd: ");
        logDebugln(filename);

        request->_tempFile.close();

        request->send(200, MIME_TYPE_PLAIN_TEXT, "Upload complete!");
    }
}
HTML:
<form id="masterUpdateForm" action="/api/UpdateMaster" method="POST" enctype="multipart/form-data">
    Firmware: <input type="file" name="file" accept="*.hex">
    <button type="submit">Update</button>
</form>
Michael Heinrich
@pinki
I also tried this:
class UpdateMasterRequestHandler : public AsyncWebHandler {
public:
    UpdateMasterRequestHandler(/* args */) { }
    virtual ~UpdateMasterRequestHandler() { }

    virtual bool canHandle(AsyncWebServerRequest *request) override final;
    virtual void handleRequest(AsyncWebServerRequest *request) override final;
    virtual void handleUpload(AsyncWebServerRequest *request, const String& filename, size_t index, uint8_t *data, size_t len, bool final) override final;
};
Michael Heinrich
@pinki
I found the solution. I had to override isRequestHandlerTrivial as well and make it return false.
BinaryFour
@BlNARYFOUR
Hi, is there a complimentary ESP8266 WebSocket library for ws clients? I used the library for Wemos D1 Mini as websocket server, which works great! But I want to connect to this websocket server using a second Wemos D1 Mini. Can I do this using the same library? Or is there a complimentary library?
Cellie
@CelliesProjects
@me-no-dev I am working on a project that uses AsyncTCP for networking.
Is there a way to disable the WDT on the Async task?
Paul Andrews
@judge2005
I am curious about how async TCP works on the ESP8266. In particular, do I need to be careful about concurrency issues in handlers?
Should maybe have tagged that with @me-no-dev :-)
mesutaydeger
@mesutaydeger
Hello. Can we use ESPAsyncWebServer library with GSM shield in ESP32-ESP8266?
manuel75o
@manuel75o
Hello guys, i have a question in terms of licensing of the „ESPAsyncWebServer“. Every other library from @me-no-dev is licensed as LGPL-3.0 or 2.0 licence, however this one has no license listed.
Cellie
@CelliesProjects
@me-no-dev I made a simple class from AsyncTCP but am at a loss how to set a timeout.
mesutaydeger
@mesutaydeger
I have opend ESPAsyncTCP library. main class includes C-C++ "lwip" library... Can I get a result if I edit the void AsyncServer :: begin () function in the class according to AT commands?
mesutaydeger
@mesutaydeger
Please can you advise to me about "Can we use ESPAsyncWebServer library with GSM shield in ESP32-ESP8266?"?
OnurNP
@K0rkunc
hi
im create async web server
but refreshing and reset esp32
how to fix that
my html document
backtrace

Backtrace: 0x4000c3f0:0x3ffd1380 0x400db076:0x3ffd13a0 0x400db192:0x3ffd13c0 0x400d7ad1:0x3ffd13e0 0x400d6192:0x3ffd1450 0x400d60f5:0x3ffd1490 0x400d145d:0x3ffd14b0 0x4015188f:0x3ffd14f0 0x400d9309:0x3ffd1510 0x400d6df1:0x3ffd1560 0x400d6eb5:0x3ffd15a0 0x400d7105:0x3ffd15f0 0x4014b7b1:0x3ffd1610 0x4014b82d:0x3ffd1650 0x4014bed6:0x3ffd1670 0x4008a286:0x3ffd16a0

#0 0x4000c3f0:0x3ffd1380 in ?? ??:0

#1 0x400db076:0x3ffd13a0 in String::move(String&) at C:\Users\OnurNP.platformio\packages\framework-arduinoespressif32\cores\esp32/WString.cpp:857

#2 0x400db192:0x3ffd13c0 in String::operator=(String&&) at C:\Users\OnurNP.platformio\packages\framework-arduinoespressif32\cores\esp32/WString.cpp:857

#3 0x400d7ad1:0x3ffd13e0 in AsyncBasicResponse::_respond(AsyncWebServerRequest) at lib\ESPAsyncWebServer\src/WebResponses.cpp:699

#4 0x400d6192:0x3ffd1450 in AsyncWebServerRequest::send(AsyncWebServerResponse
) at lib\ESPAsyncWebServer\src/WebRequest.cpp:797

#5 0x400d60f5:0x3ffd1490 in AsyncWebServerRequest::send(int, String const&, String const&) at lib\ESPAsyncWebServer\src/WebRequest.cpp:797

#6 0x400d145d:0x3ffd14b0 in handleRoot(AsyncWebServerRequest) at src/main.cpp:289

#7 0x4015188f:0x3ffd14f0 in std::_Function_handler<void (AsyncWebServerRequest
), void ()(AsyncWebServerRequest)>::_M_invoke(std::_Any_data const&,

AsyncWebServerRequest*&&) at c:\users\onurnp.platformio\packages\toolchain-xtensa32@2.50200.97\xtensa-esp32-elf\include\c++\5.2.0/functional:1871

#8 0x400d9309:0x3ffd1510 in std::function<void (AsyncWebServerRequest*)>::operator()(AsyncWebServerRequest*) const at lib\ESPAsyncWebServer\src/StringArray.h:73

  (inlined by) AsyncCallbackWebHandler::handleRequest(AsyncWebServerRequest*) at lib\ESPAsyncWebServer\src/WebHandlerImpl.h:132

#9 0x400d6df1:0x3ffd1560 in AsyncWebServerRequest::_parseLine() at lib\ESPAsyncWebServer\src/WebRequest.cpp:797

#10 0x400d6eb5:0x3ffd15a0 in AsyncWebServerRequest::_onData(void, unsigned int) at lib\ESPAsyncWebServer\src/WebRequest.cpp:797

#11 0x400d7105:0x3ffd15f0 in std::_Function_handler<void (void
, AsyncClient, void, unsigned int), AsyncWebServerRequest::AsyncWebServerRequest(AsyncWebServer, AsyncClient)::{lambda(void, AsyncClient, void, unsigned int)#8}>::_M_invoke(std::_Any_data const&, void&&, AsyncClient*&&, std::_Any_data const&, unsigned int&&) at lib\ESPAsyncWebServer\src/WebRequest.cpp:797

  (inlined by) _M_invoke at c:\users\onurnp\.platformio\packages\toolchain-xtensa32@2.50200.97\xtensa-esp32-elf\include\c++\5.2.0/functional:1871    

#12 0x4014b7b1:0x3ffd1610 in std::function<void (void*, AsyncClient*, void*, unsigned int)>::operator()(void, AsyncClient, void*, unsigned int) const at lib\AsyncTCP\src/AsyncTCP.cpp:1039

  (inlined by) AsyncClient::_recv(tcp_pcb*, pbuf*, signed char) at lib\AsyncTCP\src/AsyncTCP.cpp:934

#13 0x4014b82d:0x3ffd1650 in AsyncClient::_s_recv(void, tcp_pcb, pbuf, signed char) at lib\AsyncTCP\src/AsyncTCP.cpp:1039

#14 0x4014bed6:0x3ffd1670 in _async_service_task(void
) at lib\AsyncTCP\src/AsyncTCP.cpp:1039

  (inlined by) _async_service_task at lib\AsyncTCP\src/AsyncTCP.cpp:197

#15 0x4008a286:0x3ffd16a0 in vPortTaskWrapper at

/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port.c:355 (discriminator 1)

how to fix that help me
mesutaydeger
@mesutaydeger
"I made a simple class from AsyncTCP but am at a loss how to set a timeout." : Could you tell me briefly what to do? Can I put in AT commands?
notsolowki
@notsolowki
Hi!! anyone around?
OnurNP
@K0rkunc
im activated external interrupt and cant connect wifi
how to fix that
OnurNP
@K0rkunc
hi
how do use rtos on async web server
Ramses Garcia Dilone
@ramsesgarciad
hello world
i tried use this lib with w5500
is possible?
oldfogie
@oldfogie

Using AsyncWebServer on ESP32 I'm getting frequent Guru Meditation Errors:
Core 1 panic'ed (LoadProhibited). Exception was unhandled.
Core 1 register dump:
PC : 0x400d7e7c PS : 0x00060430 A0 : 0x800d7f1a A1 : 0x3ffb1f00
A2 : 0x3ffd31bc A3 : 0x3ffd2f84 A4 : 0x00000026 A5 : 0x3ffd2caa
A6 : 0x00000a0d A7 : 0x3a617461 A8 : 0x800d7e88 A9 : 0x3ffb1ee0
A10 : 0xe0088080 A11 : 0x00000026 A12 : 0x00000026 A13 : 0x00000026
A14 : 0x00000000 A15 : 0x00000000 SAR : 0x0000000a EXCCAUSE: 0x0000001c
EXCVADDR: 0xe0088088 LBEG : 0x4000c2e0 LEND : 0x4000c2f6 LCOUNT : 0xffffffff

ELF file SHA256: 0000000000000000

Backtrace: 0x400d7e7c:0x3ffb1f00 0x400d7f17:0x3ffb1f20 0x400d7f37:0x3ffb1f40 0x400d7f8d:0x3ffb1f60 0x400d17d3:0x3ffb1f90 0x400df329:0x3ffb1fb0 0x40089afa:0x3ffb1fd0

the backtrace shows
Decoding 7 results
0x400d7e7c: AsyncEventSourceClient::_runQueue() at c:\arduinoideportable\portable\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-97-gc752ad5-5.2.0\xtensa-esp32-elf\include\c++\5.2.0/functional line 1858
0x400d7f17: AsyncEventSourceClient::_queueMessage(AsyncEventSourceMessage) at c:\arduinoideportable\portable\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-97-gc752ad5-5.2.0\xtensa-esp32-elf\include\c++\5.2.0/functional line 1858
0x400d7f37: AsyncEventSourceClient::write(char const
, unsigned int) at c:\arduinoideportable\portable\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-97-gc752ad5-5.2.0\xtensa-esp32-elf\include\c++\5.2.0/functional line 1858
0x400d7f8d: AsyncEventSource::send(char const, char const, unsigned int, unsigned int) at c:\arduinoideportable\portable\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-97-gc752ad5-5.2.0\xtensa-esp32-elf\include\c++\5.2.0/functional line 1858
0x400d17d3: loop() at C:\ArduinoIDEPortable\portable\sketchbook\ESP32\SolarLoggerJune12/SolarLoggerJune12.ino line 151
0x400df329: loopTask(void*) at C:\ArduinoIDEPortable\portable\packages\esp32\hardware\esp32\1.0.6\cores\esp32/main.cpp line 23
0x40089afa: vPortTaskWrapper at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port.c line 355 (discriminator 1)

referring to this line in my code

151: events.send( mycWatts , "cwatts", millis());

It doesntt happen every time but its realy giving me a headache. Any ideas?

Rolf Wedermann
@rolfwedermann
Hello everyone, will the ESP Async web server be further developed or is the project idle?
zekageri
@zekageri
Seems idle
Tom Sciano
@TSciano_twitter
how can I send a fetch/post request to itself using javascript
i keep getting a cors error
` const button = document.getElementById("post-btn");
    button.addEventListener("click", async(_) => {
        try {
            const response = await fetch("board", {
                method: "post",
                body: {
                   "id":1,
                   "t1":2,
                   "t2":3
                }
            });
            console.log("Completed!", response);
        } catch (err) {
            console.error(`Error: ${err}`);
        }
    }); `
Tom Sciano
@TSciano_twitter
+and this is how my post starts
AsyncCallbackJsonWebHandler *handler = new AsyncCallbackJsonWebHandler("/board", [](AsyncWebServerRequest *request, JsonVariant &json) {
also tried with adding this before server begin
DefaultHeaders::Instance().addHeader("Access-Control-Allow-Origin", "*"); DefaultHeaders::Instance().addHeader("Access-Control-Allow-Headers", "Content-Type");
johnerrington
@johnerrington
Re my message above I have found that my code is much more stable - ie less frequent guru errors - with a delay between events.send calls.
I've implemented this with a state machine and have not had a guru error in 24 hours continuous running (but there is time yet!)
Daniel
@ld21

I'm trying to let ESPAsynchWebServer on an ESP32 serve all JPG-Images in SPIFFS as follows:

server->on("^(([/|.|\w|\s])*)\.jpg$", HTTP_GET, [] (AsyncWebServerRequest *request) { String name = request->pathArg(0) + ".jpg"; request->send(SPIFFS, name, "image/jpg"); });

Unfortunatel, it never serves the images.

I added compiler.cpp.extra_flags=-DDASYNCWEBSERVER_REGEX to platforms.local.txt
The files are called like «aed3.jpg» oder «bcd.jpg».
If anyone sees how I sould change the regex to mach my needs, please help me.

Thank you very much, Dani

sillyfrog
@sillyfrog
@ld21 Have you tried the server.serveStatic setup? I have used that for some time now and find it the best way to serve files. You should be able to just serve the files from a specific directory (I have not tried, I always use the root directory), and you could put your .jpg in there. See here for an example usage in one of my projects: https://github.com/sillyfrog/PrettyLights2/blob/bbed6c986609ad2b17e7be4eaa7f512c87c81b75/src/main.cpp#L839 (this code allows you to change between LittleFS and SPIFFS - now SPIFFS is EOL I would suggest moving to LittleFS for a new project).
Daniel
@ld21
@sillyfrog Great ideas, thanks a lot – I think they will solve my problems in a very elegant way. And thanks for pointing out LittleFS, I havent's heard of it so far and it really seems to be the future of ESP32-FSs.
Ora Prints
@Oraprints
Ora prints is one of the best printing and packaging platforms where different kinds of Gift boxes and depictions are made. https://oraprints.com/
OnurNP
@K0rkunc

Hello

I am running the interface on the local server using the asyncy web server library. no problem here

but 2 or more esp32s are connecting to each other, the server esp32 needs to send data to the client esp32, for this they need to send data between themselves via http post. How can I do this?

Baba Boota
@bababoota
Baba boota is best online shopping website in Pakistan, where you get all of your daily need products with one click. We provide you with all the things at a reasonable price and good quality, so sit back and order your stuff from Baba Boota.com https://bababoota.com
Pavel Baranov
@7doctor7
Hi
guys, does anyone tried to use ESP32 miniz lib to compress files on sd card?
maybe someone can provide a simple working example?
Sloata George
@GeorgeFlorian

Are there any examples of dynamic web pages using ESPAsyncWebServer ?
I would like to GET and POST data without having to reload the page every time.

Right now each request ends with redirect which reloads the page:

  server.on("/settings", HTTP_POST, [](AsyncWebServerRequest *request)
            {
              if (request->hasArg("save_output"))
              {
                // do something with the received data
                request->redirect("/settings");
              }
              else
              {
                request->redirect("/settings");
              }
            });

But request->redirect("/settings"); reloads the page.
Can I change this behavior ?