NTP server giving time after long time

burkulesomesh43
Posts: 132
Joined: Tue Aug 14, 2018 6:21 am
Location: India

Re: NTP server giving time after long time

Postby burkulesomesh43 » Tue Jun 11, 2019 11:15 am

Ritesh wrote:
Tue Jun 11, 2019 11:10 am
burkulesomesh43 wrote:
Tue Jun 11, 2019 10:59 am
Ritesh wrote:
Tue Jun 11, 2019 10:55 am


Hi,

We have tried same way at our end and didn't face any issue till now. I just want to clarify that are you sending NTP request after getting proper IP and external connectivity into device itself?
Yes, I am sending NTP request after connecting the device to Network.
Then it should be worked?

Would you please try with master IDF as well with just sample STA example in which after getting IP event just ping to SNTP Server accordingly.

If still it is not working then there might be chances into your network as well or try with Hot-Spot as well with external network connectivity.
Ok.
I will check and let you know friend. :)
--
Somesh Burkule

Ritesh
Posts: 1383
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: NTP server giving time after long time

Postby Ritesh » Tue Jun 11, 2019 5:23 pm

burkulesomesh43 wrote:
Tue Jun 11, 2019 11:15 am
Ritesh wrote:
Tue Jun 11, 2019 11:10 am
burkulesomesh43 wrote:
Tue Jun 11, 2019 10:59 am

Yes, I am sending NTP request after connecting the device to Network.
Then it should be worked?

Would you please try with master IDF as well with just sample STA example in which after getting IP event just ping to SNTP Server accordingly.

If still it is not working then there might be chances into your network as well or try with Hot-Spot as well with external network connectivity.
Ok.
I will check and let you know friend. :)
Sounds good... Thanks...
Regards,
Ritesh Prajapati

Ritesh
Posts: 1383
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: NTP server giving time after long time

Postby Ritesh » Wed Jun 12, 2019 8:12 am

Ritesh wrote:
Tue Jun 11, 2019 5:23 pm
burkulesomesh43 wrote:
Tue Jun 11, 2019 11:15 am
Ritesh wrote:
Tue Jun 11, 2019 11:10 am


Then it should be worked?

Would you please try with master IDF as well with just sample STA example in which after getting IP event just ping to SNTP Server accordingly.

If still it is not working then there might be chances into your network as well or try with Hot-Spot as well with external network connectivity.
Ok.
I will check and let you know friend. :)
Sounds good... Thanks...
Hi,

Let me know if you are still facing any issue for that
Regards,
Ritesh Prajapati

glrtheil
Posts: 61
Joined: Tue Dec 07, 2021 2:48 pm

Re: NTP server giving time after long time

Postby glrtheil » Fri Feb 04, 2022 4:29 pm

There is a reason this happens that I finally figured out. When using something like pool.ntp.org, you are given a random server that it will get time from. After an exhaustive search into why this happens, which included creating rules in my firewall to log NTP traffic from my esp32, I found that it would often be trying to reach out to an NTP server that would time out. I would then test the NTP server with an online NTP test tool, and they would almost always time out in that tool. The problem isn't the ESP32, it's the server in the ntp pool. There are A LOT of servers that are non-responsive, or that take upwards of 10-20 seconds to respond. It's annoying and I'm still trying to figure out a better way to force a change to another server. I find that just resetting the controller typically works.

Ritesh
Posts: 1383
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: NTP server giving time after long time

Postby Ritesh » Tue Feb 08, 2022 9:48 am

glrtheil wrote:
Fri Feb 04, 2022 4:29 pm
There is a reason this happens that I finally figured out. When using something like pool.ntp.org, you are given a random server that it will get time from. After an exhaustive search into why this happens, which included creating rules in my firewall to log NTP traffic from my esp32, I found that it would often be trying to reach out to an NTP server that would time out. I would then test the NTP server with an online NTP test tool, and they would almost always time out in that tool. The problem isn't the ESP32, it's the server in the ntp pool. There are A LOT of servers that are non-responsive, or that take upwards of 10-20 seconds to respond. It's annoying and I'm still trying to figure out a better way to force a change to another server. I find that just resetting the controller typically works.
Yes. Exactly There may be chances of NTP Server which device is requesting may not respond quickly and after resetting controller it will be connected within quick time.

I just want to add few things that into NTP Server you can define multiple NTP Server as per your requirements and also can fix to only one particular NTP Server as well.
Regards,
Ritesh Prajapati

glrtheil
Posts: 61
Joined: Tue Dec 07, 2021 2:48 pm

Re: NTP server giving time after long time

Postby glrtheil » Tue Feb 08, 2022 9:50 pm

Ritesh wrote:
Tue Feb 08, 2022 9:48 am
Yes. Exactly There may be chances of NTP Server which device is requesting may not respond quickly and after resetting controller it will be connected within quick time.

I just want to add few things that into NTP Server you can define multiple NTP Server as per your requirements and also can fix to only one particular NTP Server as well.
Yeah, I have set mine up with 4 servers: 0.pool.ntp.org, time.nist.gov, time.windows.com, and time.google.com. What I don't understand is how/when it uses those servers, because even with all 4 configured, I have no idea when it will time out and try a different server in the list. It seems to only ever try the first one, but it's hard to tell.

Ritesh
Posts: 1383
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: NTP server giving time after long time

Postby Ritesh » Fri Feb 11, 2022 6:51 am

glrtheil wrote:
Tue Feb 08, 2022 9:50 pm
Ritesh wrote:
Tue Feb 08, 2022 9:48 am
Yes. Exactly There may be chances of NTP Server which device is requesting may not respond quickly and after resetting controller it will be connected within quick time.

I just want to add few things that into NTP Server you can define multiple NTP Server as per your requirements and also can fix to only one particular NTP Server as well.
Yeah, I have set mine up with 4 servers: 0.pool.ntp.org, time.nist.gov, time.windows.com, and time.google.com. What I don't understand is how/when it uses those servers, because even with all 4 configured, I have no idea when it will time out and try a different server in the list. It seems to only ever try the first one, but it's hard to tell.
Hello,

Yes. It will be operated like first server will be validated then second server then so on. So, Device will be connected with anyone of server then it will be stopped to validate rest of server.
Regards,
Ritesh Prajapati

glrtheil
Posts: 61
Joined: Tue Dec 07, 2021 2:48 pm

Re: NTP server giving time after long time

Postby glrtheil » Sat Feb 12, 2022 4:10 am

Ritesh wrote:
Fri Feb 11, 2022 6:51 am
Hello,

Yes. It will be operated like first server will be validated then second server then so on. So, Device will be connected with anyone of server then it will be stopped to validate rest of server.
I have never seen it use anything but the first designated server. Seems like if the first times out, it never moves on until the ESP is reset.

Ritesh
Posts: 1383
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: NTP server giving time after long time

Postby Ritesh » Sat Feb 12, 2022 6:01 am

glrtheil wrote:
Sat Feb 12, 2022 4:10 am
Ritesh wrote:
Fri Feb 11, 2022 6:51 am
Hello,

Yes. It will be operated like first server will be validated then second server then so on. So, Device will be connected with anyone of server then it will be stopped to validate rest of server.
I have never seen it use anything but the first designated server. Seems like if the first times out, it never moves on until the ESP is reset.
If that is not possible then you can also mimic like that into your application or application component where you can do some modifications as per your requirements.
Regards,
Ritesh Prajapati

Who is online

Users browsing this forum: KMTsvetanov and 121 guests