The testing dept for my project just hit me with a complaint that the latest version had huge ping latency compared to an older version of my code release. At first I thought that maybe CPU utilization was different, but investigations in that area led to a dead end.
So I took the SNTP example and deleted the statement where it turns off wifi after getting the time and compiled it with v3.1 release and a much older sdk (v3.0-dev-1839-gc97b8756f) downloaded around the beginning of Jan. Turns out that v3.1 release pings at 10x latency of the older SDK.
Seems like something significant must of changed to result in a 10x latency increase. In the JPGs you can see the v3.1 release has much higher ping times. This was run off the same device by build/run/clean then change the IDF path and repeat.
John A
V3.1 Release pings at 10x over older IDF
V3.1 Release pings at 10x over older IDF
- Attachments
-
- ping_v31.jpg (66.42 KiB) Viewed 8590 times
-
- ping_oldsdk.jpg (75.22 KiB) Viewed 8590 times
Re: V3.1 Release pings at 10x over older IDF
Just ran the test with 3.0.2 release. It also pings at a much lower value. Issue seems to be introduced in 3.1 release.
- Attachments
-
- ping_v302.JPG (71.65 KiB) Viewed 8586 times
Re: V3.1 Release pings at 10x over older IDF
Check v3.1 release note on esp-idf github.
They changed time scale (ms to sec)for ping.
They changed time scale (ms to sec)for ping.
Re: V3.1 Release pings at 10x over older IDF
That doesn't affect the measured result just the timeout value passed to the function.davdav wrote:Check v3.1 release note on esp-idf github.
They changed time scale (ms to sec)for ping.
Re: V3.1 Release pings at 10x over older IDF
Those are pings from a computer to the ESP32. Would that have an effect on them?WiFive wrote:That doesn't affect the measured result just the timeout value passed to the function.davdav wrote:Check v3.1 release note on esp-idf github.
They changed time scale (ms to sec)for ping.
Re: V3.1 Release pings at 10x over older IDF
Hi fly135,
The time scale change was for the "esp_ping" app in ESP-IDF, so pinging from a computer should be the same.
If you call esp_wifi_set_ps(WIFI_PS_NONE);, does the ping behaviour start matching v3.0 again?
The default sleep mode was changed from WIFI_PS_NONE to WIFI_PS_MIN_MODEM in V3.1. WIFI_PS_MIN_MODEM will sleep for up to one DTIM interval (one beacon frame period) to reduce power consumption. If the beacon frame period of your AP is 100ms, this can mean delays of up to 100ms and this matches the ping times you're seeing.
(Receiving pings is something of a worst-case for modem sleep latency, because you have long periods of no activity punctuated by a single packet - so the modem will almost always choose to go to sleep during the long periods when nothing is happening.)
Angus
The time scale change was for the "esp_ping" app in ESP-IDF, so pinging from a computer should be the same.
If you call esp_wifi_set_ps(WIFI_PS_NONE);, does the ping behaviour start matching v3.0 again?
The default sleep mode was changed from WIFI_PS_NONE to WIFI_PS_MIN_MODEM in V3.1. WIFI_PS_MIN_MODEM will sleep for up to one DTIM interval (one beacon frame period) to reduce power consumption. If the beacon frame period of your AP is 100ms, this can mean delays of up to 100ms and this matches the ping times you're seeing.
(Receiving pings is something of a worst-case for modem sleep latency, because you have long periods of no activity punctuated by a single packet - so the modem will almost always choose to go to sleep during the long periods when nothing is happening.)
Angus
Re: V3.1 Release pings at 10x over older IDF
Hi Angus, Thanks for the info. Calling that function has lowered pings latency back to v3.0/v3.1 times. Is there any downside to going to WIFI_PS_NONE? We are plugged into the wall so power isn't an issue. But response to network packets is important.ESP_Angus wrote:If you call esp_wifi_set_ps(WIFI_PS_NONE);, does the ping behaviour start matching v3.0 again?
John A
Re: V3.1 Release pings at 10x over older IDF
Only higher power consumption, which won't be any worse than using the default settings in v3.0.fly135 wrote:Is there any downside to going to WIFI_PS_NONE?
Who is online
Users browsing this forum: Google [Bot], iParcelBox, jtroncin21 and 121 guests