chronometer
chronometer copied to clipboard
Raspberry Pi Internet Chronometer
Turn your RaspberryPi in to an Internet Chronometer.
Display is a UCTRONICS 3.5 Inch HDMI display.
Features:
- Utilizes system time via NTP. All you need to provide is an internet connection.
- Customizable world clock timezones
Description / Abbreviations
- TOP
- Completion chart for current time units ([S]econd, [M]inute, [H]our, [D]ay, [M]onth, [Y]ear, [C]entury).
- MIDDLE
- Left: World Clock
- Right:
- LD - Leap Drift - Current time offset that has to be corrected by the leap cycle
- SR - Sunrise Timer
- SS - Sunset Timer
- DD - Daytime Duration
- ND - Nighttime Duration
- BOTTOM
- Left: Time Systems
- UTC - Coordinated Universal Time
- MET - Metric Time
- SOL - Solar Time
- LST - Local Sidereal Time
- UNX - Unix Epoch Time
- SIT - Swatch Internet Time
- NET - New Earth Time
- HEX - Hexadecimal Time
- Binary Clock
- Right: Calendar Systems
- INTL - International Fixed Calendar
- WRLD - The World Calendar
- ANNO - Annus Novus Decimal Calendar
- JULN - Julian Date
- NTP Status (Server, Stratum, Delay, Offset)
- Left: Time Systems
Requirements
-
In order to get the HDMI display to work with this code, you need to set the resolution to 480x320 and set the console font to VGA 8x14. Run
sudo dpkg-reconfigure console-setup
to configure these settings. -
NTP daemon needs to be running as a background service:
sudo apt install ntp
-
Python3 (Should already be installed on RPi):
sudo apt install python3
-
pytz
module for python3:pip3 install pytz
or from your distros repositories.
Installation for Raspberry Pi
- Download the script to a folder of your choice.
curl -O https://raw.githubusercontent.com/rothman857/chronometer/master/chronometer.py
- Running chronometer.py for the first time will generate a .config file with default values*:
python3 <path/to/chronometer.py>
- Edit .config with current coordinates in decimal notation (West longitude is negative)
"coordinates": { "latitude": 40.7128, "longitude": -74.006 },
- Update time zones as desired. Timezones must be in pytz format. To see a list of available options, run the following in a python3 shell:
import pytz for tz in pytz.all_timezones: print(tz)
- If you wish to have the chronometer start at boot, add the following line to /etc/rc.local (before the
exit(0)
line):python3 /path/to/chronometer.py & ... exit(0)
Notes
- *Sunrise, sunset, daylight duration, and solar time were calculated from the Sunrise Equation, which uses the coordinates provided in .config. Using the default values for longitude and latitude may result in inaccurate calculations.