# Local GPS NTP Time Server

Accessible at: 192.168.1.12  
Project files stored here: “\\\\192.168.1.11\\zfs\_mirror3\\Projects\\Dormant\\NTP Raspberry Pi Server”

## Build Data

Runs Raspian on a Raspberry PI

Static IP Address was set in: /etc/dhcpcd.conf

[![image.png](https://wiki.galaxydump.com/uploads/images/gallery/2025-09/scaled-1680-/t3CNG2dvgpGka2lO-image.png)](https://wiki.galaxydump.com/uploads/images/gallery/2025-09/t3CNG2dvgpGka2lO-image.png)

Installed ntpstat with this:

```bash
sudo apt install ntpstat
```

## Usage

Here's some descriptions of the different tools for administrating NTP.

#### NTPSTAT

Use ntpstat to check if the NTP service is in sync:

```bash
ntpstat
```

It will return something like this:

```
synchronised to NTP server (149.20.54.20) at stratum 3 
   time correct to within 42 ms
   polling server every 1024 s
```

For our local NTP server (with GPS receiver), we see this:

```bash
pi@raspberrypi:~ $ ntpstat
synchronised to UHF radio at stratum 1
   time correct to within 2 ms
   polling server every 64 s
```

The ntpstat utility also returns an exit status, as a quick tell of synchronization.

Use this, following a call to ntpstat:

```
echo $?
```

The return value will mean one of these:

- If exit status 0 – Clock is synchronised.
- exit status 1 – Clock is not synchronised.
- exit status 2 – If clock state is indeterminant, for example if ntpd is not contactable.

#### NTPQ

Use ntpq -p to see the following:

[![image.png](https://wiki.galaxydump.com/uploads/images/gallery/2025-09/scaled-1680-/AgQlX6XhmF1rhxwg-image.png)](https://wiki.galaxydump.com/uploads/images/gallery/2025-09/AgQlX6XhmF1rhxwg-image.png)

#### PPTSTEST

Use this to test the pps signal:  
sudo ppstest /dev/pps0

The output should spit out a new line every second that looks something like this (your output will be a bit farther from x.000000 since it isn’t yet using the GPS PPS):

[![image.png](https://wiki.galaxydump.com/uploads/images/gallery/2025-09/scaled-1680-/wReLzudcfng5LRCc-image.png)](https://wiki.galaxydump.com/uploads/images/gallery/2025-09/wReLzudcfng5LRCc-image.png)

#### GPSMON

Use the gps monitor function to check the realtime availability of GPS and satelite count and position, with this:

```bash
gpsmon
```

This will present the following:

[![image.png](https://wiki.galaxydump.com/uploads/images/gallery/2025-09/scaled-1680-/VSVAiDmLXiPfdwjq-image.png)](https://wiki.galaxydump.com/uploads/images/gallery/2025-09/VSVAiDmLXiPfdwjq-image.png)

#### CGPS

Or, using the following for a simpler gps status check:

```bash
cgps
```

This will create the following output:

[![image.png](https://wiki.galaxydump.com/uploads/images/gallery/2025-09/scaled-1680-/gcG0wI1LloRyuDuP-image.png)](https://wiki.galaxydump.com/uploads/images/gallery/2025-09/gcG0wI1LloRyuDuP-image.png)

### References

How to troubleshoot an NTP server: [https://support.ntp.org/Support/TroubleshootingNTP](https://support.ntp.org/Support/TroubleshootingNTP)

The following link is probably not what was used to build the house time server. But, this is an interesting reference on how to build a Raspberry pi GPS time server:  
<span data-annotation-inline-node="true" data-annotation-mark="true" data-card-url="https://blog.thelifeofkenneth.com/2020/03/building-raspberry-pi-stratum-1-ntp.html" data-inline-card="true" data-renderer-start-pos="934" data-ssr-placeholder="0vDZ-:EfLS5:4y5Pz:qz-Pe:F4Zdx-0"><span class="loader-wrapper"><span data-testid="hover-card-trigger-wrapper">[<span class="_19itglyw _vchhusvi _r06hglyw _o5721jtm _1nmz9jpi _16d9qvcn _ca0qv77o _u5f31b66 _n3tdv77o _19bv1b66" data-testid="inline-card-icon-and-title"><span class="_19itglyw _vchhusvi _r06hglyw">Building a Raspberry Pi Stratum 1 NTP Server</span></span>](https://blog.thelifeofkenneth.com/2020/03/building-raspberry-pi-stratum-1-ntp.html)</span></span></span>

Here’s a good reference on how to tune and configure the NTP setup on a RaspBerry PI: <span data-annotation-inline-node="true" data-annotation-mark="true" data-card-url="http://www.satsignal.eu/ntp/Raspberry-Pi-NTP.html" data-inline-card="true" data-renderer-start-pos="1025" data-ssr-placeholder="0vDZ-:EfLS5:4y5Pz:qz-Pe:F4Zdx-1"><span class="loader-wrapper"><span data-testid="hover-card-trigger-wrapper">[<span class="_19itglyw _vchhusvi _r06hglyw _o5721jtm _1nmz9jpi _16d9qvcn _ca0qv77o _u5f31b66 _n3tdv77o _19bv1b66" data-testid="inline-card-icon-and-title"><span class="_19itglyw _vchhusvi _r06hglyw">Building a Raspberry-Pi Stratum-1 NTP Server</span></span>](http://www.satsignal.eu/ntp/Raspberry-Pi-NTP.html)</span></span></span>

Another reference: <span data-annotation-inline-node="true" data-annotation-mark="true" data-card-url="https://austinsnerdythings.com/2021/09/29/millisecond-accurate-chrony-ntp-with-a-usb-gps-for-12-usd/" data-inline-card="true" data-renderer-start-pos="1049" data-ssr-placeholder="0vDZ-:EfLS5:4y5Pz:qz-Pe:F4Zdx-2"><span class="loader-wrapper"><span data-testid="hover-card-trigger-wrapper">[<span class="_19itglyw _vchhusvi _r06hglyw _o5721jtm _1nmz9jpi _16d9qvcn _ca0qv77o _u5f31b66 _n3tdv77o _19bv1b66" data-testid="inline-card-icon-and-title"><span class="_19itglyw _vchhusvi _r06hglyw">Millisecond accurate Chrony NTP with a USB GPS for $12 USD - Austin's Nerdy Things</span></span>](https://austinsnerdythings.com/2021/09/29/millisecond-accurate-chrony-ntp-with-a-usb-gps-for-12-usd/)</span></span></span>

Good reference on the Shared Memory Driver, and how the 127.127.28.x address is used: <span data-annotation-inline-node="true" data-annotation-mark="true" data-card-url="http://doc.ntp.org/archives/drivers/driver28/" data-inline-card="true" data-renderer-start-pos="1140" data-ssr-placeholder="0vDZ-:EfLS5:4y5Pz:qz-Pe:F4Zdx-3">[http://doc.ntp.org/archives/drivers/driver28/](http://doc.ntp.org/archives/drivers/driver28/)</span>