rpi-rtc - Raspberry Pi RTC & WatchDog Management
Complete solution for managing DS3231 RTC and hardware WatchDog on Raspberry Pi.
Features
- Web Panel - Modern HTML/JS interface (FastAPI + WebSocket)
- REST API - Full REST API with real-time WebSocket updates
- CLI Commands - Direct commands for scripts and automation
- CLI Shell - Interactive command-line interface
- Python Package - Programmatic API (
piRTCpackage) - Docker Support - Containerized deployment
Quick Links
| Document | Description |
|---|---|
| README_RTC.md | RTC & WatchDog setup, CLI usage, testing |
| README_piRTC.md | Python package (piRTC) documentation |
Quick Start
Method 1: Automated Installer (Recommended)
cd /home/tom/github/maskservice/rpi-rtc
./install.sh
Method 2: Using Makefile
cd /home/tom/github/maskservice/rpi-rtc
make quick-start # Installs deps, creates venv, installs package
make shell # Run interactive shell
make server # Start API server
Method 3: Manual Installation
make deps # Install system dependencies
make bootstrap # Create venv and install deps
make install # Install the package
4. Use CLI Shell
ssh pi@192.168.188.229 'cd /opt/rpi-rtc && python3 rtc_shell.py'
5. Start Web Server
# Access: http://192.168.188.229:8080
ssh pi@192.168.188.229 'cd /opt/rpi-rtc && python3 -m piRTC.api'
6. Python API
from piRTC import RTCManager
rtc = RTCManager()
print(rtc.read_time()) # {'hour': 16, 'minute': 42, 'second': 0}
Available Commands (Makefile)
Run make help to see all available commands:
| Command | Description |
|---|---|
make quick-start |
Full installation with all dependencies |
make shell |
Run interactive piRTC shell |
make server |
Start API server |
make rtc-shell |
Run original RTC shell |
make test |
Run tests |
make info |
Show project information |
make doctor |
Run diagnostics |
Hardware Wiring
DS3231 RTC
VDD -> 3.3V (Pin 1) SCL -> SCL (Pin 5)
GND -> GND (Pin 6) SDA -> SDA (Pin 3)
WatchDog
VDD -> 3.3V (Pin 1) SCL -> SCL (Pin 5)
GND -> GND (Pin 6) SDA -> SDA (Pin 3)
FEED -> GPIO 4 (Pin 7)
Testing Status
✅ RTC maintains time after restart
✅ System time sync working
✅ I2C: 0x68 (RTC), 0x67 (WatchDog)
✅ Temperature: 26-29°C
✅ Web API on port 8080
Last Test: March 15, 2026, 17:08 GMT
RPi IP: 192.168.188.229
License
Apache License 2.0 - see LICENSE for details.
Author
Created by Tom Sapletta - tom@sapletta.com
Metadata
Release files for piRTC 1.0.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pirtc-1.0.6.tar.gz | 17.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pirtc-1.0.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 34.5 kB
Release files / pirtc-1.0.6.tar.gz
| Download URL | pirtc-1.0.6.tar.gz |
|---|---|
| Size | 17.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1df7c20ba11755909d10b26bf85ea5c2927e07ca69995f6a6a3566dcfe3a067b
|
|
BLAKE2b-256 checksum How to use checksums |
9d26864d8a64e594e1235d01f4340955a7a781dbcafedc66130a593148ec8bbc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Release files / pirtc-1.0.6-py3-none-any.whl
| Download URL | pirtc-1.0.6-py3-none-any.whl |
|---|---|
| Size | 17.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
824b03390366b633c73f126f85ab3385f0c6e079497f6a2c1add2aae3a782f09
|
|
BLAKE2b-256 checksum How to use checksums |
8ef477c77a742dcd053fb50b5976e37870f433ca462ae7f0a863e40c42e3b171
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|