Skip to content

TCP reset (RST ACK) on the 2nd call in Simple WebServer  #1956

@MGX3D

Description

@MGX3D

Simple web server resets connection on second node.js call (plain browser does the same if you hit refresh fast enough!).

ESP32 debug window only says "RES:0 ERR:128", irrespective if the client call was disconnected or not:

Wireshark shows:
image

Hardware:

Board: ESP32 Dev Module (ESP32_Core_Board_V2)
IDE name: Arduino IDE
Flash Frequency: 80Mhz
PSRAM enabled: no

Description:

I have a simple web server which works fine if I call it only once from node.js and then close the connection, but ESP32 resets the connection on a 2nd call if I try to keep it open:

Error: read ECONNRESET
    at _errnoException (util.js:1019:11)
    at TCP.onread (net.js:608:25)

This is happening with both sdk 1.0.0 and 1.0.0-rc4.

Sketch:

  #include <WebServer.h>
   ...

  server.on("/peek", [](){    
    String webString = String(getMicrons(getPacket()));
    server.send(200, "text/plain", webString);    
    //delay(50);
  });
...
void loop(void) {
  server.handleClient();
}

Debug Messages:

[D][WiFiClient.cpp:452] connected(): Disconnected: RES: 0, ERR: 128

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: StaleIssue is stale stage (outdated/stuck)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions