Page 2 of 2

Re: NTP server giving time after long time

Posted: Tue Jun 11, 2019 11:15 am
by burkulesomesh43
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. :)

Re: NTP server giving time after long time

Posted: Tue Jun 11, 2019 5:23 pm
by Ritesh
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...

Re: NTP server giving time after long time

Posted: Wed Jun 12, 2019 8:12 am
by Ritesh
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

Re: NTP server giving time after long time

Posted: Fri Feb 04, 2022 4:29 pm
by glrtheil
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.

Re: NTP server giving time after long time

Posted: Tue Feb 08, 2022 9:48 am
by Ritesh
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.

Re: NTP server giving time after long time

Posted: Tue Feb 08, 2022 9:50 pm
by glrtheil
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.

Re: NTP server giving time after long time

Posted: Fri Feb 11, 2022 6:51 am
by Ritesh
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.

Re: NTP server giving time after long time

Posted: Sat Feb 12, 2022 4:10 am
by glrtheil
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.

Re: NTP server giving time after long time

Posted: Sat Feb 12, 2022 6:01 am
by Ritesh
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.