- Python 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
Co-authored-by: Keith Carichner Jr <keith@saintsofvirtue.org> Reviewed-on: #5 |
||
| functions | ||
| systemd-configs | ||
| tests | ||
| .gitignore | ||
| divoom_pc_monitor.py | ||
| divoom_setup.py | ||
| README.md | ||
| requirements.txt | ||
Divoom PC Monitor Python - Implementation for Linux Systems
This repository contains the Python code that interfaces with the Divoom PC Monitor application on the Divoom Times Gate or Divoom Pixoo64 to monitor system information for Linux systems.
Overview
This project is a Python implementation of the Divoom PC Monitor originally written in C# by DivoomDevelop. It allows users to monitor various system metrics and display them on their Divoom Times Gate or Divoom Pixoo64.
Features
- System Metrics Displayed:
- CPU usage percentage
- CPU temperature
- RAM usage
- GPU usage (NVIDIA, AMD, and Intel)
- GPU temperature (NVIDIA, AMD, and Intel)
- HDD usage (dynamic drive selection based on highest usage)
- Easy Setup: Configuration script simplifies the setup process.
- Scheduled Task Support: Users can copy the SystemD config files for easy systemctl support.
Requirements
The project needs both Python packages and a few Linux command-line tools that are called directly by the scripts.
Hardware and network
- A Divoom Times Gate or Pixoo64 on the same LAN as the Linux host
- Internet access during
divoom_setup.pyso the script can query Divoom cloud endpoints - A Linux system with Python 3
Python packages
The monitor needs psutil and requests.
On Fedora, install them with the system pip. When the system site-packages directory is not writable, pip installs them for your user:
pip install -r requirements.txt
On Debian and Ubuntu, install them into a virtualenv:
python3 -m venv .venv
.venv/bin/pip install -r requirements.txt
Required Linux packages / binaries
lspcifrompciutilsSetup uses it to list GPUs. The monitor uses it only whenconfig.envdoes not already name a GPU.
# Fedora
sudo dnf install pciutils
# Debian / Ubuntu
sudo apt install pciutils
# Arch Linux
sudo pacman -S pciutils
CPU percentage, memory, disk busy time, and most temperatures come from psutil. Disk names come from /sys/block. iostat is not used.
GPU vendor-specific requirements
- NVIDIA:
nvidia-smi, usually shipped with the proprietary driver. - AMD: the kernel
gpu_busy_percentand hwmon files.rocm-smiis used only when those files are missing. - Intel: the same kernel files.
nvtop -sis the fallback, and a JSONnullfrom nvtop is left blank instead of being shown as 0%.
lm-sensors (sensors) is optional. It is consulted only when psutil cannot read a CPU temperature.
Optional system software
systemdOnly required if you want to run the monitor as a service with the provided unit files.
Usage
-
Configuration:
- Run
divoom_setup.pyto create the necessary configuration file and established the Divoom PC Monitor app on a LCD face.
- Run
-
Running the Script:
- Execute
divoom_pc_monitor.py - The interval is the time from the start of one update to the start of the next. Each update spends about one second measuring CPU and disk.
--testingcollects the same readings and does not send them to the device.- Run
python divoom_pc_monitor.py --helpfor the full argument list.
- Execute
Installation
-
Clone the repository:
git clone https://github.com/KallanX/Divoom-PC-Monitor-Python.git cd Divoom-PC-Monitor-Python -
Install the Python dependencies.
Fedora uses the system interpreter:
pip install -r requirements.txtDebian and Ubuntu use a virtualenv:
python3 -m venv .venv .venv/bin/pip install -r requirements.txt -
Run the setup. It writes
config.envnext to the scripts, including the CPU vendor and the GPU you select. Re-run it if you add a drive or change graphics cards.# Fedora python divoom_setup.py # Debian / Ubuntu .venv/bin/python divoom_setup.py⚠️ Attention: If the PC Monitor app (625) is currently displayed on a 'LCD face', the setup output will include 'Divoom PC Monitor'. This message doesn't restrict which 'LCD face' you can ultimately use; the app can be assigned to any face regardless of its initial state.
-
Execute main monitor:
# Fedora python divoom_pc_monitor.py -i 10 -v # Debian / Ubuntu .venv/bin/python divoom_pc_monitor.py -i 10 -v -
(Optional) Install the systemd service. Edit
User,ExecStart, andWorkingDirectoryin the distro unit, then copy it. On Fedora,Usermust be the account that ranpip install, because those packages are installed for that user. On Debian and Ubuntu,ExecStartmust use the virtualenv's Python.cp systemd-configs/<DISTRO>/divoom_monitor.service /etc/systemd/system/ sudo systemctl daemon-reload sudo systemctl enable divoom_monitor.service sudo systemctl start divoom_monitor.service
Work In Progress
- Intel Arc still depends on the kernel exposing
gpu_busy_percentand a hwmon temperature. Where those files are missing, readings depend onnvtopand may stay blank. - An on-going bug hunt and optimization. User contributions/recommendations are welcome.
Author
This project was created by Keith Carichner Jr. due to the lack of a competent implementation that actually functioned and was well-written/documented.
License
This project is licensed under the MIT License - see the LICENSE file for details.