Page 1 of 1
V3.1 Release pings at 10x over older IDF
Posted: Mon Oct 08, 2018 7:09 pm
by fly135
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
Re: V3.1 Release pings at 10x over older IDF
Posted: Mon Oct 08, 2018 7:19 pm
by fly135
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.
Re: V3.1 Release pings at 10x over older IDF
Posted: Mon Oct 08, 2018 8:40 pm
by davdav
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
Posted: Mon Oct 08, 2018 8:47 pm
by WiFive
davdav wrote:Check v3.1 release note on esp-idf github.
They changed time scale (ms to sec)for ping.
That doesn't affect the measured result just the timeout value passed to the function.
Re: V3.1 Release pings at 10x over older IDF
Posted: Mon Oct 08, 2018 8:51 pm
by fly135
WiFive wrote:davdav wrote:Check v3.1 release note on esp-idf github.
They changed time scale (ms to sec)for ping.
That doesn't affect the measured result just the timeout value passed to the function.
Those are pings from a computer to the ESP32. Would that have an effect on them?
Re: V3.1 Release pings at 10x over older IDF
Posted: Mon Oct 08, 2018 11:03 pm
by ESP_Angus
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
Re: V3.1 Release pings at 10x over older IDF
Posted: Tue Oct 09, 2018 4:00 pm
by fly135
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.
John A
Re: V3.1 Release pings at 10x over older IDF
Posted: Tue Oct 09, 2018 10:53 pm
by ESP_Angus
fly135 wrote:Is there any downside to going to WIFI_PS_NONE?
Only higher power consumption, which won't be any worse than using the default settings in v3.0.