Moode Forum
Time wrong on 8.1 - Printable Version

+- Moode Forum (https://moodeaudio.org/forum)
+-- Forum: moOde audio player (https://moodeaudio.org/forum/forumdisplay.php?fid=3)
+--- Forum: Support (https://moodeaudio.org/forum/forumdisplay.php?fid=7)
+--- Thread: Time wrong on 8.1 (/showthread.php?tid=4905)



Time wrong on 8.1 - the_bertrum - 06-24-2022

I was looking in logs and noticed the time is wrong on my recently updated Pi Zero:
Code:
pi@Prometheus:~ $ date
Wed 22 Jun 2022 07:18:52 AM BST


It's actually Friday at 14:37!

Can't see the ntp service running, how is the time set on moOde?


RE: Time wrong on 8.1 - Tim Curtis - 06-24-2022

I think Raspberry Pi OS uses timedatectl.

Code:
pi@moode:~ $ timedatectl
              Local time: Fri 2022-06-24 09:53:51 EDT
          Universal time: Fri 2022-06-24 13:53:51 UTC
                RTC time: n/a
               Time zone: America/Detroit (EDT, -0400)
System clock synchronized: yes
             NTP service: active
         RTC in local TZ: no
pi@moode:~ $



RE: Time wrong on 8.1 - the_bertrum - 06-24-2022

(06-24-2022, 01:55 PM)Tim Curtis Wrote: I think Raspberry Pi OS uses timedatectl.

Code:
pi@moode:~ $ timedatectl
              Local time: Fri 2022-06-24 09:53:51 EDT
          Universal time: Fri 2022-06-24 13:53:51 UTC
                RTC time: n/a
               Time zone: America/Detroit (EDT, -0400)
System clock synchronized: yes
             NTP service: active
         RTC in local TZ: no
pi@moode:~ $

Mine says this:

Code:
pi@Prometheus:~ $ timedatectl
              Local time: Wed 2022-06-22 07:43:21 BST
          Universal time: Wed 2022-06-22 06:43:21 UTC
                RTC time: n/a
               Time zone: Europe/London (BST, +0100)
System clock synchronized: no
             NTP service: n/a
         RTC in local TZ: no
Looks like it isn't synchronising.  I'll have a dig about...


RE: Time wrong on 8.1 - TheOldPresbyope - 06-24-2022

Interesting. 

timedatectl says NTP service is active on my 64-bit moOde 8.1 player but  'n/a' on the 32-bit version. nB---it's active on the (32-bit) 8.02 player I keep around.

Regards,
Kent


RE: Time wrong on 8.1 - the_bertrum - 06-24-2022

It might be another 32/64 bit image difference.

On my player based on the 64bit image:

Code:
pi@Orpheus:~ $ timedatectl
              Local time: Fri 2022-06-24 15:06:35 BST
          Universal time: Fri 2022-06-24 14:06:35 UTC
                RTC time: n/a
               Time zone: Europe/London (BST, +0100)
System clock synchronized: yes
             NTP service: active
         RTC in local TZ: no
While on my 32 bit player:

Code:
pi@Prometheus:~ $ timedatectl status
              Local time: Wed 2022-06-22 07:50:21 BST
          Universal time: Wed 2022-06-22 06:50:21 UTC
                RTC time: n/a
               Time zone: Europe/London (BST, +0100)
System clock synchronized: no
             NTP service: n/a
         RTC in local TZ: no
Notice the NTP service is not available.

Then, using the set-ntp command which should turn on or off the NTP, on 64 gives:

Code:
pi@Orpheus:~ $ timedatectl set-ntp 0
==== AUTHENTICATING FOR org.freedesktop.timedate1.set-ntp ===
Authentication is required to control whether network time synchronization shall be enabled.
Authenticating as: ,,, (pi)
Password:
I quit out rather than giving my password because I didn't want to turn it off.

Same command on 32:

Code:
pi@Prometheus:~ $ timedatectl set-ntp 0
Failed to set ntp: NTP not supported
And in case that's just something that happens when turning off an already off service:

Code:
pi@Prometheus:~ $ timedatectl set-ntp 1
Failed to set ntp: NTP not supported


Could it be the NTP packages are missing from the 32 bit image?


RE: Time wrong on 8.1 - Tim Curtis - 06-24-2022

Try below on 32-bit.

Code:
sudo apt install systemd-timesyncd

It should be active after install

Code:
pi@moode:~ $ systemctl status systemd-timesyncd
● systemd-timesyncd.service - Network Time Synchronization
    Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; enabled; vendor preset: enabled)
    Active: active (running) since Tue 2022-06-21 19:42:28 EDT; 2 days ago
      Docs: man:systemd-timesyncd.service(8)
  Main PID: 2498 (systemd-timesyn)
    Status: "Initial synchronization to time server 144.34.193.110:123 (0.debian.pool.ntp.org)."
     Tasks: 2 (limit: 2060)
       CPU: 163ms
    CGroup: /system.slice/systemd-timesyncd.service
            └─2498 /lib/systemd/systemd-timesyncd

Jun 21 19:42:28 moode systemd[1]: Starting Network Time Synchronization...
Jun 21 19:42:28 moode systemd[1]: Started Network Time Synchronization.
Jun 24 10:51:42 moode systemd-timesyncd[2498]: Initial synchronization to time server 144.34.193.110:123 (0.debian.pool.ntp.org).
pi@moode:~ $ sudo timedatectl
              Local time: Fri 2022-06-24 10:52:01 EDT
          Universal time: Fri 2022-06-24 14:52:01 UTC
                RTC time: n/a
               Time zone: America/Detroit (EDT, -0400)
System clock synchronized: yes
             NTP service: active
         RTC in local TZ: no
pi@moode:~ $



RE: Time wrong on 8.1 - TheOldPresbyope - 06-24-2022

@the_bertrum

It appears the package systemd-timesyncd is missing in the 32-bit build.

I'm running into headwinds trying to install it. Running sudo apt-get update took a long time. First it hung for a while on our moOde repo (https://dl.cloudsmith.io/public/moodeaudio/...) and then I got error messages for two RPF repos:

Code:
pi@m81pi3a32:~ $ sudo apt-get update
Get:1 http://raspbian.raspberrypi.org/raspbian bullseye InRelease [15.0 kB]
Get:2 http://archive.raspberrypi.org/debian bullseye InRelease [23.7 kB]                                                          
Get:3 https://dl.cloudsmith.io/public/moodeaudio/m8y/deb/raspbian bullseye InRelease [5,173 B]
Reading package lists... Done                                                                                                                  
E: Release file for http://raspbian.raspberrypi.org/raspbian/dists/bullseye/InRelease is not valid yet (invalid for another 2d 8h 58min 46s). Updates for this repository will not be applied.
E: Release file for http://archive.raspberrypi.org/debian/dists/bullseye/InRelease is not valid yet (invalid for another 1d 15h 16min 59s). Updates for this repository will not be applied.

Neither happens on the 64-bit repos.

Now I'm seeing sudo apt-get install systemd-timesyncd take approximately forever as the "Buildng Dependency tree..." step increments by about 1 percent per minute!

Regards,
Kent


RE: Time wrong on 8.1 - TheOldPresbyope - 06-24-2022

One of these days I'll manage to finish composing a reply ahead of Tim Tongue

It appears that my difficulty updating/installing relates to having the Squeezelite renderer active. I killed that and the install finished lickety-split. Likewise apt-get update ran flawlessly when repeated. Color me confused.

As Tim said, once the systemd-timesyncd package was installed the service started.

Regards,
Kent


RE: Time wrong on 8.1 - the_bertrum - 06-24-2022

Code:
pi@Prometheus:~ $ sudo apt install systemd-timesyncd
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
 systemd-timesyncd
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 131 kB of archives.
After this operation, 203 kB of additional disk space will be used.
Get:1 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf systemd-timesyncd armhf 247.3-7+rpi1 [131 kB]
Fetched 131 kB in 1s (138 kB/s)
Selecting previously unselected package systemd-timesyncd.
(Reading database ... 64479 files and directories currently installed.)
Preparing to unpack .../systemd-timesyncd_247.3-7+rpi1_armhf.deb ...
Unpacking systemd-timesyncd (247.3-7+rpi1) ...
Setting up systemd-timesyncd (247.3-7+rpi1) ...
Created symlink /etc/systemd/system/dbus-org.freedesktop.timesync1.service → /lib/systemd/system/systemd-timesyncd.service.
Created symlink /etc/systemd/system/sysinit.target.wants/systemd-timesyncd.service → /lib/systemd/system/systemd-timesyncd.service.
Processing triggers for dbus (1.12.20-2) ...
Processing triggers for man-db (2.9.4-2) ...
pi@Prometheus:~ $ timedatectl status
              Local time: Fri 2022-06-24 16:16:02 BST
          Universal time: Fri 2022-06-24 15:16:02 UTC
                RTC time: n/a
               Time zone: Europe/London (BST, +0100)
System clock synchronized: yes
             NTP service: active
         RTC in local TZ: no

That did it!
Thanks Tim and Kent