A visual monitor for chrony time synchronization with automatic GPS PPS detection and NTP fallback support.
- Auto-detection: Automatically detects whether GPS PPS hardware is present
- Accuracy-based colors: Visual feedback based on sync quality, not just sync method
- Auto-recovery: Automatic PPS recovery when GPS sync is lost
- NTP-only mode: Clean visual feedback for stations without GPS hardware
| Color | Meaning | Condition |
|---|---|---|
| Green | Excellent sync | GPPS locked OR NTP offset < 1ms |
| Blue | Good NTP sync | NTP synced, offset < 50ms |
| Yellow | Degraded/Warning | Recovering, high offset, PPS issue |
| Red | Error | No sync, daemon down |
cd chrony_monitor
pip install -e .sudo ./scripts/install.shThis installs:
- Python package
- Systemd services for PPS initialization
- Udev rules for GPS/PPS devices
- Desktop launcher and autostart (launches on login)
# Auto-detect mode (GPS PPS or NTP)
python -m chrony_monitor
# Force NTP-only mode
python -m chrony_monitor --ntp-only
# Print current status and exit
python -m chrony_monitor --status--ntp-only Force NTP-only mode (ignore GPS/PPS hardware)
--no-recovery Disable automatic PPS recovery
--interval SECONDS Polling interval (default: 1.0)
--recovery-timeout Seconds before recovery attempt (default: 60)
--recovery-cooldown Seconds between recovery attempts (default: 300)
--status Print status and exit (no UI)
--help Show all options
The monitor automatically detects the expected mode:
- USB GPS detected (
/dev/ttyACM*or similar) → GPS PPS mode expected- PPS working → Green display
- PPS not working → Yellow "PPS ISSUE" warning with auto-recovery
- No USB GPS → NTP-only mode
- Blue display is normal operation
For GPS PPS to work, you need:
- USB GPS receiver connected (provides NMEA time data)
- PPS signal connected to a serial port's DCD pin (provides precise timing)
The serial-pps systemd service handles PPS initialization. It:
- Scans serial ports for PPS signal
- Creates
/dev/pps0device - Runs before chrony starts
Example /etc/chrony/chrony.conf for GPS PPS:
# GPS NMEA data from gpsd (USB GPS)
refclock SHM 0 delay 0.2 offset 0.0 poll 4 refid GPS trust
# PPS signal from serial port DCD pin
refclock PPS /dev/pps0 poll 4 refid GPPS lock GPS trust prefer
# Network fallback
pool ntp.ubuntu.com iburst maxsources 4
python -m chrony_monitor --status
chronyc sources -vls -la /dev/pps0
ppstest /dev/pps0systemctl status serial-pps
systemctl status gpsd
systemctl status chronyjournalctl -u serial-pps -u gpsd -u chrony -n 50- Python 3.8+
- chrony (for
chronyccommand) - For GPS PPS mode:
- util-linux (for
ldattach) - pps-tools (for
ppstest) - gpsd (optional, for NMEA time source)
- util-linux (for
MIT