Closed TobKra96 closed 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
.
Here is a good Flask example: https://github.com/Jahaja/psdash
API Implementation started: https://github.com/TobKra96/music_led_strip_control/commit/95557c85e42b3f8f75846906cfea4b6503131ac5 😎
Added GetSystemInfoPerformance, GetSystemInfoTemperature, GetSystemInfoServices Endpoints
done with 2.2
Add a page that polls data like:
Maybe you can restart hostapd.