Dismiss Notice

Welcome To SNBForums

SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.

If you'd like to post a question, simply register and have at it!

While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!

NTP Daemon for ASUSWRT/Merlin

Discussion in 'Asuswrt-Merlin' started by kvic, Nov 6, 2015.

  1. GoNz0

    GoNz0 Very Senior Member

    Joined:
    Jul 14, 2013
    Messages:
    540
    Code:
    
    [email protected]:/tmp/home/root# ps ww|grep ntpd
     1106 GoNz0     4952 S    ntpd -c /opt/etc/ntp.conf -f /opt/var/spool/ntp/ntp.drift -s /opt/var/spool/ntp -k /opt/etc/ntp -l /opt/var/spool/ntp/ntp.log
     8230 GoNz0     1452 S    grep ntpd
    [email protected]:/tmp/home/root# ntpq -p
    No association ID's returned
    [email protected]:/tmp/home/root#
    
    The above showed the location but when I edited the other file with the same as the one residing in jffs it gave the No association ID's returned?
     
  2. GoNz0

    GoNz0 Very Senior Member

    Joined:
    Jul 14, 2013
    Messages:
    540
    So the file in JFFS isn't used, I deleted that.
    ntp.conf works fine with entries for stratum servers but as soon as I remove those and just have a GPS ip it is ignored. The ip does ping so i'm still stumped.
     
  3. JGrana

    JGrana Regular Contributor

    Joined:
    May 31, 2013
    Messages:
    150
    I tend to agree with sfx2000 in terms of adding a Raspberry Pi 3 as a fine network application platform. Over the years I have tried to use various Asus routers and Merlins fine firmware for various projects. Some worked great and some not as well...

    In terms of packet processing applications (like FreshJR's Adative QoS project or thelonecoders's AB-Solution) my AC88U along with Merlins FW work great. I also use rsync to copy photos from my main floor PC to a USB disk hanging off the router.

    But, when it comes to things like media servers or full capable NTP servers, adding an Rpi 3 hanging off the AC88u's ethernet switch makes a great network server co-processor.

    You get the benefit of much more contemporary kernels (Asus/Merlin - Linux kernel 2.6.36 versus Raspian/Debian 4.9.35), much more free memory (~ 500K versus 1GB) and a full local development environment environment. The Entware guys do a great job in providing install able packages for Merlins FW, but lets face, almost anything is available with Debian's package.

    I tried minidlna and ntpd on Asus. Too many photos caused minidlna to choke. As far as ntpd, lots of challenges getting my old Garmin GPS USB puck to work.
    On the Rpi 3, I have Plex fully running and have the stock ntpd along with gpsd (GPS deamon) that provides a Stratum 1 clock for all my other Pi's and computers. It is also now in the pool.ntp.org. (Why Startum 1? Ahh, err, well I had a Garmin GPS puck that did PPS output and wanted to try to get it to work. Got it working so thats why ;-)

    For the ~$50 for a Pi 3 ($35 for the Rpi, $15 for an SD card and USB power supply - you might even have these things laying around!) it makes a nice Network Co-Processor for the Asus router/Merlin FW.

    My $0.02
     
    sfx2000 likes this.
  4. cmkelley

    cmkelley Occasional Visitor

    Joined:
    Aug 11, 2015
    Messages:
    26
    Yeah, it's PL2303 - It started to dawn on me late last night that it's the converter that likely wasn't supported. I was going to ask Merlin, but now I don't have to. :)

    My other option is to just attach it to my NAS4Free (FreeBSD) fileserver, and use that box for my time server. That has a pretty complete FreeBSD system, so I suspect it would be supported just fine. If this gets to be much more of a PITA, I'll probably just do that.
     
  5. GoNz0

    GoNz0 Very Senior Member

    Joined:
    Jul 14, 2013
    Messages:
    540
    Just to add to my quest, installing ntpd on top of this daemon installs it to the wrong place so I decided to drop an updated copy of ntpd and ntpq over the originals and reboot, unfortunately gps is still not being picked up.

    Dunno what to try next.

    I did get rid of the refclock warning but introduced [refclock_open /dev/gps0: No such file or directory]
    Either way I do not think this path will fix it as it seems more to do with the GPS not being picked up by the daemon even though I can get output.
     
  6. Fitz Mutch

    Fitz Mutch Senior Member

    Joined:
    May 27, 2016
    Messages:
    328
    Location:
    Portsmouth
    I think you just need to link /dev/gps0 to /dev/ttyACM0.

    Just in case you're wondering about the strange IP address in ntp.conf, 127.127.20.0:
    • the "127.127" tells the NTP server to use a refclock, not an Internet time server
    • the "20" means driver#20, Generic NMEA GPS Receiver
    • the "0" means /dev/gps0, where you could have more than one of these

    It's all right here,
    http://doc.ntp.org/4.2.8/drivers/driver20.html
    http://support.ntp.org/bin/view/Support/ConfiguringNMEARefclocks
     
  7. sfx2000

    sfx2000 Part of the Furniture

    Joined:
    Aug 11, 2011
    Messages:
    11,401
    Location:
    San Diego, CA
    Exactly... and keeping things off the router is a good thing - if code breaks a Pi, no big deal, easy enough to recover from, and only services that were hosted on the Pi would be impacted..

    Code breaks on the router - that can be a pretty big deal - worst case, bricking the router, and at a minimum, it can cause an outage for the rest of the household while one is trying to fix things...

    If one wants to keep things all Asus - there's the TinkerBoard - bit more spendy than a Pi3, but it has more to offer...

    https://www.asus.com/us/Single-Board-Computer/Tinker-Board/
     
  8. GoNz0

    GoNz0 Very Senior Member

    Joined:
    Jul 14, 2013
    Messages:
    540
    Well I have had a read and despite my lack of knowledge outside of the windows OS I have had a tinker but as we have the same dongle your settings should work, maybe it is because of the version bundles with this threads version so I will see if I can get it working with your other thread to sync the clock, at least then I will know if it is this version of ntpd.
     
  9. GoNz0

    GoNz0 Very Senior Member

    Joined:
    Jul 14, 2013
    Messages:
    540
    I think I may have broken my GPS.
    The output was clean originally with the GPZDA data, last night I tried to reverse the script to test back on my laptop, even running the original script to enable GPZDA results in garbled text below. any ideas?

    It wouldn't let me save a backup, I think this was due to it using USB drivers on the PC instead of com port.

    bugger.
    Code:
    [email protected]:/tmp/home/root# cat /dev/ttyACM0
    $GPTXT,01,01,02,u-blox ag - www.u-blox.com*50
    
    $GPTXT,01,01,02,HW  UBX-G70xx   00070000 *77
    
    $GPTXT,01,01,02,ROM CORE 1.00 (59842) Jun 27 2012 17:43:52*59
    
    $GPTXT,01,01,02,PROTVER 14.00*1E
    
    $GPTXT,01,01,02,ANTSUPERV=AC SD PDoS SR*20
    
    $GPTXT,01,01,02,ANTSTATUS=OK*3B
    
    $GPTXT,01,01,02,LLC FFFFFFFF-FFFFFFFD-FFFFFFFF-FFFFFFFF-FFFFFFF9*53
    
    ▒6`x▒[$GPZDA,073926.00,25,07,2017,00,00*6B
    
    ▒6H|▒▒$GPZDA,073927.00,25,07,2017,00,00*6A
    
    $GPZDA,073928.00,25,07,2017,00,00*65
    
    ▒6▒A▒$GPZDA,073929.00,25,07,2017,00,00*64
    
    ▒6▒▒$GPZDA,073930.00,25,07,2017,00,00*6C
    
    ▒6▒▒Q$GPZDA,073931.00,25,07,2017,00,00*6D
    
    ▒6Џȹ$GPZDA,073932.00,25,07,2017,00,00*6E
    
    ▒6▒▒▒!$GPZDA,073933.00,25,07,2017,00,00*6F
    
    ▒▒
    [email protected]:/tmp/home/root#
    OK so the output via u-center shows it's ok and reloading as a com port allowed me to reset to default but I still get garbled text via the router.
     
    Last edited: Jul 25, 2017
  10. GoNz0

    GoNz0 Very Senior Member

    Joined:
    Jul 14, 2013
    Messages:
    540
    I know you say it is all there but I don't speak that language so I am still stuck on this
    Code:
    refclock_open /dev/gps0: No such file or directory[/quote]
    
    help :oops:
     
  11. Fitz Mutch

    Fitz Mutch Senior Member

    Joined:
    May 27, 2016
    Messages:
    328
    Location:
    Portsmouth
    This will create the link, if it doesn't exist. The "0" in /dev/gps0 corresponds to the "0" in 127.127.20.0, in your ntp.conf.
    Code:
    /sbin/modprobe cdc-acm
    [ -e /dev/gps0 ] || /bin/ln -s /dev/ttyACM0 /dev/gps0
    
     
    GoNz0 likes this.
  12. Fitz Mutch

    Fitz Mutch Senior Member

    Joined:
    May 27, 2016
    Messages:
    328
    Location:
    Portsmouth
    WTF?
    Access Denied
    You don't have permission to access "http://www.asus.com/us/Single-Board-Computer/Tinker-Board/" on this server.
    Reference #18.b902655f.1500986608.cb5a4ed


    Does the Asus Tinker Board have a battery-backed RTC?

    The Orange Pi Zero 512MB may be good enough for this job.
    https://www.banggood.com/Orange-Pi-...source-512MB-Development-Board-p-1110210.html
     
    Last edited: Jul 25, 2017
  13. GoNz0

    GoNz0 Very Senior Member

    Joined:
    Jul 14, 2013
    Messages:
    540
    Thanks, I put that into putty but it was back on a reboot, do I need to put it into a script file?
     
    Last edited: Jul 25, 2017
  14. GoNz0

    GoNz0 Very Senior Member

    Joined:
    Jul 14, 2013
    Messages:
    540
    Before I toss this in the bin, does anyone know why the ublox is now outputting garbage?
    even a factory default didn't work, the text looks ok in the text console of u-center, it did look ok via the router until last night when I tried to edit a setting with it installed as a sensor and not a com port and after that I get this :(

    Code:
    
    [email protected]:/tmp/home/root# cat /dev/ttyACM0
    ▒▒ ~▒▒3++
    M▒b`▒++
    `$$GPZDA,132155.00,25,07,2017,00,00*63
    
    ▒Jx▒
    ▒▒▒▒
       ▒▒
    x@
      ▒A
        ▒@
          ▒@
            ▒@
              (@
                ▒A
                  0@
                    ▒▒
    ▒A
      X@
        `@
          ▒A
            ▒@
             B
              ▒@
                ▒@
                  ▒@
                    ▒▒                                                             ▒
    ▒
    (▒
    8▒
    H▒
    X▒
    `A
      pA
        ▒A
          ▒
    ▒A
      ▒▒
    ▒▒
    jB▒k▒▒
    
    .@[̏▒ ▒
          ▒ ▒▒|
    u-blox ag - www.u-blox.com#<$GPTXT,01,01,02,u-blox ag - www.u-blox.com*50
    
    ▒bHW  UBX-G70xx   00070000 ▒;$GPTXT,01,01,02,HW  UBX-G70xx   00070000 *77
    
    ▒b*ROM CORE 1.00 (59842) Jun 27 2012 17:43:52H▒$GPTXT,01,01,02,ROM CORE 1.00 (59842) Jun 27 2012 17:43:52*59
    
    ▒b
    PROTVER 14.00X▒$GPTXT,01,01,02,PROTVER 14.00*1E
    
    ▒bANTSUPERV=AC SD PDoS SR▒▒$GPTXT,01,01,02,ANTSUPERV=AC SD PDoS SR*20
    
    ▒bZ     & ʮ▒Widl▒▒
     2▒fsn▒)▒b
    x4▒ݵb
    PuTTY
    
    
    D<8▒▒a▒▒▒▒      ▒"▒G▒▒▒▒▒▒▒▒▒▒▒▒U▒f[g▒QP5▒▒▒
    #L▒b`p/+
    L▒$GPZDA,132156.00,25,07,2017,00,00*60
    
    ▒Jx▒
    ▒▒▒▒
       ▒▒
    x@
      ▒A
        ▒@
          ▒@
            ▒@
              (@
                ▒A
                  0@
                    ▒▒
    ▒A
      X@
        `@
          ▒A
            ▒@
             B
              ▒@
                ▒@
                  ▒@
                    ▒▒                                                             ▒
    ▒
    (▒
    8▒
    H▒
    X▒
    `A
      pA
        ▒A
          ▒
    ▒A
      ▒▒
    ▒▒
    @▒
    ▒▒
           ▒
    .@[[email protected] ▒▒|
    PuTTY▒fsn▒b
    x▒
      ?<8▒b▒K▒M
    ▒"▒G▒▒▒▒▒▒▒▒▒▒▒▒▒f[[email protected]`X3+
    8▒$GPZDA,132157.00,25,07,2017,00,00*61
    
    ▒Jx▒
    ▒▒▒▒
       ▒▒
    x@
      ▒A
        ▒@
          ▒@
            ▒@
              (@
                ▒A
                  0@
                    ▒▒
    ▒A
      X@
        `@
          ▒A
            ▒@
             B
              ▒@
                ▒@
                  ▒@
                    ▒▒                                                             ▒
    ▒
    (▒
    8▒
    H▒
    X▒
    `A
      pA
        ▒A
          ▒
    ▒A
      ▒▒
    ▒▒
    _f▒▒6+
    ▒q
      }_▒E▒▒▒D ▒▒▒m?7+
    ▒▒▒▒▒ `v?7+
    [email protected]+
    $h$GPZDA,132158.00,25,07,2017,00,00*6E
    
    ▒Jx▒
    ▒▒▒▒
       ▒▒
    x@
      ▒A
        ▒@
          ▒@
            ▒@
              (@
                ▒A
                  0@
                    ▒▒
    ▒A
      X@
        `@
          ▒A
            ▒@
             B
              ▒@
                ▒@
                  ▒@
                    ▒▒                                                             ▒
    ▒
    (▒
    8▒
    H▒
    X▒
    `A
      pA
        ▒A
          ▒
    ▒A
      ▒▒
    ▒▒
    ▒d      & и▒`idl▒
    PuTTY
    ▒▒b`(;+
    ▒$GPZDA,132159.00,25,07,2017,00,00*6F
    
    ▒Jx▒
    ▒▒▒▒
       ▒▒
    x@
      ▒A
        ▒@
          ▒@
            ▒@
              (@
                ▒A
                  0@
                    ▒▒
    ▒A
      X@
        `@
          ▒A
            ▒@
             B
              ▒@
                ▒@
                  ▒@
                    ▒▒                                                             ▒
    ▒
    (▒
    8▒
    H▒
    X▒
    `A
      pA
        ▒A
          ▒
    ▒A
      ▒▒
    ▒▒
    Nh      & 66hcidl▒▒
    PuTTYem▒▒>+
    ;▒a▒ʉ
         ▒d▒BvJ(▒b`?+
    ▒@$GPZDA,132200.00,25,07,2017,00,00*60
    
    ▒Jx▒
    ▒▒▒▒
       ▒▒
    x@
      ▒A
        ▒@
          ▒@
            ▒@
              (@
                ▒A
                  0@
                    ▒▒
    ▒A
      X@
        `@
          ▒A
            ▒@
             B
              ▒@
                ▒@
                  ▒@
                    ▒▒                                                             ▒
    ▒
    (▒
    8▒
    H▒
    X▒
    `A
      pA
        ▒A
          ▒
    ▒A
      ▒▒
    ▒▒
    ▒▒ ▒R▒  @▒u▒
                @▒
    5
    ▒Wl
    ▒▒"▒▒▒o&▒ޠ      D▒▒?
    ▒▒.ܭ4▒▒▒<7▒▒▒惝▒
    Q▒▒▒d▒▒▒B+
    ▒!▒
       ▒U▒G▒6▒b`▒B+
    ▒Jx▒
    ▒▒▒▒
       ▒▒
    x@
      ▒A
        ▒@
          ▒@
            ▒@
              (@
                ▒A
                  0@
                    ▒▒
    ▒A
      X@
        `@
          ▒A
            ▒@
             B
              ▒@
                ▒@
                  ▒@
                    ▒▒                                                             ▒
    ▒
    (▒
    8▒
    H▒
    X▒
    `A
      pA
        ▒A
          ▒
    ▒A
      ▒▒
    ▒▒
    ▒▒▒t▒▒F+
    ▒▒_▒v▒
          TK▒H▒▒W▒b`▒F+
    ▒$GPZDA,132202.00,25,07,2017,00,00*62
    
    ▒Jx▒
    ▒▒▒▒
       ▒▒
    x@
      ▒A
        ▒@
          ▒@
            ▒@
              (@
                ▒A
                  0@
                    ▒▒
    ▒A
      X@
        `@
          ▒A
            ▒@
             B
              ▒@
                ▒@
                  ▒@
                    ▒▒                                                             ▒
    ▒
    (▒
    8▒
    H▒
    X▒
    `A
      pA
        ▒A
          ▒
    ▒A
      ▒▒
    ▒▒
    ▒▒6
       ▒▒ ▒▒|
    ▒fsn@'▒b
    xa
            x▒▒
    [email protected]~DB|-^P2BV<wT:^▒"9+
    
                            ▒▒E▒▒▒▒▒▒▒▒▒E▒d▒m▒b`▒J+
    ▒q$GPZDA,132203.00,25,07,2017,00,00*63
    
    ▒Jx▒
    ▒▒▒▒
       ▒▒
    x@
      ▒A
        ▒@
          ▒@
            ▒@
              (@
                ▒A
                  0@
                    ▒▒
    ▒A
      X@
        `@
          ▒A
            ▒@
             B
              ▒@
                ▒@
                  ▒@
                    ▒▒                                                             ▒
    ▒
    (▒
    8▒
    H▒
    X▒
    `A
      pA
        ▒A
          ▒
    ▒A
      ▒▒
    ▒▒
    ▒fsnu▒b
    
            x▒▒E}U5`DB▒-▒P2AV<Lf9X|#:,
    ▒▒z▒eN+
    Z2 ▒
        ▒L▒Z`▒▒b`▒N+
    ▒▒$GPZDA,132204.00,25,07,2017,00,00*64
    
    ▒Jx▒
    ▒▒▒▒
       ▒▒
    x@
      ▒A
        ▒@
          ▒@
            ▒@
              (@
                ▒A
                  0@
                    ▒▒
    ▒A
      X@
        `@
          ▒A
            ▒@
             B
              ▒@
                ▒@
                  ▒@
                    ▒▒                                                             ▒
    ▒
    (▒
    8▒
    H▒
    X▒
    `A
      pA
        ▒A
          ▒
    ▒A
      ▒▒
    ▒▒
    ▒▒Z
       @▒▒ ▒▒|
    PuTTYPuTTYPuTTYPuTTYPuTTY▒fsnL▒▒b
    x▒
    H▒R1,▒0▒▒▒7▒▒▒C
    ▒
    PuTTY▒▒ ~▒▒CR+
    +▒b`▒R+
    ▒I$GPZDA,132205.00,25,07,2017,00,00*65
    
    ▒Jx▒
    ▒▒▒▒
       ▒▒
    x@
      ▒A
        ▒@
          ▒@
            ▒@
              (@
                ▒A
                  0@
                    ▒▒
    ▒A
      X@
        `@
          ▒A
            ▒@
             B
              ▒@
                ▒@
                  ▒@
                    ▒▒                                                             ▒
    ▒
    (▒
    8▒
    H▒
    X▒
    `A
      pA
        ▒A
          ▒
    ▒A
      ▒▒
    ▒▒
    ▒fsn▒▒b
            x▒▒E}U=`DB▒-▒P2AV<Lf9X|"
    V▒▒▒!h▒▒N4V+
    [email protected]+
    ▒H▒▒ ▒▒V▒V+
    ▒p▒b`▒V+
    ▒▒$GPZDA,132206.00,25,07,2017,00,00*66
    
    ▒Jx▒
    ▒▒▒▒
       ▒▒
    x@
      ▒A
        ▒@
          ▒@
            ▒@
              (@
                ▒A
                  0@
                    ▒▒
    ▒A
      X@
        `@
          ▒A
            ▒@
             B
              ▒@
                ▒@
                  ▒@
                    ▒▒                                                             ▒
    ▒
    (▒
    8▒
    H▒
    X▒
    `A
      pA
        ▒A
          ▒
    ▒A
      ▒▒
    ▒▒
    
    ▒▒"▒
    [email protected]
    ▒       x▒▒
    ▒E}U=`DB▒-▒P2AV<Lf9
    ▒▒E▒▒▒▒▒▒▒▒▒E▒d▒▒b`hZ+
    o!$GPZDA,132207.00,25,07,2017,00,00*67
    
    ▒Jx▒
    ▒▒▒▒
       ▒▒
    x@
      ▒A
        ▒@
          ▒@
            ▒@
              (@
                ▒A
                  0@
                    ▒▒
    ▒A
      X@
        `@
          ▒A
            ▒@
             B
              ▒@
                ▒@
                  ▒@
                    ▒▒                                                             ▒
    ▒
    (▒
    8▒
    H▒
    X▒
    `A
      pA
        ▒A
          ▒
    ▒A
      ▒▒
    ▒▒
    ▒▒ ▒R▒▒ ▒R▒▒ ▒R▒▒▒R▒▒▒R
    
     
  15. sfx2000

    sfx2000 Part of the Furniture

    Joined:
    Aug 11, 2011
    Messages:
    11,401
    Location:
    San Diego, CA
    Not sure why the TinkerBoard link was bounced - bad cookie maybe?

    RTC can be added via GPIO's, just like RPi...

    The Orange Pi would be an alternative perhaps - it doesn't have the depth of community support that the RPi does, but depending on needs...
     
  16. GoNz0

    GoNz0 Very Senior Member

    Joined:
    Jul 14, 2013
    Messages:
    540
    Had to short the onboard battery to properly reset it, this has stopped the garbled text.
    I think it is a rom based chip as I cannot flash the new firmware either.
    Any progress is progress!

     
  17. Fitz Mutch

    Fitz Mutch Senior Member

    Joined:
    May 27, 2016
    Messages:
    328
    Location:
    Portsmouth
    Your USB GPS is the same as mine. No flash memory to "lock down" your custom settings. When left unplugged for 4 hours, it resets back to factory defaults. When I plug mine to u-center, it connects at 9600 baud.

    server 127.127.20.0 mode 24
    • "127.127" tells NTP to use a reference clock driver, as follows:
    • "20" is driver#20, Generic NMEA GPS Receiver
    • "0" is which GPS to use, /dev/gps0, you could have more than one
    • "24" is a bitmask for the serial port linespeed and NMEA type (9600 baud and $GPZDA, respectively)
    Unfortunately, I cannot test your scenario here because I'm doing something entirely different on my router for clock synchronization.
     
  18. GoNz0

    GoNz0 Very Senior Member

    Joined:
    Jul 14, 2013
    Messages:
    540
    Yes m8 I know, if I can get this updated version of ntpd working it may give me a valid GPS connection, I haven't given up yet (even got a 2nd on it's way)
     
  19. Fitz Mutch

    Fitz Mutch Senior Member

    Joined:
    May 27, 2016
    Messages:
    328
    Location:
    Portsmouth
    I'm using Tor without the cookies to anonymously browse the Asus products. The DS3231 RTC is USD 1.50 and the Orange Pi Zero could be gotten for USD10.
     
  20. GoNz0

    GoNz0 Very Senior Member

    Joined:
    Jul 14, 2013
    Messages:
    540
    Is anyone willing to compile NTPD with the necessary flags to allow the GPS to work?
    Things have changed since this thread was started, files are missing from the GPS instructions :(

    I spent a few hours messing about but got nowhere trying to compile the binaries... :confused:
     

Share This Page