You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use the latest esp-wifi revision (5578266) att the moment. I run the examples dhcp.rs and embassy_dhcp.rs for ESP32 (ESP32-WROOM-32 DevkitC board).
Most of the times DHCP discovery takes more than 9 seconds, sometimes even up to 30 seconds. Sometimes, however, it takes no time and the MCU immediately gets static IP.
But that happens rarely, about 1 in 10 times. In other times I have to wait ~10 seconds.
Although, the wifi connection and transmission/reception speed is ok (at least for MQTT), no significant delays.
Wifi connection takes almost no time, at most a few seconds.
I used two access points to connect: my home wifi and an access point created by my laptop.
With both of them I observe the same problem. The laptop and therefore the access point are located less than a meter away from the ESP32, so I think the signal quality should be great.
I measured the time it takes for the MCU to send the DHCP discovery packet with wireshark:
(192.168.12.1 is the DHCP server, the IP of the laptop's interface, 192.168.12.84 is the leased IP for the
I see that both the discovery and request packets are sent twice. Is that expected behavior?
I need to clarify that the first DHCP discovery packet is usually delayed for ~10 seconds AFTER I see the Wait to get an ip address debug line (source), for both embassy async and blocking versions.
Thank you. That helped.
Indeed, following the pull request, resetting the DHCP socket after STA is connected solves the problem and DHCP discovery happens almost immediately.
However, I found that I also need to add a little delay of about 200 ms before resetting the socket. Otherwise, the problem stays.
So the code working for me (blocking version):
....
println!("{:?}", controller.is_connected());
let wait_end = current_millis() + 200;
while current_millis() < wait_end {}
wifi_stack.reset();
// wait for getting an ip address
println!("Wait to get an ip address");
....
Hello!
I use the latest esp-wifi revision (5578266) att the moment. I run the examples dhcp.rs and embassy_dhcp.rs for ESP32 (ESP32-WROOM-32 DevkitC board).
Most of the times DHCP discovery takes more than 9 seconds, sometimes even up to 30 seconds. Sometimes, however, it takes no time and the MCU immediately gets static IP.
But that happens rarely, about 1 in 10 times. In other times I have to wait ~10 seconds.
Although, the wifi connection and transmission/reception speed is ok (at least for MQTT), no significant delays.
Wifi connection takes almost no time, at most a few seconds.
I used two access points to connect: my home wifi and an access point created by my laptop.
With both of them I observe the same problem. The laptop and therefore the access point are located less than a meter away from the ESP32, so I think the signal quality should be great.
I measured the time it takes for the MCU to send the DHCP discovery packet with wireshark:
(
192.168.12.1
is the DHCP server, the IP of the laptop's interface,192.168.12.84
is the leased IP for theI see that both the discovery and request packets are sent twice. Is that expected behavior?
I need to clarify that the first DHCP discovery packet is usually delayed for ~10 seconds AFTER I see the
Wait to get an ip address
debug line (source), for both embassy async and blocking versions.The commands I use to run the examples:
Do you know what could be the problem?
Thanks!
The text was updated successfully, but these errors were encountered: