while (file.available()) {
uint8_t buffer[4096];
int bytesRead = file.read(buffer, 4096);
client.write(buffer, bytesRead);
}
An error occurs with a large buffer. Are there other ways? I need a speed of at least 1 Mbyte/s? Other libraries? ESP32 - 4MB.
Welcome to the forum
Make the buffer smaller and read the data into it and out of it in smaller chunks until all of the data has been read and written ?
J-M-L
June 4, 2023, 10:32am
3
is that an SD based file or reading from flash ?
what's the client? just a WiFiClient instance ?
the GitHub - me-no-dev/AsyncTCP: Async TCP Library for ESP32 is faster than WiFiClient but not a drop in replacement
may be check also fast WiFi file download · Issue #4529 · espressif/arduino-esp32 · GitHub
v3ttel
June 4, 2023, 10:32am
4
I have a file: conditionally weighs 500 kilobytes. But does this procedure take 2 minutes? This is not normal. Do I need it in a split second
v3ttel
June 4, 2023, 10:35am
5
SPIFFS Internal storage. Yes right. It turns out that the wi-fi speed is limited by the time for these two operations. 500 kilobytes 2 minutes transmits. It's very slow
J-M-L
June 4, 2023, 10:41am
6
yeah great performance is not guaranteed...
Juraj
June 4, 2023, 11:05am
7
sometimes smaller buffer has better performance. the flash can write data sent while wifi receives the next packet
system
Closed
December 1, 2023, 11:06am
8
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.