Open rvbc1 opened 2 days ago
Default HTTPClient timeut is 5000 ms (5 seconds).
It can be fixed by adding setTimeout(time_ms);
NetworkClient &getClient(Drivers::string url) {
client = NetworkClient();
client.setTimeout(100); // 100ms reading timeout
clientSecure = NetworkClientSecure();
clientSecure.setInsecure();
if (url.compare(0, 8, "https://") == 0) { return clientSecure; }
return client;
}
Timeout affects Stream
class, here:
auto downloaded = stream.readBytes(const_cast<uint8_t *>(buffer), bufferSize);
Board
ESP32-S3-DevKitC
Device Description
DevKitC
Hardware Configuration
No external hardware.
Version
v3.0.7
IDE Name
Platformio
Operating System
Linux - Ubuntu 24.04
Flash frequency
40MHz
PSRAM enabled
no
Upload speed
115200
Description
My pio: platform = https://github.com/pioarduino/platform-espressif32/releases/download/51.03.07/platform-espressif32.zip board = esp32-s3-devkitc-1 framework = arduino
Using HTTPClient over HTTP results in a significant delay on the last packet (around 5 seconds), whereas this delay doesn’t occur over HTTPS. In general, HTTPS is also noticeably faster, which is surprising since encryption is expected to add some overhead.
The file being downloaded is the same in both cases, from the same server, and the only difference in the URL is whether it starts with HTTP or HTTPS.
Could someone help me understand if I’m doing something wrong, or if this might be a bug?”
Sketch
Debug Message
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide