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

    SG-2340/MBT-4220 GPS-Lure Stratum-1 NTP clock under pfSense?

    Scheduled Pinned Locked Moved Official Netgate® Hardware
    48 Posts 5 Posters 9.3k Views
    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.
    • rcfaR
      rcfa @stephenw10
      last edited by

      @stephenw10 Cool, thanks!
      That brings us quite a step forward. (BTW: is there documentation anywhere on all the settings in there? Many of them are obvious, others not, managed to enable some things that resulted in the NICs no longer being recognized by the system, so I reset to factory settings, and then just re-enabled the UARTs).

      Anyway, that done, I now get this, which means the GPS module is seen by the system:

      [2.5.0-DEVELOPMENT][admin@local]/root: cu -s 9600 -l cuau2
      Connected
      $GPGGA,010835.800,,,,,0,0,,,M,,M,,*4F
      $GPGSA,A,1,,,,,,,,,,,,,,,*1E
      $GPRMC,010835.800,V,,,,,0.00,0.00,060180,,,N*45
      $GPVTG,0.00,T,,M,0.00,N,0.00,K,N*32
      $GPGGA,010836.800,,,,,0,0,,,M,,M,,*4C
      $GPGSA,A,1,,,,,,,,,,,,,,,*1E
      $GPRMC,010836.800,V,,,,,0.00,0.00,060180,,,N*46
      $GPVTG,0.00,T,,M,0.00,N,0.00,K,N*32
      $GPGGA,010837.800,,,,,0,0,,,M,,M,,*4D
      $GPGSA,A,1,,,,,,,,,,,,,,,*1E
      $GPRMC,010837.800,V,,,,,0.00,0.00,060180,,,N*47
      $GPVTG,0.00,T,,M,0.00,N,0.00,K,N*32
      $GPGGA,010838.800,,,,,0,0,,,M,,M,,*42
      $GPGSA,A,1,,,,,,,,,,,,,,,*1E
      $GPGSV,1,1,00*79
      $GPRMC,010838.800,V,,,,,0.00,0.00,060180,,,N*48
      $GPVTG,0.00,T,,M,0.00,N,0.00,K,N*32
      $GPGGA,010839.800,,,,,0,0,,,M,,M,,*43
      $GPGSA,A,1,,,,,,,,,,,,,,,*1E
      

      So, since is obvious from this, that the GPS module can't get a fix, that's not yet being quite there...

      Figuring that the patch antenna on the module inside a metal case might not be ideal, I invested into an external GPS antenna. My iPhone gets a GPS lock where the unit is, so I'd figure with an external antenna, that should be good enough of a location. Maybe not. Maybe the system just takes much longer to get a fix, as it's not assisted by cell tower and WiFi information to acquire one.
      Hopefully in a few hours or so, it will acquire a satellite fix.

      No matter what, at least we now know we can access the device, and that's the biggest obstacle.

      1 Reply Last reply Reply Quote 1
      • stephenw10S
        stephenw10 Netgate Administrator
        last edited by

        There is this though it's a bit outdated: https://elinux.org/Minnowboard:MaxBios

        Yeah that looks like no satellites in view. And, yeah, it can take a while without agps. But that looks pretty promising otherwise. ☺

        Steve

        rcfaR 1 Reply Last reply Reply Quote 0
        • rcfaR
          rcfa @stephenw10
          last edited by

          @stephenw10 Just had an idea: is the external antenna detected automatically, or do the init commands enable it? If it's not automatic, and the integrated patch antenna is being used, inside of what's a metal case with a few vents, in a basement, I'd 100% be not surprised it can't get a satellite lock.

          On the other hand, if the switch-over is automatic, then I am surprised, because I'd expect an external antenna to have a better reception than what my iPhone gets, and that has no issue locking on to the GPS signal, basement and all.

          Wonder where I can find out, if the external antenna is recognized automatically...

          1 Reply Last reply Reply Quote 0
          • stephenw10S
            stephenw10 Netgate Administrator
            last edited by

            Hmm, good question. Can you move it somewhere with better reception for the patch antenna as a test?

            Steve

            rcfaR 1 Reply Last reply Reply Quote 0
            • rcfaR
              rcfa @stephenw10
              last edited by

              @stephenw10 Not really, because of where internet comes into the house. I could just try to run the box stand-alone for a while to test, both with and without the cover of the case, and with and without the external antenna (if for some reason it should be busted), but I'd have to do that when I don't need access to the internet for a period of time...

              1 Reply Last reply Reply Quote 0
              • stephenw10S
                stephenw10 Netgate Administrator
                last edited by

                Ok, looks like the external antenna is (or should be) used automatically. Does what you're using meet these specs?
                https://docs.netgate.com/platforms/minnowboard/lures/gps-lure/external-antenna-spec.html#recommended-external-antenna-specification

                Steve

                rcfaR 1 Reply Last reply Reply Quote 0
                • T
                  tman222 @johnpoz
                  last edited by

                  @johnpoz said in SG-2340/MBT-4220 GPS-Lure Stratum-1 NTP clock under pfSense?:

                  Yup you could go that route for sure... Or for like less than a $100 total and a few minutes time you could setup a pi with a hat and run that as stratum 1.. I have one on my home network, that serves to the pool and my local network for like couple of years now.

                  Hi @johnpoz - have been following this thread and your post about using a Pi as a Stratum 1 NTP server intrigued me. Did a bit of research, and I think this could be a fun little project. Do you mind sharing a bit more how you went about it? For instance, did you follow a guide like this?

                  https://www.ntpsec.org/white-papers/stratum-1-microserver-howto/

                  Also, which components did you end up using for the Pi, especially which GPS module (HAT) and did you choose, and did have modify the Pi's case to make room for the GPS module's SMA connector?

                  Thanks in advance.

                  1 Reply Last reply Reply Quote 0
                  • stephenw10S
                    stephenw10 Netgate Administrator
                    last edited by

                    It's no doubt a fun project but could you start a new thread for that in general discussion?

                    This is the Netgate hardware section.

                    Steve

                    rcfaR 1 Reply Last reply Reply Quote 0
                    • rcfaR
                      rcfa @stephenw10
                      last edited by

                      @stephenw10 I used these:

                      https://sixfab.com/product/sma-to-u-fl-rf-adapter-cable-150mm/

                      and

                      https://sixfab.com/product/external-active-gps-antenna-29db-sma-plug/

                      which by my reading should fit the spec, but it's well possible I missed something crucial.

                      1 Reply Last reply Reply Quote 0
                      • rcfaR
                        rcfa @stephenw10
                        last edited by

                        @stephenw10 said in SG-2340/MBT-4220 GPS-Lure Stratum-1 NTP clock under pfSense?:

                        It's no doubt a fun project but could you start a new thread for that in general discussion?

                        This is the Netgate hardware section.

                        I posted it here, since both the GPS lure and the SG-2340 nee MBT-4220 were sold and bought by Netgate. AFAIK, Netgate is the prime source of the GPS lure.
                        So I figured that would be the appropriate place, as I'm trying to get Netgate hardware running with Netgate software.

                        But if there's a better spot for this, by all means, move the thread there.

                        1 Reply Last reply Reply Quote 0
                        • stephenw10S
                          stephenw10 Netgate Administrator
                          last edited by

                          No, you're fine here. 😀

                          I meant discussion of a RasPi NTP server which would be neither Netgate or pfSense so more general discussion. Sorry I should have included an @tman222.

                          Steve

                          1 Reply Last reply Reply Quote 0
                          • stephenw10S
                            stephenw10 Netgate Administrator
                            last edited by

                            I don't see any actual specs on that antenna. Was it supplied with anything additional?

                            I would also expect it to work though....

                            rcfaR 1 Reply Last reply Reply Quote 0
                            • T
                              tman222
                              last edited by

                              Sure thing @stephenw10; apologies for going off-topic.

                              Here is the new thread:

                              https://forum.netgate.com/topic/143727/building-a-stratum-1-ntp-server-using-raspberry-pi

                              1 Reply Last reply Reply Quote 0
                              • rcfaR
                                rcfa @stephenw10
                                last edited by

                                @stephenw10 said in SG-2340/MBT-4220 GPS-Lure Stratum-1 NTP clock under pfSense?:

                                I don't see any actual specs on that antenna. Was it supplied with anything additional?

                                I would also expect it to work though....

                                Description lists this:

                                *Description
                                This GNSS (GPS, Galileo, Glonass) antenna has magnetic radome so it will stick to any steel structure like a roof of a car. It draws between 5-15mA and works in 2.2-5V DC range. You will need a sort of SMA to u.FL adapter cable to use it with u.FL modules/shields.

                                50-ohm impedance
                                3-meter cable length with standard SMA connector
                                Polarization: RHCP
                                Radome Material: ABS
                                LNA Gain: 29±1 dB
                                Noise Figure: 1.5dB
                                Gain(Zenith): 3dB
                                V.S.W.R: <1.5*

                                1 Reply Last reply Reply Quote 0
                                • rcfaR
                                  rcfa
                                  last edited by

                                  I'm thrilled to report, that it seems the GPS receiver finally has a lock, and I seem to get time just fine! :)

                                  NTP widget.png

                                  The settings used are:

                                  GPS Type: MediaTek
                                  Serial Port: cuau2
                                  Port speed: 9600 baud
                                  NMEA Sentences: All
                                  Fudge Time 1: <empty>
                                  Fudge Time 2: 0.400
                                  Stratum: <empty> i.e. 0
                                  Flags checked: Prefer this clock, Display extended GPS status
                                  Flags unchecked: all others, in particular the PPS
                                  Clock ID: <empty> i.e. GPS
                                  GPS Initialization:

                                  $PMTK225,0*2B
                                  $PMTK314,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0*28
                                  $PMTK301,2*2E
                                  $PMTK320,0*2F
                                  $PMTK330,0*2E
                                  $PMTK386,0*23
                                  $PMTK397,0*23
                                  $PMTK251,9600*17
                                  

                                  Auto correct malformed init commands: checked

                                  This is what got things working, after a LONG LONG wait. So at least it seems the external antenna is working and up to spec, if anyone else needs the same.

                                  So, having low expectations, that just made my day :D

                                  1 Reply Last reply Reply Quote 0
                                  • stephenw10S
                                    stephenw10 Netgate Administrator
                                    last edited by

                                    Nice. What sort of jitter, offset etc do you see without the PPS signal?

                                    Steve

                                    rcfaR 1 Reply Last reply Reply Quote 0
                                    • rcfaR
                                      rcfa @stephenw10
                                      last edited by

                                      @stephenw10 said in SG-2340/MBT-4220 GPS-Lure Stratum-1 NTP clock under pfSense?:

                                      Nice. What sort of jitter, offset etc do you see without the PPS signal?

                                      Reported jitter is itself jittery: have seen it as low as 6-ish and as high as 235-ish. So it's all over the place.

                                      So on the low side: fine, on the high side: not ideal.

                                      I wonder if raising the baud rate and reporting frequency would help. I think the module is capable of 5Hz or even 10Hz up reporting, with the proper settings and baudrate.

                                      That would require some further tweaking of the init commands.

                                      1 Reply Last reply Reply Quote 0
                                      • stephenw10S
                                        stephenw10 Netgate Administrator
                                        last edited by

                                        Mmm, yeah that's not great. With the PPS signal the jitter can be waay below 1ms. I think johnpoz was seeing ~10μs on his RasPi setup. Something must be done! 😀

                                        Steve

                                        1 Reply Last reply Reply Quote 0
                                        • rcfaR
                                          rcfa
                                          last edited by

                                          The idea to increase the update frequency may be foiled:
                                          for a higher update frequency (like 5 or 10Hz), it requires a correspondingly higher baud rate.
                                          The problem is, the firmware of the module specifies what default baud rate the module has, and I think these are programmed with 9600 baud.
                                          It is possible increase both update rate and baud rate with corresponding commands, the problem is, pfSense doesn't have a pre and post configuration baud rate.
                                          So if I indicate a higher baud rate in pfSense, then it won't be able to talk to the module to set the baud rate to the higher rate, and if I set 9600, and then tell the GPS module to go faster pfSense is stuck at the lower rate, as there's no "auto" setting.

                                          So either pfSense would need to have an auto-baud setting, so it could sync up at 9600, send over the new config, and then resync at 38400 or 115200, or one would need an init baud rate, and a post-init baud rate, to which it would switch once the init commands are sent.

                                          In any case: I can't get pfSync to use a higher rate successfully, because either I can't send the init commands, or pfSync won't sync after.

                                          That means I'm stuck at the 9600/1Hz situation, unless I'd somehow took the risk of attempting to flash different firmware settings, so the module would communicate at 38400 or 115200 out of the the gate.

                                          1 Reply Last reply Reply Quote 0
                                          • T
                                            tman222
                                            last edited by

                                            I know this thread is a bit dated, but a lot of good information here on using GPS with pfSense:

                                            https://forum.netgate.com/topic/51920/gps-receiver-ntp

                                            My original intention was just to try to a USB based GPS receiver since it's the cheapest approach, but upon seeing the warning in the documentation and reading that threat, it seems like a waste of time and money. PPS capability is also really important. Some more useful info:

                                            http://support.ntp.org/bin/view/Support/InexpensiveOemGps

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.