Hello folks.
I made a simple TCP socket (based on the example) and the client is pushing small packets about every 10ms to 50ms. The ESP32 is in STA mode, with Power saving set to WIFI_PS_NONE. The connection is made based on the get-started STA wifi example, any other config is default from the example.
I noticed that the packets are only recv in the socket task about 4 times per seconds, and are processed by chunks. I was expecting the incoming packets to get forwarded and made available to the lwip recv at an higher frequency.
My socket task have the highest priority, and changing the priority doesn't change the behaviour.
I started to dig around trying to find a timer or something linked to lwip or wifi that would explain this, but didn't find any.
If someone has any idea, it would be great help.
Wi-Fi RX packets are available in a socket only every 250ms or so.
Re: Wi-Fi RX packets are available in a socket only every 250ms or so.
Alright, this is a bit hard to explain and I am not good enough to guide you through my code. I have made a repo with a minimal test program showing exactly the problem I have.
https://github.com/tionebrr/ESP32_tcp-socket-test
https://github.com/tionebrr/ESP32_tcp-socket-test
-
- Posts: 9757
- Joined: Thu Nov 26, 2015 4:08 am
Re: Wi-Fi RX packets are available in a socket only every 250ms or so.
Did you try to disable power saving mode?
Re: Wi-Fi RX packets are available in a socket only every 250ms or so.
Yes. The demo code I posted doesn't (because it uses connect example), but the code I am working on has power saving disabled. I tried both ways also.
Did you try my demo in the repo ?
Re: Wi-Fi RX packets are available in a socket only every 250ms or so.
Are you sure there is no delay on the sender side? Check with Wireshark?
Re: Wi-Fi RX packets are available in a socket only every 250ms or so.
I tried with different soft, and with different computers... I was sure there was no delay on this side. I was wrong indeed.WiFive wrote: Are you sure there is no delay on the sender side? Check with Wireshark?
The sender TCP socket is aggregating packets together (stream protocol) and I didn't knew that.
There is a TCP socket option, TCP_NODELAY, that will solve my problems with python, but the sender software I am using is proprietary and I guess I'll not be able to set the socket correctly for it.
Thanks for the hint =)
Who is online
Users browsing this forum: Bing [Bot] and 388 guests