How to setup a Raspberry Pi as a GPS based NTP server in your Smarthome
TechBytes with Ron Nutter
Want to make sure that all the devices on your network are using the same time? Want to maintain the correct time regardless of whether your internet connection is up or down? Stay tuned and I will show you how to do this with a Raspberry Pi.
0:00 - Intro 0:55 - What we will be covering 1:28 - What is NTP 2:56 - Required items 3:54 - Creating boot SD card 4:31 - Booting RPI 5:10 - Applying RPI updates 7:02 - Wifi configuration 9:14 - GPS antenna configuration 10:30 - GPSC monitoring utility 11:36 - NTP configuration 12:08- GPSd reconfiguration 13:10 - Windows 10 ntp client test
sudo apt-get update sudo apt-get upgrade
Set rpi to my timezone sudo dpkg-reconfigure tzdata
! Install NTP sudo apt-get -y install ntp ___ ! Enable remote monitoring on RPI NTP cd /etc sudo cp ntp.conf ntp-original.conf sudo nano ntp.conf Put # in front of this line - restrict -4 default kod notrap nomodify nopeer noquery Save and exit nano ! Restart NTP sudo /etc/init.d/ntp restart ____ Sudo nano ntp.conf Delete individual server lines referencing individual ntp servers Use pool us.pool.ntp.org iburst to automatically stay in contact with external ntp servers
! Add support for gps antenna sudo apt-get install gpsd gpsd-clients python-gps
! See where GPS antenna is showing up sudo lsusb ! Compare this to output after GPS antenna is plugged in You may need to look at output from this - more /var/log/syslog to see what the device is named ! This command will get the connection started sudo gpsd /dev/ttyACM0 -n -F /var/run/gpsd.sock
! Check for data coming from GPS Antenna cgps -s
! Verify these changes to ntp.conf
/etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help
Drift file to remember clock rate across restarts
driftfile /var/lib/ntp/ntp.drift
Server from shared memory provided by gpsd
server 127.127.28.0 minpoll 4 maxpoll 4 prefer fudge 127.127.28.0 time1 0.000 refid SHM stratum 15 ! pool us.pool.ntp.org minpoll 10 iburst
! Get gpsd to auto start on bootup sudo dpkg-reconfigure gpsd
! ! Passing NTP server info in DHCP DHCP option 42 ! Cisco IOS Under ip dhcp pool config Option 42 ip x.x.x.x ! ! Info on windows dhcp NTP configuration https://social.technet.microsoft.com/wiki/contents/articles/50924.active-directory-time-synchronization.aspx
⏱️TIMESTAMPS⏱️ 0:00 - Intro
================================================ *** Show Notes, Links and Resources **** Here are the items mentioned in this video -
CanaKit Raspberry Pi 4 2GB Basic Starter Kit with Fan (2GB RAM) https://amzn.to/35QBB8I
VK-162 G-Mouse - Remote Mount USB - External GPS Navigation Dongle https://amzn.to/3dmF9Cz
Click on this link to get the SmartHome Account Creation Checklist
110230690 Bytes