Skip to main content

Raspberry Pi RTC & WatchDog Management Package

Project description

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 (piRTC package)
  • 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pirtc-1.0.6.tar.gz (17.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pirtc-1.0.6-py3-none-any.whl (17.4 kB view details)

Uploaded Python 3

File details

Details for the file pirtc-1.0.6.tar.gz.

File metadata

  • Download URL: pirtc-1.0.6.tar.gz
  • Upload date:
  • Size: 17.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for pirtc-1.0.6.tar.gz
Algorithm Hash digest
SHA256 1df7c20ba11755909d10b26bf85ea5c2927e07ca69995f6a6a3566dcfe3a067b
MD5 bcccd074708a26264fa3014870c15c7a
BLAKE2b-256 9d26864d8a64e594e1235d01f4340955a7a781dbcafedc66130a593148ec8bbc

See more details on using hashes here.

File details

Details for the file pirtc-1.0.6-py3-none-any.whl.

File metadata

  • Download URL: pirtc-1.0.6-py3-none-any.whl
  • Upload date:
  • Size: 17.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for pirtc-1.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 824b03390366b633c73f126f85ab3385f0c6e079497f6a2c1add2aae3a782f09
MD5 22b4009c10bb3549353d0ed5f4e9dfa7
BLAKE2b-256 8ef477c77a742dcd053fb50b5976e37870f433ca462ae7f0a863e40c42e3b171

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page