esp-hal icon indicating copy to clipboard operation
esp-hal copied to clipboard

esp-wifi: Investigate time to get IP address from DHCP

Open JurajSadel opened this issue 1 year ago • 1 comments
trafficstars

Related to https://github.com/esp-rs/esp-hal/issues/2246. There seems to be another problem which is not handled (and probably should be handled separately) in https://github.com/esp-rs/esp-hal/pull/2251. This issue aims for tracking and investigating it.

JurajSadel avatar Oct 04 '24 09:10 JurajSadel

One user is noticing problems when using phy-enable-usb: https://github.com/esp-rs/esp-hal/discussions/2345#discussioncomment-11022245

Same user observes more problems when using a systimer alarm as async timer compared to TIMG (https://github.com/esp-rs/esp-hal/discussions/2391)

bjoernQ avatar Oct 23 '24 06:10 bjoernQ

Tested connecting to another ESP32(-C3) running a variant of https://github.com/bjoernQ/esp32c3-dhcp-experiment (just removed everything but DHCP) and ESP32-C6 was able to always get an IP in 50ms - 400ms (async slightly better)

bjoernQ avatar Oct 30 '24 11:10 bjoernQ

Tested ESP32-C6 with hot-spot running on Windows 11: 200 - 400ms

Using a Fritz!Box 5590: 20 - 30 ms

bjoernQ avatar Oct 30 '24 11:10 bjoernQ

I'm wondering if in a congested network esp-wifi can somehow miss/drop packets - it seems on a quiet network (mine & @bjoernQ) it seems to work quite well but in the office not so much. I'm just guessing at this point but that seems to be the only real difference :thinking:

MabezDev avatar Oct 30 '24 11:10 MabezDev

(when I was in the office, I also tested it briefly - no problems at all)

bjoernQ avatar Oct 30 '24 11:10 bjoernQ

Oh ... all the testing above was on current main ( 8a23dbe1b6e10459e4d7456f2da96b4c406e7740 ) - on the more-dynamic-allocations branch the numbers a worse

bjoernQ avatar Oct 30 '24 11:10 bjoernQ

False alarm caused by unintendedly enabling ps-max-modem in that branch (but proves that using modem sleep makes getting the IP address harder)

bjoernQ avatar Oct 30 '24 12:10 bjoernQ

What's the status here? Some people seem to be seeing issues, but repeatedly when trying to test things seem to be working on our end. Is this just a signal strength or network congestion issue? Is there anything actionable here, or should we just close this for now?

jessebraham avatar Nov 07 '24 10:11 jessebraham

I don't see anything I can do at least (or anything we can do by changing code at all) - I spent almost a day trying out multiple scenarios - even bad reception and multiple APs using the same SSID etc.

DHCP server sends a single broadcast - if we don't receive it, we wait for the timeout (IIRC 10 seconds) and try again until we succeed.

Timing probably makes a huge difference by randomly working better or worse for different setups I guess

So - if no one comes up with a great idea what to do here I'd say we should close it

bjoernQ avatar Nov 07 '24 10:11 bjoernQ

Let's close this as no fault found.

MabezDev avatar Nov 07 '24 11:11 MabezDev