Time synchronisation

  • As has been discussed recently in this thread LibreELEC
    and various other places, there are issues with LE time synchronisation.
    Systemd has a target 'time-sync.target' which does not appear to be used in LE.
    Is this by design or... ?

    I am running the Milhouse Krypton builds, currently #929.

    Edited once, last by agb (September 30, 2016 at 1:07 PM).

  • Make sure to set your timezone in kodi, this will set the tz-data service.
    settings --> appearance --> international --> timezone.

    Also, you may want to enable the option "wait for network" in the LibreELEC settings add-on

  • Done all that, wouldn't be investigating otherwise :-}

    LibreELEC:~ # connmanctl clock
    Time = 1475274100
    TimeUpdates = auto
    Timezone = Europe/Belfast
    TimezoneUpdates = auto
    Timeservers = [ uk.pool.ntp.org ]
    [not quite sure where Belfast came from, I set it to Europe/London]

  • Well, your not the only one with time sync issues!

    My EPG has not been working for days.................now I know why!?

    LibreELECTV:~ # date
    Fri Sep 23 09:16:07 CEST 2016

    LibreELECTV:~ # connmanctl clock
    Time = 1474615063
    TimeUpdates = auto
    Timezone = Europe/Copenhagen
    TimezoneUpdates = auto
    Timeservers = [ 0.dk.pool.ntp.org ]

    As you can see above, I have tried adding a NTP server - But this does not work.

    So I havE corrected the date manually! HA!.............but only lives for the moment.

    At every restart the date is set back to Sep 23rd 9AM!

    Anyone got a clue here?

    /Morten

  • I believe Millhouse explained the default time setting - it is derived from the build date/time [either kernel or LE, can't remember which].
    Have a look in the journal [journalctl] - there should be something about time changes in there - my original point was that the time change occurred too late - after kodi ran.
    Also have a look at the discussion in the feature request I linked above - I'm going to try adding a RTC module, since it seems unlikely the LE is going to change in this area.

    PS. Also, you may want to enable the option "wait for network" in the LibreELEC settings add-on - as suggested by lrusak a few messages back.
    PPS. OSMC seems to sync. the time before starting kodi, but LE doesn't [always].

    Edited once, last by agb (October 7, 2016 at 12:13 PM).

  • OSMC boots slower than LE and this is ultimately all about timing/sequencing. NTP is not considered to be an essential service so the OS doesn't provide methods to say "check at exactly this point in the boot sequence" so what's likely happening (can be proven with connman debugging active) is the first NTP check fails as the network stack isn't fully up yet (common on arm devices) and then it's another 15-30 mins before another NTP check. You can use autostart.sh to background an NTP check for 15 seconds (normally enough for the network to be up) and delay Kodi start (the wait-for-network option in LE settings) for 30 seconds to stagger things. Once it works you can tweak the values down to speed-up boot.