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

Fix order of magnitude error when creating timestamp #44

Merged
merged 1 commit into from
Aug 8, 2022

Conversation

MabezDev
Copy link
Member

@MabezDev MabezDev commented Aug 4, 2022

I've been trying to improve the reliability of esp-wifi and found something peculiar when I was creating a DNS example in https://github.com/esp-rs/esp-wifi/tree/example/dns-query for @JurajSadel, it would take nearly 10 minutes to resolve the DNS query, which was very odd.

I looked a bit deeper and it turned out that the timestamping mechanism was increasing one millisecond per second meaning any timeout would be 1000 times longer than it should be! With this fix, provided the WiFi actually connects to the AP, I can reliably get an IP from DHCP and run through the stages loop. Even on my crappy powerline router which takes 15~ seconds to respond to DHCP.

@jessebraham I think this might fix some issues for you. Possibly fixes #38 too? Would you mind trying with this very small patch, @D1plo1d?

Sadly the AP connection can sometimes still fail but I haven't had a chance to look into that, it may just be a case of having to retry the connection sometimes.

@MabezDev MabezDev requested a review from bjoernQ August 4, 2022 20:20
Copy link
Contributor

@bjoernQ bjoernQ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great find! Thanks for fixing this

@bjoernQ bjoernQ merged commit 60e57ef into main Aug 8, 2022
@D1plo1d
Copy link

D1plo1d commented Aug 20, 2022

I'm a bit late to the party but I tested this today and it fixed my connection issue. Amazing! Thanks @MabezDev! 🥳

@bjoernQ bjoernQ deleted the bugfix/timestamp branch December 16, 2022 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dhcp_esp32c3 example fails to get an IP address when compiled in Release
3 participants