A small project I made that uses Arduino with Python to monitor resource usage on my home server at a quick glance.
It can be used as a base for similar projects, to actively display data on a 16x2 LCD.
This project was made because I had an Arduino Uno kit lying around that I had no time to tinker with, so while setting my
home server up, I decided to use it as a way to monitor resource usage it.
At the moment, it's very basic, but it will be expanded and I will add buttons to allow for more features.
-
Arduino Sketch (
stats.ino)- Handles parsing and writing the data to the display.
-
Python Script (
stats.py)- Gathers data from the server and sends it to the Arduino via serial.
- Arduino IDE
- Compatible board (I have Uno with CH340)
-
Python 3.8+
-
Install dependencies:
pip install psutil pip install pyserial
- Open
stats.inoin the Arduino IDE. - Select your board and port.
- Upload the sketch.
- Nothing else, you're ready!
python3 stats.pyThis is what I wanted so I can keep receiving data after a restart or a power outage without having to restart the script again.
sudo nano /etc/systemd/system/hssd.service[Unit]
Description=Home Server Stats Display
After=multi-user.target
[Service]
ExecStart=/usr/bin/python3 /path/to/script/stats.py
WorkingDirectory=/path/to/script
Restart=always
User=root
[Install]
WantedBy=multi-user.targetsudo systemctl daemon-restart
sudo systemctl start hssd
sudo systemctl enable hssd- Add seeing per-process CPU and RAM usage (listing through them with a button)
- Add seeing per-disk storage usage and R/W stats (listing through them with a button)
- Add power draw information, CPU speed (per-core) and more.
- Add logging
