This is a module for the MagicMirror² smart mirror project.
This module displays live system statistics from your Raspberry Pi including CPU usage, temperature, memory usage, disk space, and system uptime. Perfect for monitoring your Mirror's performance at a glance.
- Real-time CPU and GPU temperature monitoring
- CPU usage percentage with color-coded warnings
- RAM usage and free memory display
- Disk usage statistics
- System uptime
- Load average display
- Smooth animations and transitions
- Configurable update intervals
- Visual alerts for critical values
- Navigate to your MagicMirror's
modulesfolder:
cd ~/MagicMirror/modules/- Clone this repository:
git clone https://github.com/rxf-sys/MMM-RPiMonitor.git- Navigate to the module folder:
cd MMM-RPiMonitor- Install the dependencies:
npm installTo use this module, add the following configuration block to the modules array in the config/config.js file:
{
module: "MMM-RPiMonitor",
position: "top_right",
config: {
// See below for configurable options
}
}| Option | Description | Type | Default |
|---|---|---|---|
updateInterval |
How often to update the data (in milliseconds) | Integer | 5000 |
units |
Temperature units ("metric" for Celsius, "imperial" for Fahrenheit) |
String | "metric" |
showCPUTemp |
Show CPU temperature | Boolean | true |
showGPUTemp |
Show GPU temperature | Boolean | true |
showCPUUsage |
Show CPU usage percentage | Boolean | true |
showRAMUsage |
Show RAM usage | Boolean | true |
showDiskUsage |
Show disk usage | Boolean | true |
showUptime |
Show system uptime | Boolean | true |
showLoadAverage |
Show system load average | Boolean | true |
animationSpeed |
Speed of animations in milliseconds | Integer | 300 |
tempWarning |
Temperature warning threshold (°C) | Integer | 65 |
tempCritical |
Temperature critical threshold (°C) | Integer | 80 |
cpuWarning |
CPU usage warning threshold (%) | Integer | 80 |
cpuCritical |
CPU usage critical threshold (%) | Integer | 95 |
ramWarning |
RAM usage warning threshold (%) | Integer | 80 |
ramCritical |
RAM usage critical threshold (%) | Integer | 95 |
diskWarning |
Disk usage warning threshold (%) | Integer | 80 |
diskCritical |
Disk usage critical threshold (%) | Integer | 90 |
{
module: "MMM-RPiMonitor",
position: "top_right",
config: {
updateInterval: 10000, // Update every 10 seconds
units: "metric",
showGPUTemp: false, // Hide GPU temperature
tempWarning: 60,
tempCritical: 75,
animationSpeed: 500
}
}The module comes with default styling that integrates well with the MagicMirror interface. The following CSS classes are available for customization:
.rpi-monitor- Main container.module-header- Module header.rpi-section- Each data section.data-row- Individual data rows.data-value- Value displays.normal- Normal status (green).warning- Warning status (orange).critical- Critical status (red, pulsing)
Add to your custom.css file:
.MMM-RPiMonitor .module-header {
color: #ff6b6b;
font-size: 20px;
}
.MMM-RPiMonitor .rpi-section {
background: rgba(255, 255, 255, 0.05);
border: 1px solid rgba(255, 255, 255, 0.1);
}- CPU Temperature: Check if
/sys/class/thermal/thermal_zone0/tempexists and is readable - GPU Temperature: Ensure
vcgencmdis available (Raspberry Pi specific) - Disk Usage: Verify the module has permission to execute
dfcommand
The module reads from /proc/stat for accurate CPU measurements. If you experience issues:
- Increase the
updateIntervalto reduce polling frequency - Check system logs:
pm2 logs mm
Check the MagicMirror logs:
cd ~/MagicMirror
npm start dev- fs (built-in)
- os (built-in)
- child_process (built-in)
- GPU temperature only works on Raspberry Pi with
vcgencmdavailable - Some values may require elevated permissions on certain systems
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature - Commit your changes:
git commit -am 'Add some feature' - Push to the branch:
git push origin my-new-feature - Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- MagicMirror² community
- Icons from the standard emoji set
- Inspired by various system monitoring tools
Your Name
- GitHub: @rxf-sys
- Real-time system monitoring
- Temperature, CPU, RAM, and disk monitoring
- Configurable thresholds and warnings
- Smooth animations without flickering
