Syncing system time after boot

I’m using CoreELEC as TVHeadend server only, so disabled kodi service.

My guess is that CoreELEC updates system time from internet only at boot, is this correct?
We have rare power cuts.
After a power cut, establishing new internet connection takes about 1-2 minutes.

If internet connection is not ready at boot, system time isn’t being updated . And wrong system time causes problems in tvheadend EPGs.

How can I fix this?

What Hardware?

I don’t think it matters but I have Mecool KII Pro

You can try the command:
ntpd -d -n -q -p <ip.adress.router>

In my case europe.pool.ntp.org is set inside my router(fritz!box)

My Linux scripting is limited but try putting something like this in autostart.sh

#!/bin/bash

until $(curl --output /dev/null --silent --head --fail --max-time 5 http://google.com); do
  sleep 20
done

ntpd -d -n -q -p europe.pool.ntp.org

It should hit google every 20 seconds until it gets a response then set the network time.

2 Likes