Skip to content

timeClient.update() It takes a very long time to complete.. #129

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

Open
whakru opened this issue Feb 2, 2021 · 4 comments
Open

timeClient.update() It takes a very long time to complete.. #129

whakru opened this issue Feb 2, 2021 · 4 comments
Labels
type: imperfection Perceived defect in any part of project

Comments

@whakru
Copy link

whakru commented Feb 2, 2021

I run a timeClient.update() or timeClient.forceUpdate() check every second.
This function sometimes makes the controller think for 7 seconds of time...
This is very critical.

@per1234 per1234 added the type: imperfection Perceived defect in any part of project label Feb 2, 2021
@ddTech
Copy link

ddTech commented Feb 2, 2021

could that be the dns resolve?
And what is the necessity to update every second?

@whakru
Copy link
Author

whakru commented Feb 2, 2021

could that be the dns resolve?
And what is the necessity to update every second?

it was for a test.
But the same thing happens with a large interval.
it looks like you are right:
image

@ddTech
Copy link

ddTech commented Feb 2, 2021

I had similar behavior when I was experimenting with time servers about two years ago and with a different library and found that the esp8266, that I was using needed quite a bit of time.
I then switched to using the IP-address directly on subsequent calls which was a great improvement.
However the time servers seem to change. So a valid IP now can be invalid a day later.

I then accidentally realized that my local router also was able to serve as an ntp server and since then I am using it as a souce.
This is lightning fast and to 99.9% reliable
I did not have to change anything in the configuration. The NTP functionality was on by default.
Maybe You should give that a try.

@Peter5d5
Copy link

I never had a problem but at one point it could not continue. What I did was insert a delay like
while (!timeClient.update()) {
delay(100);
timeClient.forceUpdate();
}
After this it worked, but it could be luck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

4 participants