(Semi) Auto Installer InstructionsΒΆ
Rather than have to run several dozen commands to install and configure NTP, run this script.
Note
This script is only semi-automatic since confirmation is necessary for some installations and configuration files changes. If the installation fails, either check the log or try running the installation manually by following Manual Installation Instructions. If this also fails, check Troubleshooting, Debugging, and More! for help.
See also
There is a video of the following process at https://youtu.be/Zn6aIcaM4XM
Create a directory and place it somewhere permanent since the files will be needed at each boot of the system. Copy ntpAuto.sh, the auto-installer, and ntpConfigBoot.sh, the script to run every boot, into that directory.
Open a terminal and run the following commands to start the script:
sudo -i cd <PATH TO THE AUTOSCRIPT FOLDER GOES HERE> chmod 777 ntpAuto.sh ./ntpAuto.sh
At this point, the script will run and begin installing the needed software. This may take some time, however it will prompt to allow certain packages to install, so stay close and check from time to time.
Once the installations are complete, the configuration process will begin. This will require a few configuration file changes. The first file will be
minnow-pps-gpio.c
. When this opens, scroll down slightly and change thePPS_GPIO
value to the proper GPIO pin number for the board. With the GPS lure this number is340
.Save and exit the file using [Ctrl] + [O], [ENTER], and [CTRL]+[X].
The next file to edit will be the modules. In this file, scroll to the bottom and add
pps-gpio
.Save and exit again. The PPS settings are complete.
The next file to open will be
ntp.conf
. In this file edit the lines at the bottom to match:server 127.127.20.0 mode 18 minpoll 4 maxpoll 4 iburst prefer fudge 127.127.20.0 flag1 1 flag2 0 flag3 0 time2 0.0 stratum 1 server 127.127.22.0 minpoll 1 maxpoll 1 #ATOM (PPS) fudge 127.127.22.0 refid PPS # enable PPS API
Save and exit
ntp.conf
. Next, theusr.sbin.ntpd
file will open. Scroll to the bottom and addcapability ipc_owner
if it is not already present, then save the file.Finally,
rc.local
will open. Scroll down to theexit
line and press Enter to make a new line above it. On this line enter<FILEPATH TO THE AUTOSCRIPT FOLDER>/ntpConfigBoot.sh
. For example, this might be/home/ubuntu/Desktop/Autoscript/ntpConfigBoot.sh
if the files were extracted to the desktop. This is the important file that needs to be kept. If this file is ever moved, update therc.local
file to match as this script autoconfigures the system on startup and is necessary to function.After a reboot, the clock should now be installed and begin honing in on the time. Run the ntp.sh script (located in the zip file) to automatically check every 15 seconds for the clock values.
Note
To broadcast this time to a local network, see Broadcasting the Time.