-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Packet loss on WiFi #129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
We are tracking a similar issue about packet loss with ESP-IDF WiFi driver internally. I will post an update here once we resolve it. |
Thank you! |
Any followup on this? |
can you please check the latest version and report back? |
Closing because of no response |
Hello All, I am a newbie in this field. Kindly cooperate. Thank you:) |
TCP/IP has packet loss detection and correction built in. Please don't hijack threads from 3 years ago. Open a new thread and follow the directions in the issue template. |
I want to measure the data packet loss for different intra communication protocol like I2C, SPI and ESP-NOW. |
On 20 Mar 2021 Sat at 15:41 Pgpapa-doodl ***@***.***> wrote:
TCP/IP has packet loss detection and correction built in. Please don't
hijack threads from 3 years ago. Open a new thread and follow the
directions in the issue template
<https://github.com/espressif/arduino-esp32/blob/master/docs/ISSUE_TEMPLATE.md>
.
I want to measure the data packet loss for different intra communication
protocol like I2C, SPI and ESP-NOW.
So how can I use TCP/IP for all these protocols?
Also yes I'll keep your advice in mind from next time.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#129 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AODPGHOREJRGLMTZ2IUG4Y3TESJV7ANCNFSM4C4QOFMA>
.
Unsubscribe
|
With version 2.0.5, this is still happening. When using WebSocket client, the received WebSocket header has correct payload length, but the data is truncated.
And this is the implementation of the WebSocket client for reading incoming packet: if (!client || !client->available()) return;
uint16_t bin = 0;
int i = 0;
while (isConnected()) {
int res = client->read();
if (res >= 0) bin |= ((uint8_t)res) << i++ * 8;
if (i > 1) break;
}
Frame::Header header(bin);
uint16_t payloadLen = header.payload;
if ((useMask && header.mask) || (!useMask && !header.mask) || !Frame::isValid(Frame::Opcode(header.opcode))) {
_close(CloseReason_ProtocolError);
return;
}
if (header.opcode == 0) {
_close(CloseReason_UnsupportedData);
return;
}
if (header.payload == 127) {
_close(CloseReason_MessageTooBig);
return;
}
if (header.payload == 126) {
bin = 0;
i = 0;
while (isConnected()) {
int res = client->read();
if (res >= 0) bin |= ((uint8_t)res) << i++ * 8;
if (i > 1) break;
}
payloadLen = Crypto::swapEndianness(bin);
}
uint8_t maskingKey[4];
if (header.mask) {
int res = client->read(maskingKey, 4);
}
char payload[payloadLen + 1];
payload[payloadLen] = 0;
uint16_t read = 0;
uint32_t start = millis();
while (isConnected() && read < payloadLen) {
int res = client->read((uint8_t*)payload + read, payloadLen - read);
if (res > 0) read += res;
if (millis() - start > 1000) {
break;
}
}
String payloadData(payload); // UPDATE: This is where it goes wrong.
if (header.mask) Crypto::remaskData(payloadData, maskingKey);
Serial.println(String(payloadLen) + ": " + payloadData); UPDATE 08/12/2022: |
Add Feather ESP32-S3, QT Py ESP32-S3
I'm noticing packet loss on ESP32 Thing (from Sparkfun) on WiFi in infrastructure mode.
The device is, supposedly, connected via 802.11n
I disabled SoftAP mode, but that didn't change anything:
The problem was discovered with TCP and then I ran some tests with ICMP pings.
Here are the results at different intervals between requests. Tests were executed on a wired connection to the AP to which ESP32 is connected via WiFi:
1s
200 packets transmitted, 196 received, 2% packet loss, time 199325ms
rtt min/avg/max/mdev = 1.117/16.662/1007.573/72.556 ms, pipe 2
100ms
200 packets transmitted, 191 received, 4% packet loss, time 20097ms
rtt min/avg/max/mdev = 1.045/17.414/458.020/48.626 ms, pipe 5
10ms
200 packets transmitted, 195 received, 2% packet loss, time 2101ms
rtt min/avg/max/mdev = 0.982/4.113/48.350/5.878 ms, pipe 3
Loss rate varies form test to test.
At the same time, a Raspberry Pi 3 connected to the same AP shows no hiccups, nor a single packet loss.
I suspect problem is in one of the binary libraries pulled in here. How can I track down which one?
The text was updated successfully, but these errors were encountered: