Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange 'sawtooth' pattern ICMP latency measurements #483

Open
clarkmcc opened this issue Sep 12, 2024 · 3 comments
Open

Strange 'sawtooth' pattern ICMP latency measurements #483

clarkmcc opened this issue Sep 12, 2024 · 3 comments

Comments

@clarkmcc
Copy link

clarkmcc commented Sep 12, 2024

Disclaimer: I'm new to embedded

I'm running the WiFi example with my esp32c6 with a few changes (like mem::forget the wifi type to keep it running beyond main), and I pinged it from my laptop for a couple hours. I've tested and seen the same behavior on an XIAO ESP32-C6 and a ESP32-C6 WROOM I saw this 'sawtooth' pattern consistently basically the entire time.

What's interesting is that I'm seeing latency as short as 2ms but it's consistently very short and very long in a saw pattern (my laptop, the esp32c6 and the wifi AP are all within 2ft of each other). Is there an explanation for this behavior?

10641 packets transmitted, 10639 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 2.784/179.418/885.236/100.006 ms

image

The following image illustrates the saw pattern even more by plotting the latency (X) against the previous ICMP request's latency (Y).
image

@clarkmcc clarkmcc changed the title Strange 'saw' pattern ICMP latency measurements Strange 'sawtooth' pattern ICMP latency measurements Sep 12, 2024
@clarkmcc
Copy link
Author

As a point of reference, same laptop, same network, different target devices (instead of the ESP). None of these have the same reproducible pattern that the ESP has. Curious if that has anything to do with the networking implementation here.

A printer
image

Cell phone
image

Hardwired desktop
image

@ivmarkov
Copy link
Collaborator

No idea, but to remove the Rust ESP IDF wrappers out of the equation, can you try with some of the C wifi examples and see if you still get this behavior? If so, I guess you need to re-open the same issue in the ESP IDF repo...

@jothan
Copy link
Contributor

jothan commented Oct 19, 2024

Try calling this function somewhere early in your Wi-Fi init:

use esp_idf_svc::sys::{self, EspError};

pub fn wifi_disable_powersave() -> Result<(), EspError> {
    esp!(unsafe { sys::esp_wifi_set_ps(sys::wifi_ps_type_t_WIFI_PS_NONE) })
}

It should make a big difference, especially if you have a high DTIM on your network.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

3 participants