• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login
Netgate Discussion Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login

Building a Stratum 1 NTP Server Using Odroid C2

Scheduled Pinned Locked Moved Off-Topic & Non-Support Discussion
45 Posts 4 Posters 9.5k Views 3 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    bingo600 @jcpingu
    last edited by bingo600 Jun 21, 2021, 9:00 PM Jun 21, 2021, 8:58 PM

    @jcpingu
    The interesting NMEA packets are the : $GNRMC packets.

    I see you skipped the "NMEA" filter the guide uses (to only see the RMC's) , was that because you don't use an Ublox 8 ?

    Edit:
    From the guide:
    Uses the NMEA reference clock 20 driver specified by 127.127.20.0.
    Mode 17 sets the driver to process only GPRMC message at 9600bps. Using higher clock speeds does not necessarily increase timing precision and because we have disabled non-GPRMC messages, there’s no risk of not being able to transmit the message within the 1 second timespan.

    Did i see you use 115200 ???

    /Bingo

    If you find my answer useful - Please give the post a πŸ‘ - "thumbs up"

    pfSense+ 23.05.1 (ZFS)

    QOTOM-Q355G4 Quad Lan.
    CPU  : Core i5 5250U, Ram : 8GB Kingston DDR3LV 1600
    LAN  : 4 x Intel 211, Disk  : 240G SAMSUNG MZ7L3240HCHQ SSD

    J 3 Replies Last reply Jun 21, 2021, 9:06 PM Reply Quote 0
    • J Offline
      jcpingu @bingo600
      last edited by Jun 21, 2021, 9:06 PM

      @bingo600
      I have a newer revision of the GPS Board. Its default baud is 115200

      1 Reply Last reply Reply Quote 0
      • J Offline
        jcpingu @bingo600
        last edited by Jun 21, 2021, 9:11 PM

        @bingo600
        I will check $GNRMC. It looks like I am not getting them...

        1 Reply Last reply Reply Quote 0
        • J Offline
          jcpingu @bingo600
          last edited by Jun 21, 2021, 9:23 PM

          @bingo600
          Here you go:
          95285b07-d93b-4144-a19c-448d783c8259-image.png

          1 Reply Last reply Reply Quote 0
          • S Offline
            stephenw10 Netgate Administrator
            last edited by stephenw10 Jun 21, 2021, 9:57 PM Jun 21, 2021, 9:51 PM

            Does ppstest work against gpspps0? If not did you create the symlink?

            What does your ntp.conf file look like? Did you change the mode for 115200 baud?

            Edit: Yeah you probably want mode 81 there.

            Steve

            J 2 Replies Last reply Jun 21, 2021, 10:15 PM Reply Quote 0
            • J Offline
              jcpingu @stephenw10
              last edited by Jun 21, 2021, 10:15 PM

              @stephenw10
              Yes per the guide Symlink is used, there's a file that use the below:
              KERNEL=="ttyS1", SYMLINK+="gps0"
              KERNEL=="pps0", SYMLINK+="gpspps0"

              Also, how do I edit ntp.conf? When I enter it, I get permission denied
              79f235ba-6626-432e-acc8-b2f19fe3c546-image.png

              1 Reply Last reply Reply Quote 0
              • J Offline
                jcpingu @stephenw10
                last edited by jcpingu Jun 21, 2021, 10:23 PM Jun 21, 2021, 10:22 PM

                @stephenw10
                Here is the ntp.conf content in the guide. Are you saying to change mode 17 to 81?

                server 127.127.20.0 mode 17 minpoll 4 maxpoll 4 prefer
                fudge 127.127.20.0 flag1 1 refid GPS

                security

                restrict default kod limited nomodify nopeer
                restrict -6 default kod limited nomodify nopeer

                Local users may interrogate the NTP server fully.

                restrict 127.0.0.1
                restrict -6 ::1

                stats

                driftfile /var/lib/ntp/ntp.drift

                Enable statistics logging.

                statsdir /var/log/ntpstats/
                statistics loopstats peerstats clockstats
                filegen loopstats file loopstats type day enable
                filegen peerstats file peerstats type day enable
                filegen clockstats file clockstats type day enable

                leap file

                leapfile /var/lib/ntp/leap-seconds.list

                1 Reply Last reply Reply Quote 0
                • S Offline
                  stephenw10 Netgate Administrator
                  last edited by Jun 21, 2021, 11:22 PM

                  Yes because, like it says there, mode 17 is for 9600 baud and your GPS is running at 115200. So currently it's seeing no data.

                  J 3 Replies Last reply Jun 22, 2021, 1:48 AM Reply Quote 1
                  • J Offline
                    jcpingu @stephenw10
                    last edited by Jun 22, 2021, 1:48 AM

                    @stephenw10
                    Thank you. I will advise latest status...

                    1 Reply Last reply Reply Quote 0
                    • J Offline
                      jcpingu @stephenw10
                      last edited by Jun 22, 2021, 2:09 AM

                      @stephenw10
                      The good News:
                      b022b744-34df-44b1-b57b-6840e82c4dca-image.png

                      The not so good news, I am still seeing clock unsynchronized:
                      6f2be03c-eca7-445a-811f-dfa31af4a896-image.png

                      1 Reply Last reply Reply Quote 0
                      • J Offline
                        jcpingu @stephenw10
                        last edited by Jun 22, 2021, 2:55 AM

                        @stephenw10
                        I was looking @ your example, and I see that it also shows this error:
                        Jun 21 18:35:03 ntpd 56634 kernel reports TIME_ERROR: 0x41: Clock Unsynchronized

                        1 Reply Last reply Reply Quote 0
                        • S Offline
                          stephenw10 Netgate Administrator
                          last edited by Jun 22, 2021, 10:49 AM

                          Yes, I expect it to show that when ntpd is first started. It won't sync until sometime later when ntp is confident the time data it has is correct.
                          Wait some time and recheck. Or it may have already sync'd there since it show an offset or effectively 0 (2ΞΌs) from the GPS time.

                          Steve

                          J 2 Replies Last reply Jun 22, 2021, 3:57 PM Reply Quote 1
                          • J Offline
                            jcpingu @stephenw10
                            last edited by Jun 22, 2021, 3:57 PM

                            @stephenw10
                            Thank you for all your help. I truly appreciate your patience and kindness. I still see the error this morning. However ntpq -p is showing the right output. I am assuming there's nothing I can do about the error...
                            f64cc788-75d7-4e80-b6de-1709d5f94363-image.png

                            B 2 Replies Last reply Jun 22, 2021, 4:46 PM Reply Quote 0
                            • B Offline
                              bingo600 @jcpingu
                              last edited by Jun 22, 2021, 4:46 PM

                              @jcpingu

                              Have a look here
                              https://serverfault.com/questions/1048870/ntpd-fails-to-sync-time-error-0x41-clock-unsynchronized

                              Especially this command : ntpq -c sysinfo

                              Normally as @stephenw10 mentioned , ntpd won't just accept a new clocksource , before investigating if it's "ok".

                              I usually expect approx 5 minutes (after daemon start) for the daemon to "trust/select" a clocksource.

                              If you find my answer useful - Please give the post a πŸ‘ - "thumbs up"

                              pfSense+ 23.05.1 (ZFS)

                              QOTOM-Q355G4 Quad Lan.
                              CPU  : Core i5 5250U, Ram : 8GB Kingston DDR3LV 1600
                              LAN  : 4 x Intel 211, Disk  : 240G SAMSUNG MZ7L3240HCHQ SSD

                              J 1 Reply Last reply Jun 22, 2021, 4:53 PM Reply Quote 1
                              • J Offline
                                jcpingu @bingo600
                                last edited by Jun 22, 2021, 4:53 PM

                                @bingo600
                                Here's the output of that command. I will check out the link. Thanks...
                                ff838b1f-9a99-4f6b-a70c-f2fe599803ff-image.png

                                1 Reply Last reply Reply Quote 0
                                • J Offline
                                  jcpingu @stephenw10
                                  last edited by Jun 22, 2021, 5:11 PM

                                  @stephenw10
                                  This is my ntp.conf file. Based on bingo600 comments above. Is there anything else that needs to happen here?

                                  server 127.127.20.0 mode 81 minpoll 4 maxpoll 4 prefer
                                  fudge 127.127.20.0 flag1 1 refid GPS

                                  security

                                  restrict default kod limited nomodify nopeer
                                  restrict -6 default kod limited nomodify nopeer

                                  Local users may interrogate the NTP server fully.

                                  restrict 127.0.0.1
                                  restrict -6 ::1

                                  stats

                                  driftfile /var/lib/ntp/ntp.drift

                                  Enable statistics logging.

                                  statsdir /var/log/ntpstats/
                                  statistics loopstats peerstats clockstats
                                  filegen loopstats file loopstats type day enable
                                  filegen peerstats file peerstats type day enable
                                  filegen clockstats file clockstats type day enable

                                  leap file

                                  leapfile /var/lib/ntp/leap-seconds.list

                                  1 Reply Last reply Reply Quote 0
                                  • S Offline
                                    stephenw10 Netgate Administrator
                                    last edited by Jun 22, 2021, 5:28 PM

                                    No, I think it's working as expected.
                                    That error will always appear when you restart ntpd for any reason. I would only vbe concerned if it is still logging new errors after running for some time.

                                    Steve

                                    1 Reply Last reply Reply Quote 1
                                    • B Offline
                                      bingo600 @jcpingu
                                      last edited by bingo600 Jun 22, 2021, 7:05 PM Jun 22, 2021, 6:02 PM

                                      @jcpingu

                                      Try to put in a few ntp pool servers for reference.

                                      Add this to your ntp.conf

                                      # Internet time servers for sanity
                                      server 0.pool.ntp.org iburst prefer 
                                      server 1.pool.ntp.org iburst 
                                      server 2.pool.ntp.org iburst 
                                      server 3.pool.ntp.org iburst
                                      

                                      From here:
                                      http://doc.ntp.org/4.2.6/drivers/driver20.html

                                      It seems like the $GNRMC is not a supported sentence , and that either
                                      $GPZDA or $GPZDG must be sent for the NTP system to be fully autonomous. As in being able to set date/time fully via NTP.

                                      What GPS model do you have ?
                                      Is it from "China" ... Where most Ublox'es are "fakes"

                                      This is not an "all bad" mesage , as the PPS still will keep your clock extremely accurate (sub seconds) . You just need a bit of help setting the seconds.

                                      But it's strange that the nmea driver is so picky.
                                      Maybe gpsd would help here

                                      /Bingo

                                      If you find my answer useful - Please give the post a πŸ‘ - "thumbs up"

                                      pfSense+ 23.05.1 (ZFS)

                                      QOTOM-Q355G4 Quad Lan.
                                      CPU  : Core i5 5250U, Ram : 8GB Kingston DDR3LV 1600
                                      LAN  : 4 x Intel 211, Disk  : 240G SAMSUNG MZ7L3240HCHQ SSD

                                      B J 2 Replies Last reply Jun 22, 2021, 6:43 PM Reply Quote 0
                                      • B Offline
                                        bingo600 @bingo600
                                        last edited by bingo600 Jun 22, 2021, 7:03 PM Jun 22, 2021, 6:43 PM

                                        @bingo600

                                        The NTP nmea refdriver doc is "buggy"

                                        I just had a quick glance at the source
                                        https://github.com/ntp-project/ntp/blob/master-no-authorname/ntpd/refclock_nmea.c

                                        08de05e8-b0c3-4db4-9d95-939ec3e666a3-image.png

                                        And it's comparing the last 3 (4) characters in the sentence so any RMC works

                                        And it seems like it's parsing/setting the date from RMC sentenses too.
                                        The only thing ZDA is providing "extra" is YYYY vs YY from RMC.

                                        c398f0a9-851a-409d-903c-f38f9d323831-image.png

                                        It should be possible to make a working NTP system with just RMC sentences , if NTP has been updated to assume that YY (21) means 2021.
                                        Which i expect the unfold_century function does.

                                        /Bingo

                                        If you find my answer useful - Please give the post a πŸ‘ - "thumbs up"

                                        pfSense+ 23.05.1 (ZFS)

                                        QOTOM-Q355G4 Quad Lan.
                                        CPU  : Core i5 5250U, Ram : 8GB Kingston DDR3LV 1600
                                        LAN  : 4 x Intel 211, Disk  : 240G SAMSUNG MZ7L3240HCHQ SSD

                                        1 Reply Last reply Reply Quote 0
                                        • J Offline
                                          jcpingu @bingo600
                                          last edited by Jun 22, 2021, 7:16 PM

                                          @bingo600 said in Building a Stratum 1 NTP Server Using Odroid C2:

                                          ntp pool servers

                                          Does it matter where the ntp pool servers are inserted in the ntp.conf file?

                                          B 1 Reply Last reply Jun 22, 2021, 7:22 PM Reply Quote 0
                                          38 out of 45
                                          • First post
                                            38/45
                                            Last post
                                          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                                            This community forum collects and processes your personal information.
                                            consent.not_received