Skip to content

Tools to use a raspberry + display as a computer stat monitoring scree.

Notifications You must be signed in to change notification settings

blakekrpec/PyPeekr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

152 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyPeekr

Python package to use a raspberry + display as a computer stat monitoring screen.

The project is designed to have a server that hosts the computer stats over a local network. A client then grabs this data and presents it in a GUI.

Clone the project

git clone git@github.com:blakekrpec/PyPeekr.git

Server

Windows Server

LibreHardwareMonitor is used as the server on Windows to host the pc information over the web. This was easier than getting to cpu stats via python on Windows.

To install LibreHardwareMonitor, grab the latest release. Then extract, and run the app.

Launch LibreHardwareMonitor and make the following changes to settings:

Options > Enable Run on Windows Startup
Options > Minimize on Close
Options > Remote Web Server > Enable Run 
Options > Remote Web Server > Port > (set desired port and note it)

Linux Server

The Linux server is written in python (LibreHardwareMonitor does not run on Linux). It currently outputs temperature and utilization data for Intel CPUs, AMD CPUs, and Nvidia GPUs. AMD GPUs are to be added at a later late when one is available for testing.

The linux server can be started with run_linux_server from inside the activated python virtual environment, .pypeekr.

Client

The client is written in python and sends http GET requests to the server. When the main GUI is started, the appropriate client (windows or linux) is started automatically. The Windows and Linux clients are almost identical except that they handle data formats from their respective server, and reformat them into a format that is common between both clients.

Running pypeekr

Linux Setup

run setup script

./linux_setup.sh

Source the python virtual environment

source .pypeekr/bin/activate

Start the Linux server

run_linux_server

In a separate terminal source venv and start the client GUI

source .pypeekr/bin/activate
gui

In the GUI you will need to enter the IP of the server. If running server and gui on the same machine, localhost port 8000 should work (127.0.0.1:8000).

Windows Setup

run setup script

.\windows_setup.bat

source venv

.\pypeekr\Scripts\activate

You may need to add privellages for your user on windows to activate the pyven. If you see errors akin to "cannot be loaded because running scripts is disabled on this system".

You can run this script with the privalleges

powershell -ExecutionPolicy Bypass -File .pypeekr\Scripts\activate

Or you can set you user to always be able to run scripts.

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

run code

gui

In the GUI you will need to enter the IP of the server. This will be the IP and port used in the LibreHardwareMonitor settings.


Current design:

  • All python files in pypeekr should abide by Flake8 formatting guidelines. The linter should be run before all commits are made. Run the linter with lint_pypeekr from within the sourced .pypeekr virtual environment. Tools like pylint should also be used to check for bad practices (the pylint extension in VSCode is very useful), but it is not required commits satisfy all concerns generated by pylint (or similar tools). It is required that all commits return no concerns when running lint_pypi.

  • The intended client is a RasPi on your LAN with a systemctl service to run the gui on startup. However, the client should be able to run on any Windows, or Linux machine.

  • Server

    • On Linux, the server is custom.
    • On Windows, the LibreHardwareMonitor REST API will be used. Data from LibreHardwareMonitor is parsed by the client and stored in a structure identical to what the Linux server creates so that the GUI is agnostic of where the data is coming from.

About

Tools to use a raspberry + display as a computer stat monitoring scree.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published