V3.1 Release pings at 10x over older IDF

User avatar
fly135
Posts: 606
Joined: Wed Jan 03, 2018 8:33 pm
Location: Orlando, FL

V3.1 Release pings at 10x over older IDF

Postby fly135 » Mon Oct 08, 2018 7:09 pm

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
Attachments
ping_v31.jpg
ping_v31.jpg (66.42 KiB) Viewed 7778 times
ping_oldsdk.jpg
ping_oldsdk.jpg (75.22 KiB) Viewed 7778 times

User avatar
fly135
Posts: 606
Joined: Wed Jan 03, 2018 8:33 pm
Location: Orlando, FL

Re: V3.1 Release pings at 10x over older IDF

Postby fly135 » Mon Oct 08, 2018 7:19 pm

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
ping_v302.JPG (71.65 KiB) Viewed 7774 times

davdav
Posts: 208
Joined: Thu Nov 17, 2016 2:33 pm

Re: V3.1 Release pings at 10x over older IDF

Postby davdav » Mon Oct 08, 2018 8:40 pm

Check v3.1 release note on esp-idf github.

They changed time scale (ms to sec)for ping.

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: V3.1 Release pings at 10x over older IDF

Postby WiFive » Mon Oct 08, 2018 8:47 pm

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.

User avatar
fly135
Posts: 606
Joined: Wed Jan 03, 2018 8:33 pm
Location: Orlando, FL

Re: V3.1 Release pings at 10x over older IDF

Postby fly135 » Mon Oct 08, 2018 8:51 pm

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?

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: V3.1 Release pings at 10x over older IDF

Postby ESP_Angus » Mon Oct 08, 2018 11:03 pm

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

User avatar
fly135
Posts: 606
Joined: Wed Jan 03, 2018 8:33 pm
Location: Orlando, FL

Re: V3.1 Release pings at 10x over older IDF

Postby fly135 » Tue Oct 09, 2018 4:00 pm

ESP_Angus wrote:If you call esp_wifi_set_ps(WIFI_PS_NONE);, does the ping behaviour start matching v3.0 again?
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

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: V3.1 Release pings at 10x over older IDF

Postby ESP_Angus » Tue Oct 09, 2018 10:53 pm

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.

Who is online

Users browsing this forum: Baidu [Spider] and 98 guests