Hi,
I'm creating a robot I want to control in real time over WiFi but I'm encountering some delay wen receiving packets.
I tried on an ESP32-C3 and on an ESP32-WROOM-32, I get the same issue.
I wrote a very simplified version of the code to eliminate other variables, same deal.
The ESP32 is acting as the server, and the client is written in C#.
Here is the problem :
The client connects to the server, and sends a payload of 1 bytes (smallest payload possible, just for testing), every 25ms.
But on the server side, the datas are received grouped, here is an example of what I receive :
Char p received at 58913
Char p received at 58913
Char p received at 58933
Char p received at 58953
Char p received at 58983
Char p received at 59184
Char p received at 59184
Char p received at 59184
Char p received at 59184
Char p received at 59185
Char p received at 59190
Char p received at 59200
Char p received at 59230
Char p received at 59260
Char p received at 59507
Char p received at 59507
Char p received at 59507
Char p received at 59508
Char p received at 59508
Char p received at 59518
Char p received at 59519
Char p received at 59519
you can see that the data are arriving grouped.
The code of the server is here :
void loop() {
WiFiClient client = wifiServer.available();
client.setNoDelay(true);
if (client)
{
while (client.connected())
{
while (client.available()>0)
{
char c = client.read();
Serial.print("Char ");
Serial.print(c);
Serial.print(" received at ");
Serial.println(millis());
}
delay(5);
}
client.stop();
Serial.println("Client disconnected");
}
}
I'm pretty sure the client is working great, I checked it by creating a server with C# running on another computer in the netword and the datas are arriving well in time and not grouped.
I've been searching for a solution for a few days, I've found some peoples talking about using the noDelay tag to avoid small packet delay, I added it to my code but it doesn't seem like it did much.
I've found some peoples suggesting to increase the priority of the thread that is handling TCP, but I have no idea about how to do that and my code is so simple I don't see how it could need a high priority, but I might be wrong
I've found people saying they achieved more that 10Mb/s with TCP, so I can't see how half a kb/s could be so hard to get consistently, so I guess I must be missing something.
If you have any suggestion, I'd be happy to hear it
Thanks
Packets arriving delayed and grouped (TCP/UDP server)
Jump to
- English Forum
- Explore
- News
- General Discussion
- FAQ
- Documentation
- Documentation
- Sample Code
- Discussion Forum
- ESP32-S31
- Hardware
- ESP-IDF
- ESP-BOX
- ESP-ADF
- ESP-MDF
- ESP-WHO
- ESP-SkaiNet
- ESP32 Arduino
- IDEs for ESP-IDF
- ESP-AT
- ESP IoT Solution
- ESP RainMaker
- Rust
- ESP8266
- Report Bugs
- Showcase
- Chinese Forum 中文社区
- 活动区
- 乐鑫活动专区
- 讨论区
- ESP32-S31 中文讨论版
- 喵伴 中文讨论版
- ESP-IDF 中文讨论版
- 《ESP32-C3 物联网工程开发实战》书籍讨论版
- 中文文档讨论版
- ESP-AT 中文讨论版
- ESP-BOX 中文讨论版
- ESP IoT Solution 中文讨论版
- ESP-ADF 中文讨论版
- ESP Mesh 中文讨论版
- ESP Cloud 中文讨论版
- ESP-WHO 中文讨论版
- ESP-SkaiNet 中文讨论版
- ESP 生产支持讨论版
- 硬件问题讨论
- 项目展示
Who is online
Users browsing this forum: Google [Bot] and 5 guests
- All times are UTC
- Top
- Delete cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. ESP8266EX and ESP32 are some of our products.
Information
Espressif ESP32 ... Available now!