LE 9.2 Incorrect time - no NTP from connman

  • I spent quite a bit of time digging into this and have discovered that connman appears to be doing nothing in regards to setting the time via NTP. This is on a raspberry pi b+ on a wired ethernet connection. During my search I have founds tons of issues of things like: forgetting to set the timezone, using the wrong NTP servers, connman attempting to use IPv6 for NTP communication, etc. etc. My issue is that connman appears to do NOTHING in regards to NTP. There is nothing in my journalctl about it. http://ix.io/22g2

    If I just run `ntpd -n -p pool.ntp.org` the clock gets set fine but is still lost on each reboot. So I can communicate with the NTP servers just fine. Here is my ~/.cache/connman/settings file as well: http://ix.io/22g8

  • Just a hint but no solution: looks like a network configuration issue. There is only a link local address detected first and it takes 95 seconds to get the real one.

    Code
    Apr 11 12:28:40 LibreELEC connmand[460]: eth0 {newlink} index 2 operstate 6 <UP>
    [...]
    Apr 11 12:29:25 LibreELEC connmand[460]: eth0 {add} address 169.254.145.126/16 label eth0 family 2
    [...]
    Apr 11 12:30:15 LibreELEC connmand[460]: eth0 {del} address 169.254.145.126/16 label eth0
    Apr 11 12:30:15 LibreELEC connmand[460]: eth0 {del} route 169.254.0.0 gw 0.0.0.0 scope 253 <LINK>
    Apr 11 12:30:15 LibreELEC connmand[460]: eth0 {add} address 192.168.1.4/24 label eth0 family 2
    [...]
  • I have dropped a note to Connected but no date and nothing works thread.

    As it occurred again, I have looked at the services status, and network-online.service and kodi-waitonnetwork.service are in failed state while wait-time-sync.service is still running (forever). Besides that, all works without problems.

    Note that the date is wrong in the long, but the message shows "1 years 7 months ago" since I have started ntpd then. Any idea how to solve this issue?

    connman.service

    ● connman.service - Connection service

    Loaded: loaded (/usr/lib/systemd/system/connman.service; enabled; vendor preset: disabled)

    Active: active (running) since Thu 2019-04-11 18:28:38 CEST; 1 years 7 months ago

    Main PID: 335 (connmand)

    Memory: 2.2M

    CGroup: /system.slice/connman.service

    └─335 /usr/sbin/connmand -nr --config=/etc/connman/main.conf

    Apr 11 18:29:28 libreElec connmand[335]: eth0 {add} route 0.0.0.0 gw 0.0.0.0 scope 253 <LINK>

    Apr 11 18:31:48 libreElec connmand[335]: eth0 {del} address 169.254.249.21/16 label eth0

    Apr 11 18:31:48 libreElec connmand[335]: eth0 {del} route 169.254.0.0 gw 0.0.0.0 scope 253 <LINK>

    Apr 11 18:31:48 libreElec connmand[335]: eth0 {add} address 192.168.200.12/24 label eth0 family 2

    Apr 11 18:31:48 libreElec connmand[335]: eth0 {add} route 192.168.200.0 gw 0.0.0.0 scope 253 <LINK>

    Apr 11 18:31:48 libreElec connmand[335]: eth0 {add} route 192.168.200.1 gw 0.0.0.0 scope 253 <LINK>

    Apr 11 18:31:48 libreElec connmand[335]: eth0 {add} route 0.0.0.0 gw 192.168.200.1 scope 0 <UNIVERSE>

    Apr 11 18:31:48 libreElec connmand[335]: eth0 {add} route 212.227.81.55 gw 192.168.200.1 scope 0 <UNIVERSE>

    Apr 11 18:31:48 libreElec connmand[335]: eth0 {del} route 212.227.81.55 gw 192.168.200.1 scope 0 <UNIVERSE>

    network-online.service

    ● network-online.service - Wait for network to be configured by ConnMan

    Loaded: loaded (/usr/lib/systemd/system/network-online.service; enabled; vendor preset: disabled)

    Active: failed (Result: exit-code) since Thu 2019-04-11 18:29:08 CEST; 1 years 7 months ago

    Main PID: 346 (code=exited, status=110)

    Apr 11 18:28:38 libreElec systemd[1]: Starting Wait for network to be configured by ConnMan...

    Apr 11 18:29:08 libreElec systemd[1]: network-online.service: Main process exited, code=exited, status=110/n/a

    Apr 11 18:29:08 libreElec systemd[1]: network-online.service: Failed with result 'exit-code'.

    Apr 11 18:29:08 libreElec systemd[1]: Failed to start Wait for network to be configured by ConnMan.

    wait-time-sync.service

    ● wait-time-sync.service - Wait For Kernel Time Synchronized

    Loaded: loaded (/usr/lib/systemd/system/wait-time-sync.service; disabled; vendor preset: disabled)

    Active: activating (start) since Thu 2019-04-11 18:28:36 CEST; 1 years 7 months ago

    Main PID: 189 (wait-time-sync)

    Memory: 404.0K

    CGroup: /system.slice/wait-time-sync.service

    └─189 /usr/bin/wait-time-sync

    kodi-waitonnetwork.service

    ● kodi-waitonnetwork.service - Wait on network

    Loaded: loaded (/usr/lib/systemd/system/kodi-waitonnetwork.service; disabled; vendor preset: disabled)

    Active: failed (Result: exit-code) since Thu 2019-04-11 18:28:48 CEST; 1 years 7 months ago

    Main PID: 345 (code=exited, status=110)

    Apr 11 18:28:38 libreElec systemd[1]: Starting Wait on network...

    Apr 11 18:28:48 libreElec systemd[1]: kodi-waitonnetwork.service: Main process exited, code=exited, status=110/n/a

    Apr 11 18:28:48 libreElec systemd[1]: kodi-waitonnetwork.service: Failed with result 'exit-code'.

    Apr 11 18:28:48 libreElec systemd[1]: Failed to start Wait on network.

  • In my case it was taking so long to update the date/time via NTP, like 15+ minutes. With this "not elegant" solution I got it down to 2-3 minutes top.

    Code
    crontab -e

    Adding this line to it (*/1 means this runs every minute, and can be tuned on your needs):

    Code
    */1 * * * * ntpd -n -p europe.pool.ntp.org