Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 

Repository files navigation

Microsecond-RPI-NTP

Clone of https://austinsnerdythings.com NTP Server with Corrections and Updates

1. Update rpi and install components

sudo apt update
sudo apt upgrade
sudo rpi-update
sudo apt install pps-tools gpsd gpsd-clients python3-gps chrony

2. add GPIO and module info where needed

sudo bash -c "echo '# the next 3 lines are for GPS PPS signals' >> /boot/firmware/config.txt"
sudo bash -c "echo 'dtoverlay=pps-gpio,gpiopin=18' >> /boot/firmware/config.txt"
sudo bash -c "echo 'enable_uart=1' >> /boot/firmware/config.txt"
sudo bash -c "echo 'init_uart_baud=9600' >> /boot/firmware/config.txt"

In /etc/modules, add ‘pps-gpio’ to a new line.
sudo bash -c "echo 'pps-gpio' >> /etc/modules"

Reboot
sudo reboot

3. Wire up the module:

Pin connections:

GPS PPS to RPi pin 12 (GPIO 18)
GPS VIN to RPi pin 2 or 4
GPS GND to RPi pin 6
GPS RX to RPi pin 8
GPS TX to RPi pin 10

3.1 Free Up the UART Serial Port for the GPS Device

Run raspi-config -> 3 – Interface options -> I6 – Serial Port -> Would you like a login shell to be available over serial -> No. -> Would you like the serial port hardware to be enabled -> Yes.

4. Verify PPS is Working

Check that PPS is installed
lsmod | grep pps

The output should look like:
pps_ldisc 16384 1
pps_gpio 16384 0

Check for PPS pulses with:
sudo ppstest /dev/pps0

This will give an output every second looking similar to:

trying PPS source "/dev/pps0"
found PPS source "/dev/pps0"
ok, found 1 source(s), now start fetching data...
source 0 - assert 1750210874.998541444, sequence: 10286 - clear 0.000000000, sequence: 0
source 0 - assert 1750210875.998542306, sequence: 10287 - clear 0.000000000, sequence: 0
source 0 - assert 1750210876.998542241, sequence: 10288 - clear 0.000000000, sequence: 0

5. Change GPSd to start on bootup:

Edit /etc/default/gpsd to the following with
sudo nano /etc/default/gpsd

The full file should look like the following after modifying:

# Default settings for the gpsd init script and the hotplug wrapper.
# Start the gpsd daemon automatically at boot time
START_DAEMON="true"
# Use USB hotplugging to add new USB devices automatically to the daemon
USBAUTO="true"
# Devices gpsd should collect to at boot time.
# They need to be read/writeable, either by user gpsd or the group dialout.
DEVICES="/dev/ttyS0 /dev/pps0"
# Other options you want to pass to gpsd
GPSD_OPTIONS="-n"

Use gpsmon command to verify information is being recieved from the GPS module.

\\Unfinished code.

About

Clone of https://austinsnerdythings.com NTP Server with Corrections and Updates

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors