Home of the Squeezebox™ & Transporter® network music players.
Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 30
  1. #11
    Senior Member Greg Erskine's Avatar
    Join Date
    Sep 2006
    Location
    Sydney, Australia
    Posts
    1,876
    I think you need to redirect the output to a file (if it generates any).

    Name the file something like pcp_blah_blah.log in /var/log and it will display in [Diagnostics] > [Logs] as "blah blah".

  2. #12
    Senior Member mr-b's Avatar
    Join Date
    Feb 2007
    Location
    UK
    Posts
    429
    I tried running the cmd sudo /usr/bin/getTime.sh but it outputs nothing. I searched for help on the ntpd cmd but I'm afraid I was lost rather.

    cat getTime.sh
    #!/bin/busybox ash
    # bmarkus - 26/02/2014

    NTPSERVER=$(cat /etc/sysconfig/ntpserver)
    /usr/sbin/ntpd -q -p $NTPSERVER

    Then I tried running ntpd with verbose option but still nothing.
    Stumped!

    tc@PCP-XLR:/usr/bin$ sudo /usr/sbin/ntpd -q -p -d 0.uk.pool.ntp.org
    tc@PCP-XLR:/usr/bin$

  3. #13
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    3,252
    Since we don't run a syslog, verbose only works when not daemonizing. Add the -n option to see what's up.

    Secondly, you telling ntpd to use "-d" as your server. Your server needs to follow the -p


    sudo /usr/sbin/ntpd -n -d -p 0.uk.pool.ntp.org
    piCorePlayer a small player for the Raspberry Pi in RAM.
    Homepage: https://www.picoreplayer.org

    Please donate if you like the piCorePlayer

  4. #14
    Senior Member mr-b's Avatar
    Join Date
    Feb 2007
    Location
    UK
    Posts
    429
    Tx - I don't understand the output though - other than the inconsistency of results doesn't look good.

    Code:
    tc@PCP-XLR-LMS:~$ cat /etc/sysconfig/ntpserver
    pool.ntp.org
    
    tc@PCP-XLR-LMS:~$ sudo /usr/sbin/ntpd -n -d -p pool.ntp.org
    ntpd: 'pool.ntp.org' is 213.199.225.30
    ntpd: sending query to 213.199.225.30
    ntpd: timed out waiting for 213.199.225.30, reach 0x00, next query in 2s
    ntpd: 'pool.ntp.org' is 213.199.225.30
    ntpd: sending query to 213.199.225.30
    ntpd: reply from 213.199.225.30: offset:-0.424035 delay:0.070126 status:0x24 strat:2 refid:0xe2e73250 rootdelay:0.000946 reach:0x01
    ntpd: sending query to 213.199.225.30
    ntpd: timed out waiting for 213.199.225.30, reach 0x02, next query in 1s
    ntpd: sending query to 213.199.225.30
    ntpd: timed out waiting for 213.199.225.30, reach 0x04, next query in 1s
    ntpd: sending query to 213.199.225.30
    ntpd: timed out waiting for 213.199.225.30, reach 0x08, next query in 33s
    ntpd: sending query to 213.199.225.30
    ntpd: reply from 213.199.225.30: offset:-0.432834 delay:0.054538 status:0x24 strat:2 refid:0xe2e73250 rootdelay:0.000946 reach:0x11
    ntpd: sending query to 213.199.225.30
    ntpd: reply from 213.199.225.30: offset:-0.437635 delay:0.046222 status:0x24 strat:2 refid:0xe2e73250 rootdelay:0.000946 reach:0x23
    ntpd: sending query to 213.199.225.30
    ntpd: reply from 213.199.225.30: offset:-0.388145 delay:0.048512 status:0x24 strat:2 refid:0xe2e73250 rootdelay:0.000946 reach:0x47
    ntpd: sending query to 213.199.225.30
    ntpd: timed out waiting for 213.199.225.30, reach 0x8e, next query in 32s
    ^C
    
    
    tc@PCP-XLR-LMS:~$ sudo /usr/sbin/ntpd -n -d -p pool.ntp.org
    ntpd: 'pool.ntp.org' is 162.159.200.123
    ntpd: sending query to 162.159.200.123
    ntpd: reply from 162.159.200.123: offset:-0.300064 delay:0.020605 status:0x24 strat:3 refid:0x1308150a rootdelay:0.009415 reach:0x01
    ntpd: sending query to 162.159.200.123
    ntpd: reply from 162.159.200.123: offset:-0.301307 delay:0.017879 status:0x24 strat:3 refid:0x1308150a rootdelay:0.009415 reach:0x03
    ntpd: sending query to 162.159.200.123
    ntpd: reply from 162.159.200.123: offset:-0.294214 delay:0.029378 status:0x24 strat:3 refid:0x1308150a rootdelay:0.009018 reach:0x07
    ntpd: sending query to 162.159.200.123
    ntpd: reply from 162.159.200.123: offset:-0.300830 delay:0.013769 status:0x24 strat:3 refid:0x1308150a rootdelay:0.009033 reach:0x0f
    ntpd: sending query to 162.159.200.123
    ntpd: reply from 162.159.200.123: offset:-0.296452 delay:0.019446 status:0x24 strat:3 refid:0x1308150a rootdelay:0.009415 reach:0x1f
    ntpd: sending query to 162.159.200.123
    ntpd: reply from 162.159.200.123: offset:-0.247953 delay:0.017223 status:0x24 strat:3 refid:0x1308150a rootdelay:0.009400 reach:0x3f
    ntpd: sending query to 162.159.200.123
    ntpd: reply from 162.159.200.123: offset:-0.200265 delay:0.012802 status:0x24 strat:3 refid:0x1308150a rootdelay:0.009003 reach:0x7f
    ntpd: sending query to 162.159.200.123
    ntpd: reply from 162.159.200.123: offset:-0.148144 delay:0.016637 status:0x24 strat:3 refid:0x1308150a rootdelay:0.009003 reach:0xff
    ^C
    
    
    I then tried the -q option to quit after clock is set, and it seems to complete successfully some of the time.
    
    
    tc@PCP-XLR-LMS:~$ sudo /usr/sbin/ntpd -n -q -d -p pool.ntp.org
    ntpd: 'pool.ntp.org' is 185.121.25.166
    ntpd: sending query to 185.121.25.166
    ntpd: reply from 185.121.25.166: offset:-0.423938 delay:0.010900 status:0x24 strat:2 refid:0x62d6c755 rootdelay:0.002914 reach:0x01
    ntpd: sending query to 185.121.25.166
    ntpd: reply from 185.121.25.166: offset:-0.423505 delay:0.010532 status:0x24 strat:2 refid:0x62d6c755 rootdelay:0.002914 reach:0x03
    
    tc@PCP-XLR-LMS:~$ sudo /usr/sbin/ntpd -n -q -d -p pool.ntp.org
    ntpd: 'pool.ntp.org' is 193.150.34.2
    ntpd: sending query to 193.150.34.2
    Alarm clock
    
    tc@PCP-XLR-LMS:~$ sudo /usr/sbin/ntpd -n -q -d -p pool.ntp.org
    ntpd: 'pool.ntp.org' is 193.150.34.2
    ntpd: sending query to 193.150.34.2
    ntpd: reply from 193.150.34.2: offset:-0.429285 delay:0.011036 status:0x24 strat:3 refid:0x82875c43 rootdelay:0.006012 reach:0x01
    ntpd: sending query to 193.150.34.2
    ntpd: reply from 193.150.34.2: offset:-0.429648 delay:0.010419 status:0x24 strat:3 refid:0x82875c43 rootdelay:0.006012 reach:0x03
    
    tc@PCP-XLR-LMS:~$ sudo /usr/sbin/ntpd -n -q -d -p pool.ntp.org
    ntpd: 'pool.ntp.org' is 193.150.34.2
    ntpd: sending query to 193.150.34.2
    Alarm clock
    
    tc@PCP-XLR-LMS:~$ sudo /usr/sbin/ntpd -n -q -d -p pool.ntp.org
    ntpd: 'pool.ntp.org' is 185.83.169.27
    ntpd: sending query to 185.83.169.27
    Alarm clock
    I'm mystified by the "alarm clock" responses!
    https://dev.archive.openwrt.org/ticket/14541.html seems to imply that it's some form of timeout but I don't understand it.

    Can anyone decode it?

  5. #15
    Senior Member
    Join Date
    Apr 2005
    Location
    UK/London
    Posts
    2,715
    Maybe you were unlucky and pool.ntp.org picked a temporarily unreachable server.
    In theory it should not matter much as eventually it will get one and the time should then remain roughly correct (RPi does drift time) so running it every few hours or days via cron should be enough to keep things within a second or so of the real time once it syncs.
    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. #16
    Senior Member mr-b's Avatar
    Join Date
    Feb 2007
    Location
    UK
    Posts
    429
    I've run a few more tests and NTP seems pretty spotty (I tried 0.uk.pool.ntp.org and it was even worse!) and it is send and pray (UDP), so I think this might explain why folks are having trouble with a one shot attempt at boot time.
    LMS particularly doesn't like time issues, so there could be a case for making periodic time sync standard.

  7. #17
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    3,252
    If you want it, then add it, there are provisions to do it. As Paul W mentioned once a day or two is plenty often enough. If you were really worried about it at boot, then you would add a RTC to the pi.
    piCorePlayer a small player for the Raspberry Pi in RAM.
    Homepage: https://www.picoreplayer.org

    Please donate if you like the piCorePlayer

  8. #18
    Senior Member mr-b's Avatar
    Join Date
    Feb 2007
    Location
    UK
    Posts
    429
    Yes I've added a cron job a while back, but only after installing 6.1.0 and some investigations on weird LMS behaviour (I thought it might be the 8.0 beta) that eventally led to time sync being the smoking gun, and then seeing others reporting it too - hence my suggestion for making it standard feature might fix those issues.

    But I *still* don't know how to see how well it's working in normal operation as I'm not up on the logging with the daemon issues.
    I guess I can just get my radio-controlled clock and put it next to the PCP! ;-)

  9. #19
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    3,252
    Quote Originally Posted by mr-b View Post
    Yes I've added a cron job a while back, but only after installing 6.1.0 and some investigations on weird LMS behaviour (I thought it might be the 8.0 beta) that eventally led to time sync being the smoking gun, and then seeing others reporting it too - hence my suggestion for making it standard feature might fix those issues.

    But I *still* don't know how to see how well it's working in normal operation as I'm not up on the logging with the daemon issues.
    I guess I can just get my radio-controlled clock and put it next to the PCP! ;-)
    Yes, LMS 8 moved to mandated https connections. https connections require a valid date, but a little time drift is not a problem. pCP has always set the time at boot, but is most reliable if you have a local ntp server.
    piCorePlayer a small player for the Raspberry Pi in RAM.
    Homepage: https://www.picoreplayer.org

    Please donate if you like the piCorePlayer

  10. #20
    Senior Member Greg Erskine's Avatar
    Join Date
    Sep 2006
    Location
    Sydney, Australia
    Posts
    1,876
    Quote Originally Posted by mr-b View Post
    Yes I've added a cron job a while back, but only after installing 6.1.0 and some investigations on weird LMS behaviour (I thought it might be the 8.0 beta) that eventally led to time sync being the smoking gun, and then seeing others reporting it too - hence my suggestion for making it standard feature might fix those issues.

    But I *still* don't know how to see how well it's working in normal operation as I'm not up on the logging with the daemon issues.
    I guess I can just get my radio-controlled clock and put it next to the PCP! ;-)
    hi mr-b,

    I think you should try running ntpd as a daemon rather than a scheduled job. Most computer systems do it this way so you don't notice what ntpd is doing. ntpd negotiates with the server to determine a suitable update timing for your system.

    TinyCore/piCore being minimal sytsem, run ntpd only once during the boot process, hence the reason why we do it this way. But this means your network must be working at that second it tries set the time. The same issue will be present if you just use cron. Using a daemon, ntpd will just work away in the background eventfully sorting things out. I can now understand why they do this on normal systems!

    It's interesting to find out what is "normal". I assume I have a very basic and relatively slow network/internet, yet ntpd sets the time 99.9% of the time. As I develop piCorePlayer on a Raspberry Pi syncing to git, I need to have timestamps set correctly so I would notice if the time isn't set.

    We will add some more ntpd settings to give people more options rather than use a solution that is not required by the majority of people.

    Thanks for spending the time to document your findings.

    EDIT: I should mention that I am assuming that the Busybox version ntpd works that same as the "normal" version. It probably is a pruned down version so there is probably some functionality missing. Keep that in mind when reading online documentation and doing experiments.

    regards
    Greg
    Last edited by Greg Erskine; 2020-07-08 at 14:37.

Posting Permissions

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