Connected but no date and nothing works

  • Hi all,

    I've been struggling with date problem. It starts, connects to LAN/Wifi but nothing works. Date is wrong and displayed as Apr 2019.

    Changing date from cmdline fixes the problem but obviously doesnt survive the reboot.

    Checked ntp availability/firewall - everything works as expected. IPv6 doesn't seem to be configured on router.

    I can see this in systemd log:

    Apr 11 19:28:37 kodi1 systemd[1]: Condition check resulted in Network Time Synchronization being skipped.

    but I can't think of anything that I could do to it.

    connmand doesn't try to sync the time according to the logs.

    No manually configured ntp servers are set in the GUI.

    Read tons of time-related posts/solutions but nothing seems to be helpful.

    Any suggestions are much appreciated.

    LibreELEC 9.2.1 (i've tried latest 9.2.3 but that made no difference)

    http://ix.io/2sob

    http://ix.io/2soc

  • Any chance you have forgotten to enable the "Wait for network" option in the LibreELEC Settings Add-on? A 20 seconds timeout usually does it for Wifi.

  • Hi, I had an issue with time when I upgraded to a Pi4.

    It turned out that there were not any ntp addresses in the correct gui location.

    As I'm in the UK I added addresses two ntp server addresses to the confi: 0.uk.pool.ntp.org and 1.uk.pool.ntp.org. There is an option for a third, but I couldn't be bothered. The location is in the gui is >System>LibreELEC>Network and you will see NTP Servers.

    HTH

  • It turned out that there were not any ntp addresses in the correct gui location.

    Thanks for the suggestion.

    Yes, I've tried adding custom NTP servers to that list, but that didn't make the trick. BTW, I've read somewhere on the Internet, libreELEC has its own set of default NTP servers, so setting these in the GUI is optional.

    What's interesting though is that I don't see it trying any of the custom servers at all. It just ignores this setting!

    If that makes additional sense - the issue depends on the networks RPI is connected to. I've tried to use my cellphone Wifi tethering - and it worked normally. Unfortunately, not with my home connection. I've checked every possible setting on the router, but didn't see anything related or somehow linked to NTP. System time on the router is correct - so the NTP is accessible in provider network.

  • Seems like no suggestions?

    Well, I haven't got to the bottom of this. Tried every possible log/option/idea that I could think of.

    I believe the reason is somewhere inside systemd, when it decides that no time sync is needed:

    Code
    systemd[1]: Condition check resulted in Network Time Synchronization being skipped

    Puzzled, I started writing simple NTP client myself, but then found a very nice way to query NTP servers right from the shell.

    So I worked around the problem by adding this to .config/autorun.sh:

    Code
    sh -c 'while true; do date +%s -s@$((0x$(printf c%47s | nc -uw1 europe.pool.ntp.org 123 | /storage/xxd -s40 -l4 -p) - 2208988800)); sleep 3h; done' &

    This starts sh in background that loops every 3h. It makes single UDP packet, sends it to europe.pool.ntp.org, parses the reply and sets system time from it. Funny, but this single line works _in place_ of all the systemd+ntpd+settings+headaches+whatever!

    So far so good.

    HTH

    Oh, and this requires having xxd at hand, which LibreELEC doesn't have by default. So I've compiled it myself.

    Unzip (forum doesn't allow tgz extensions) then copy to RPI and extract: tar -xvf xxd.tgz

    xxd.tar.zip

    Edited once, last by eungenue (July 28, 2020 at 9:02 PM).

  • I'm seeing the same problem on my Raspberry Pi 3b and Raspberry Pi 3b+. After a reboot, it sometimes successfully updates the time and sometimes it won't, so I'm thinking there's a race condition. "Wait for network = 60s" does not have any effect on this, nor setting the NTP servers.

    systemctl status systemd-timesyncd prints this:

    However, the same output is printed even if the time is set properly. Is systemd-timesyncd used for time sync?

    EDIT: Also as a sidenote, systemctl daemon-reload won't make the warning disappear, I wonder why.

  • It is mostly a guess, but I have observed this behaviour, when the electricity was switched-off in our street (due to maintenance :-))

    Whet it has been restored again, the Raspberry (with libreELEC) was up earlier than the rest of the network. I mean, the devices in our house had addresses assigned by our local router, but the connection to the Internet has not been established yet (i.e. the NTP was inaccessible).

    After manual reboot of the libreELEC Raspberry, the time has been set correctly. Other Raspberies, running Raspbian and systemd-networkd + systemd-timesyncd had the time set correctly.

    Just my 2 cents ...