NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: NetBSD as an NTP stratum 1 server



Greg Troxel <gdt%lexort.com@localhost> writes:

> Brad Spencer <brad%anduin.eldar.org@localhost> writes:
>
>> No, there is no support for the /dev/ttyXX based IOCTLs that glue a PPS

>> signal to a TTY port [1].  If there is an output on your GPS device for
>> a pure GPIO style PPS signal, something that is either 5v or 3.3v in
>> nature and pulses once per second at a digital logic level, you can feed
>> that into a GPIO pin and use gpiopps(4) to utilize the pulse-per-second
>> that way [2].  I have been doing that with GPS modules for years with
>> NetBSD and run 2 GPS Stratum 1 NTP servers and 1 WWVB Stratum 1 NTP
>> server.
>
> There is actually support for PPS with USB devices that put the pps
> signal on one of the modem pins, and I'm using it.  I think that I added
> it a few years ago, and it was pretty easy.  However, there are two
> issues:
>
>   almost no USB GPS receivers bring PPS out on DCD.  I have a GR-601W or
>   some model number like that, with a ublox 6, that was a special run
>   that wired PPS to DCD inside.  If you have wired up a USB/serial chip
>   and a GPS chip, then you may have this too.  But if you just bought a
>   "gps mouse" or dongle, it is highly unlikely.
>
>   There is 1 ms of fuzz on timing.

Oh, very nice to hear that and I was unaware that support existed.  My
last test on this matter was with gpsd and it didn't seem to find the
defines needed to make that work and my quick look at the source was not
in the USB tty code so I missed seeing the support.

The use of DCD in this manor is like a GPIO pin, but as you say, the USB
fuzz may get in the way as the signal is transported via a USB packet.

>> As for stability and accuracy... using just the USB data alone will
>> yield very poor results, as has been mentioned.  That can, however, be
>> used for a quick test with the NEMA driver that ntpd has, just don't be
>> impressed by it.  By adding the digital PPS signal into the mix that
>> will deal with the USB problems and you will get a good result once the
>> device and ntpd stabilizes.  My modules present their NEMA output as
>> digital tty (uart) signals that I hook to a FTDI chip and into a USB
>> port... so the effect is very simular to what you are probably doing.  I
>> also use ntpd which can deal with both a /dev/ttyXX NEMA device and
>> /dev/gpioppsX PPS device at the same time.  In this arrangement, you
>> won't be using shared memory and your output would look something like
>> this:
>
> It is true that using USB PPS has 1 ms of fuzz.  However, people say
> "stratum 1" and make varying assumptions about what they care about.
>
> If the concern is to keep time sync when the Internet is down, 1 ms of
> fuzz is ok.  If you are trying to build something to distribute time to
> other people, and especially to be a public stratum 1, then it's not ok.
>

100% correct.  The use case drives how accurate and precise you need
this to be.

> (The advice about "use gpio" is good - I am just trying to clarify USB PPS.)

It has worked very well for me, assuming that the GPS module is stable.
I had one that would have a tendency to crash in its firmware after
being up for a while and totally lose its mind.





-- 
Brad Spencer - brad%anduin.eldar.org@localhost - KC8VKS - http://anduin.eldar.org


Home | Main Index | Thread Index | Old Index