TobKra96 / music_led_strip_control

Audio visualization for LED strips in real-time with web interface on a raspberry pi.
https://tobkra96.github.io/music_led_strip_control/
MIT License
297 stars 64 forks source link

System Info page #114

Closed TobKra96 closed 3 years ago

TobKra96 commented 3 years ago

Add a page that polls data like:

Maybe you can restart hostapd.

Teraskull commented 3 years ago

For CPU, RAM and Network Usage we can use psutil.

For Temperature we should use the dedicated software for raspberry pi:

/opt/vc/bin/vcgencmd measure_temp

Which in Python can be used like this:

import os
import re

def measure_temp():
    temp = os.popen("vcgencmd measure_temp").readline()
    return (re.findall(r"\d+\.\d+", temp)[0])

print(measure_temp())

Getting running services and hostapd status can be done with os or subprocess.

Teraskull commented 3 years ago

Here is a good Flask example: https://github.com/Jahaja/psdash

TobKra96 commented 3 years ago

API Implementation started: https://github.com/TobKra96/music_led_strip_control/commit/95557c85e42b3f8f75846906cfea4b6503131ac5 😎

Added GetSystemInfoPerformance, GetSystemInfoTemperature, GetSystemInfoServices Endpoints

image

TobKra96 commented 3 years ago

done with 2.2