Skip to content

Rpi-5 System Information Dashboard is a lightweight Flask-based web app that displays real-time system metrics from a Raspberry Pi 5, including CPU temperature, RAM usage, and Uptime. It reads data directly from /proc and /sys for efficiency, with fallback commands when needed. The project includes both an interactive HTML dashboard and a JSON API

Notifications You must be signed in to change notification settings

OmiShrestha/rpi-stat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rpi-5 system information dashboard

This is a small project that shows a minimal dashboard for a Raspberry Pi (rpi-5) system information: CPU temperature, RAM usage, and Uptime.

It demonstrates simple file I/O (/proc and /sys), a subprocess fallback, and a tiny Flask web server.

Files

  • system-info.py - Flask app + functions to collect system info.
  • logger.py - System metrics logger for tracking historical data.
  • requirements.txt - Minimal dependency list.

Quick start

  1. (Optional) create and activate a virtual environment:
python -m venv venv
source venv/bin/activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Run the app:
python system-info.py
  1. Open a browser on the Pi or another machine on the same LAN to:

    http://:5000/

Notes and learning points

  • CPU temperature: tries /sys/class/thermal/thermal_zone0/temp first (millidegrees Celsius). Falls back to vcgencmd measure_temp if available.
  • RAM: reads /proc/meminfo and computes used/free in MB and percent.
  • Uptime: reads /proc/uptime and formats a simple human-readable string.
  • The app provides both an HTML dashboard and a JSON endpoint at /api/status for programmatic use.
  • Historical logging: The logger.py module automatically saves metrics to daily JSON files in the logs/ directory (up to 1000 recent entries per day).
  • History API: Access historical metrics via /api/history?hours=N (e.g., /api/history?hours=24 for last 24 hours).

Next steps you might try

  • Add graphs using Chart.js to visualize the historical data from /api/history.
  • Add authentication if exposing publicly.
  • Add unit tests for the parsing functions by mocking /proc/meminfo and /proc/uptime.
  • Implement automatic cleanup of old log files to prevent disk space issues.

About

Rpi-5 System Information Dashboard is a lightweight Flask-based web app that displays real-time system metrics from a Raspberry Pi 5, including CPU temperature, RAM usage, and Uptime. It reads data directly from /proc and /sys for efficiency, with fallback commands when needed. The project includes both an interactive HTML dashboard and a JSON API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages