AI-on-the-edge-device icon indicating copy to clipboard operation
AI-on-the-edge-device copied to clipboard

Time server seems not reachable via address only via IP

Open VincentVerweij opened this issue 2 years ago • 10 comments

The Problem

I have two ESP32 devices which I updated today from 10.5.2 to 12.0.1, it all works fine. But as of that 10.5.2 version one of these two devices has had the Unix start datetime as a value. I did enter the Expert mode for the configuration and entered two different timeservers: time.google.com and nl.pool.ntp.org. After that did not work, I did enter undefined and unchecked the box for TimeServer, but no results.

Today after updating to the latest release, I still saw the issue. In issue #758 I did see that putting in an IP could help, so I tracert nl.pool.ntp.org which gave me 93.94.224.67. And that does seem to help, so it must be something with the DNS not properly resolving.

I don't understand why one device works without touching the TimeServer and the other doesn't. I am able to connect to the device via a static IP and it sends out MQTT which arrives at my Home Assistant, so it able to communicate with the outside world (albeit my local network).

I did see in the release note of v10.6.0 and v10.6.1 that there was a bullet with: Bug Fix: no time with fixed IP, Postprocessing, MQTT, could this be related?

The thing is, if they change the IP for whatever reason then I would have to go in and change it, so it works now but it's not ideal.

Any suggestions on how to troubleshoot or fix? Thanks in advance!

Version

v12.0.1 (Rev: dfe2c46)

Expected Behavior

Proper time syncing with the timeserver when defined as address and not IP as my other ESP seems to do well.

Screenshots

No response

Additional Context

No response

VincentVerweij avatar Nov 05 '22 15:11 VincentVerweij

if it works by IP but not by hostname, then it also could be that the device does not find a DNS server or does not get a response from it.

caco3 avatar Nov 05 '22 23:11 caco3

Do you perhaps have an approach on how to verify which of the two it is that is causing the issue? I probably need to SSH into the ESP, right?

VincentVerweij avatar Nov 06 '22 00:11 VincentVerweij

It does not have an SSH server. But it provides a log through USB. I have seen on my systems that it needs more than the 10 retries and thus et its time to 1. January 1970. I added an issue for this: https://github.com/jomjol/AI-on-the-edge-device/issues/1292 Maybe that was also the issue on your side? A restart would have fixed this.

caco3 avatar Nov 06 '22 00:11 caco3

Nice that you already noticed the retries that might cause an issue 😄 And with a restart I assume that it's a hard one (as in cut the power), not the reboot button that is available in the software?

VincentVerweij avatar Nov 06 '22 19:11 VincentVerweij

And with a restart I assume that it's a hard one (as in cut the power), not the reboot button that is available in the software?

No, a soft reset through the REST API (resp. UI) should be fine.

caco3 avatar Nov 07 '22 09:11 caco3

Ok, then I can confirm that a soft reset does not work. I rebooted multiple times while upgrading from 10.5.2 to 12.0.1, since I installed all intermediate releases too.

VincentVerweij avatar Nov 07 '22 12:11 VincentVerweij

can you show the USB logs of the bad or both systems? Only the startup until the ======================== Main Started ============================ line is relevant

caco3 avatar Nov 07 '22 16:11 caco3

Sorry for not getting back to you yet. Is that the logs that can be found under System > Logs? Or do I need to attach it to my computer to get the so-called USB logs?

VincentVerweij avatar Nov 14 '22 08:11 VincentVerweij

The ones from System > Logs are ok. Make sure it contains the startup sequence as that window only shows the newest 80kB of the log

caco3 avatar Nov 14 '22 16:11 caco3

Hi @caco3, sorry to let you wait. I will try to post the logs in the coming days. Just to let you know that I did not forget about this.

VincentVerweij avatar Dec 01 '22 14:12 VincentVerweij

the next release will contain an improved NTP handling.

You can already play with it with the rolling build.

caco3 avatar Dec 27 '22 20:12 caco3

You can use the latest Automatic Build of the the rolling branch. It might already contain a fix for your issue. Pick the most top passing entry (it has a green circle with a tick in it), then scoll down to the Artifacts and download the file named update_*.

github-actions[bot] avatar Dec 27 '22 20:12 github-actions[bot]