Home of the Squeezebox™ & Transporter® network music players.
Page 3 of 3 FirstFirst 123
Results 21 to 30 of 30
  1. #21
    Senior Member mr-b's Avatar
    Join Date
    Feb 2007
    Location
    UK
    Posts
    429
    Useful info - will have a look at ntpd daemon but configuring that is a fair way outside my knowledge.
    Appreciate PCP is a minimal system but if it's going to run LMS and assuming all the network ducks are in a row for UDP only at boot time sounds like setting up for a fall. Heaven forfend if Kerberos is ever supported!

    My first inkling of issues was when my scan results were missing lots of tracks - I was suspecting the GigE network on the pi4 etc. (never had an issue with pi3 & LMS7.9) but then spotted this:

    The server has finished scanning your media library.
    Total Time: 00:01:04 (Thursday, January 1, 1970 / 10:31 PM)

    I'd guess the most reliable way would be use a DHCP scope set NTP server, or the router, or just well-known NTP servers (what I'd guess most folks rely on) and retry on error for a period after boot, and then maybe sync daily (though no idea how variable the pi clock is). Not sure what s/w can do that ...

    (https://www.meinbergglobal.com/engli...er-monitor.htm is quite a nice little utility to measure NTP health. It seems to think they're all Ok so disagrees with the PCP ntpd results I posted earlier, so I still suspect something is amiss.)

  2. #22
    Senior Member Greg Erskine's Avatar
    Join Date
    Sep 2006
    Location
    Sydney, Australia
    Posts
    1,879
    A couple of things that I tried before but have just confirmed.

    You can't set date quite to epoch, 1970-01-03 is OK. If you try to set the earliest date in epoch seconds, you will find it actually changes.

    When running ntpd as a daemon, it will only adjust time from a large delta once. So if you are testing by setting date to near epoch, it will fix the date the first time but not after that. I have read the maximum delta is 1000 or 4000 depending on the ntpd version. I haven't confirmed this.

    These don't affect normal operation, its just means your testing can seem random until you work out what's happening.

    Has anyone worked out the actual time drift of a Raspberry Pi?

  3. #23
    Senior Member mr-b's Avatar
    Join Date
    Feb 2007
    Location
    UK
    Posts
    429
    Ok I'm stumped - it's gone back to epoch again , even with the cron entry. :-(

    ~$ date
    Thu Jan 1 04:14:31 GMT 1970

    Oops - my Pi3 has the same!

    WTF is going on?

    E2A - must have been a power brown out as an ordinary clock has reset too. But the boot time NTP issue must still be present ...
    Last edited by mr-b; 2020-07-14 at 14:23.

  4. #24
    Senior Member Greg Erskine's Avatar
    Join Date
    Sep 2006
    Location
    Sydney, Australia
    Posts
    1,879
    I've been using 2 RPi4B's since their release, can't remember one occasion when the date wasn't set. So we need to find what's out the different with your RPi4B.

    If you reboot, and the problem is still there, the cron job will only fix the problem once it runs. When did you schedule it to run?

    Running the ntpd as a cron job is really only fixing time drift.

    Did you try running ntpd as a daemon?
    Last edited by Greg Erskine; 2020-07-14 at 14:31.

  5. #25
    Senior Member
    Join Date
    Apr 2005
    Location
    UK/London
    Posts
    2,716
    FYI - I found RPi drifts about 2 to 4 seconds per day.
    While that might be critical for some applications I find that it is not an issue when using it as a player or server - and a once a day cron-based time sync stops that drift going too far.
    Paul Webster
    http://dabdig.blogspot.com
    Author of "Now Playing" plugins covering Radio France (FIP etc), KCRW, Supla Finland, ABC Australia, CBC/Radio-Canada and RTE Ireland

  6. #26
    Senior Member Greg Erskine's Avatar
    Join Date
    Sep 2006
    Location
    Sydney, Australia
    Posts
    1,879
    Thanks Paul, 2 to 4 seconds.

    Has anyone tried adding "/usr/sbin/ntpd -p pool.ntp.org" to a User command?

    This adds a ntpd daemon but as I don't have an issue I haven't proved it works.

    EDIT: It works. I booted without a network cable, so time set to epoch. Plugged network cable in and time was synced.
    Last edited by Greg Erskine; 2020-07-17 at 00:40.

  7. #27
    Senior Member mr-b's Avatar
    Join Date
    Feb 2007
    Location
    UK
    Posts
    429
    I didn't realise that was all it was!
    So I just put that cmd in Tweaks > User Commands?
    How often does it run i.e. is it more onerous than the cron job? I coudn't find that definitive info on that - other than "only one query every 1024 seconds (or longer)".

  8. #28
    Senior Member
    Join Date
    Apr 2005
    Location
    UK/London
    Posts
    2,716
    When you run it as a daemon it is always running - so you can use "top" or similar to see what resources it is consuming.
    Most of the time it will be sleeping.
    Last edited by Paul Webster; 2020-07-19 at 04:02. Reason: Edited to make explicit reference to daemon
    Paul Webster
    http://dabdig.blogspot.com
    Author of "Now Playing" plugins covering Radio France (FIP etc), KCRW, Supla Finland, ABC Australia, CBC/Radio-Canada and RTE Ireland

  9. #29
    Senior Member Greg Erskine's Avatar
    Join Date
    Sep 2006
    Location
    Sydney, Australia
    Posts
    1,879
    hi mr-b,

    Yes it is that easy.

    To summarize.

    1. Run ntpd once at boot.

    This assumes that there is a working network that can access a time server on the internet.

    This is how TinyCore/piCore/piCorePlayer works by default. This works fine 99% of the time.

    Possible issues:

    - time drifts of a couple of seconds a day
    - network problem prevents ntpd working
    - firewall blocks ntp
    - power failure happens and piCorePlayer boots faster than router
    - using local ntp server (fixed by setting ntpserver bootcode)

    2. Use cron to run ntpd.

    This is usually used when ntpd has worked ok during boot process but you are concerned about the time drift. So usually once a day, late a night, ntpd is run to sync time. cron could be run run more often if you wanted too. This won't fix a epoch time issue until the designated cron job time.

    Once we started using LMS on piCorePlayer accurate time setting became a little more important.

    Also, if you are using the clock display in Jivelite it would be nice if the time was accurate.

    3. Run ntpd as a daemon. That's what the "d" stands for.

    Most computer system would to this. Local ntpd program negotiates with time server to work out a suitable schedule to minimise load.


    Why doesn't piCorePlayer just use option 3 and be done with it?

    Feature creep and bloat!

    TinyCore/piCore uses option 1.

    TinyCore/piCore is supposed to be a minimal system. If we keep adding to it, it will eventually be like any other distribution.

    regards
    Greg

  10. #30
    Senior Member mr-b's Avatar
    Join Date
    Feb 2007
    Location
    UK
    Posts
    429
    Tx for the info - understand about keeping the distro small. The trouble is, once you start adding server-y type apps e.g. LMS, or a clock display on a system without a RTC, then they often need other server-y things to run reliably. A victim of it's own popularity! ;-)
    Not sure if it'd be possible to enable ntpd as a daemon with those features, so that it's only enabled when needed.

    But it seems though that ntpd isn't a resource hog.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •