3urobeat / arduino-resource-monitor

πŸ“Š Display resource usage of your PC on an 4x20 LCD display powered by an Arduino Nano

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

arduino-resource-monitor

Display the resource usage of your PC on an 4x20 LCD display!
This project retrieves CPU, RAM & GPU usage and sends it to an Arduino Nano which is connected via USB.
Both Linux and Windows are supported.

 

Installation

Install the following packages using your package manager:

make  
cmake  
sysstat  
lm_sensors  
radeontop       (If you are using an AMD GPU)  
nvidia-settings (If you are using an NVIDIA GPU)

(I hope I didn't miss anything. The package names may deviate if you aren't on Arch)

 

Configuration

Linux:
Before compiling, open src/server/linux/server.h with a text editor.
Run sensors in another terminal, find your CPU temp sensor and enter it at cpuTempSensor.

Set gpuType to 0 if you have an NVIDIA GPU or to 1 if you have an AMD GPU.

If you've got an AMD GPU:
Find your GPU temp sensor in the readout from above as well and enter it at gpuTempSensor.
Run lspci | grep Radeon and find the bus id of your GPU, it's the first number before the : of the line describing your card. My dedicated card has the ID 03.

If you've got multiple USB devices connected that use /dev/ttyUSB paths then you might need to change port. I'd recommend leaving it as default for now and changing it later should the connection not work.

Windows:
Before compiling, open src/server/windows/Settings.cs with a text editor.

Set the gpuID to the same ID as shown in your Task Manager (for example for GPU1 set 1).

Customize the sensor names and indices below should hardware differ from mine.
Logging all sensor names in some convenient way is TBA.

 

Compiling the server

Linux:
Go into the build folder of the linux server. Run these commands:
cmake ..
make -j6 (replace the 6 with how many CPU threads you want to use, more = faster)

You now have a binary arduino-resource-monitor-server-linux which you can put anywhere on your system.

Windows:
Open the solution file src/server/windows/windows.sln in Visual Studio.
Right click on the solution "windows" in your solution explorer and click on Publish.
There should be a pre-configured configuration shown to you now. Hit Publish at the top and wait until finished.
Your .exe is now located under src/server/windows/bin/Release/net6.0/publish/win-x64/windows.exe. Rename and copy the .exe to anywhere you like.

You can probably also compile this project without the full Visual Studio editor installed, but I don't know exactly how. (I usually develop on Linux)

 

Compiling the client

Compile & Upload the client directory using platformio.

Instructions TBA

 

Connecting the Display to your Arduino

Connect your display like this:
SDA -> A4
SDC -> A5
VCC -> 5V
GND -> GND

 

Running

Linux: Before running, make sure you are in the group uucp, otherwise you won't be able to execute the binary without root permissions:
sudo usermod -aG uucp $USER
You probably need to relog for this change to be applied. You can work around this until you relog by running su $USER in the terminal that you'll use to execute the binary in a few moments.

Make sure your binary is executable by running:
sudo chmod +x ./arduino-resource-monitor-server-linux

Connect the Arduino Nano to your PC and wait for it to start.
Now execute the binary by running ./arduino-resource-monitor-server-linux. Your LCD display should start displaying values!

You can send the process into the background to be able to the close the terminal by pressing CTRL+Z, running bg and then disown.

Windows: Open the exe.
You can also create a small batch script to open the application in the background, maybe even on autostart.

About

πŸ“Š Display resource usage of your PC on an 4x20 LCD display powered by an Arduino Nano

License:GNU General Public License v3.0


Languages

Language:C++ 60.6%Language:C 33.0%Language:C# 6.1%Language:CMake 0.3%