Fix order of magnitude error when creating timestamp #44
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.