gnss - BYO-NTP/recipes GitHub Wiki
GNSS
GNSS Device Settings
- configure your GNSS receiver port for 115200 baud, 8-bits, no parity. Because ntp set the 8N1 precedent and 115200 because it's the 21st century.
- unless using an ancient server, ignore the warnings about ntp overflow
- gpsd:
- by default, gpsd will autoconfigure your GNSS and often breaks compatibility with NMEA drivers.
- use
--passive
to prevent gpsd from changing your GNSS settings, like switching off NMEA sentences or resetting the baud.
- configure the GNSS to only send necessary NMEA sentences (see below)
- if PPS is available, extra NMEA messages won't harm your timekeeping, so add in
GSV
because it's fun and interesting withcgps
.
- if PPS is available, extra NMEA messages won't harm your timekeeping, so add in
- for a u-blox that ends with T (🎉), perform a Time Survey In. Then you can get a time fix with only a single satellite.
- enable the constellations optimal for your part of the world.
- newer constellations are better than older (GLONASS) ones
- UTC is nearly always the correct answer.
- Check the antenna cable delays. My half dozen antenna all have ~3 meters of RG178 cable which is ~5 ns/m. The default antenna delay in my gen 6, 7, and 8 u-blox modules was 50ns, far too high.
- save your settings to the device!
- if your device won't save your settings, linux users can use gpsctl
u-blox settings
- GNSS
- GPS, BeiDou, Galileo
- ITFM
- Antenna Type: 2 - Active
- enable jamming/interference monitor
- NMEA Sentences (only)
- chrony / gpsd: RMC & ZDA
- ntp/NTPsec: ZDA
- NAV5
- Dynamic Model: 2 - Stationary
- PRT
- UART1 & USB
- Protocol In: UBX+NMEA
- Protocol Out: NMEA
- Baudrate: 115200, 8, 1, None
- UART1 & USB
- RATE
- Time Source: 0 - UTC time
- TMODE2
- Time Mode: 2 - Fixed Mode
- TP5
- Antenna Delay: ~5 ns/meter of cable
- TimePulse Alignment: UTC
ntp.org recommendation(s)
- Emit only GN___ (combined NMEA) sentences (vs GP___) NMEA
Accuracy
This site defines accuracy as the most inaccurate reading measured during a 12 hour measuring interval. In the following graph, the least accurate reading was 402 ns, so the accuracy I've assigned to the that build is .000000402.
References
- Measure the offset for your GNSS
- Phil Randal, A Raspberry Pi Stratum 1 NTP Server
- Advanced Ublox M8 tuning
- pinout.xyz, GPS boards
- U-BLOX GNSS Modules, Features, Options, Frequencies
- So Different Timing
PPS loss
This is how NTPsec handles the loss of PPS sync (GPS fix) from a u-blox 6M:
Not good! When faced with a weak module or weak radio signals, I've had better luck switching to NTPsec's gpsd
driver or Chrony (which also uses gpsd).
u-blox GNSS receivers
- The best for timing: ZED-F9T, F10T, LEA-M8F
- 6, 7, 8: GPS only
- M8: GPS, GLONASS, Beidou B1I, 72 channels, 2-3 simultaneous
- M9: GPS, GLONASS, Galileo, Beidou, 96 channels, 4 simultaneous
- M10: low-power M9
- F9, F10: dual frequency, 184 channels, active antenna only
LEA-M8T
When the M8T is first plugged in, the NMEA time is offset by a full second. Within a half hour of starting, that 1 second offset disappears.
7M
NOTE: It is highly recommended to choose a 8 series or higher chip. The 8 series are Multi-GNSS and can see and utilize a lot more satellites. They also have increased sensitivity and can maintain a fix much more reliably.
The 7M module doesn't store settings. After every power cycle, it needs its config fixed. On FreeBSD (with gpsd installed and correctly configured), this will do the needful:
service gpsd onestart
ubxtool -P 14.00 -e NMEA -d BINARY -s 9600 -S 115200 localhost:2947:/dev/gps0
service gpsd stop
Like the 6M, the 7M is somewhat sensitive to the antenna. Barely inserting most antennae and only engaging the first thread works reliably for me.
6M
This GPS chip is rather insenstive and cares more than usual about the external antenna. I have 6 active GPS antennas that all work well with the 8 series. The 6M regularly loses its fix when paired with every antenna except the $11 Bingfu.
- In my basement lab, where the 8th gen modules never lose their fix with a cheap 30 dB antenna
- the 6M struggles with a 28, 30, 38, and 40dB antenna. (see PPS loss) above.
- sees many fewer GPS satellites