Skip to content

grumpytechie/ntpclock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ntpclock

This project uses a Raspberry Pi show NTP diciplned time on 6 7-Segment LED displays

Bill of Materials

Setting up NTP

First, we need to set up NTP on the Raspberry Pi.

sudo apt-get install ntp

Then, if you want to, you can configure your own time servers in /etc/ntp.conf, but it will work just fine with the stock Debian NTP Pool servers. sudo nano /etc/ntp.conf

After changing the NTP conf, you need to restart the NTP deamon

sudo /etc/init.d/ntpd restart

Make sure your clock is running correctly by running the date command

date

Also remember to set your timezone

sudo dpkg-reconfigure tzdata

Copying the Repository

Setting the Python Code to Run at Startup

Crontab Method

Copy the 7seg_clock.py file to an appropriate directory on your Raspberry Pi, in my example I've created a new folder under /usr/local/ named ntpclock

Edit /etc/crontab

sudo nano /etc/crontab

Add the following line to the bottom

@reboot root /usr/local/ntpclock/7seg_clock.py &

rc.local Method - Deprecated since Debian Bookworm

Copy the ntpclock.sh file to an appropriate directory on your Raspberry Pi, in my example I've created a new folder under /usr/local/ named ntpclock

Edit /etc/rc.local

sudo nano /etc/rc.local

Add the following line to the bottom

/usr/local/ntpclock/ntpclock.sh &

Wiring Everything Up

Wiring Diagram

About

NTP clock using Raspberry Pi and 7-segment displays

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published