Any plug-in to have cpu temperature, fan speed etc while playing? Thanks in advance
for CPU temp you can use System Info. On fan speed it almost impossible to create something universal. Everything below a rPi5 have custom build solution for a RPM controlled fan.
Only a rPi5 has a standard way to get the info.
volumio@rpi5-ws1280:~$ cat /sys/devices/platform/cooling_fan/hwmon/hwmon1/fan1_input
2645
from ilio import read
import gpiozero as gz
from time import sleep, gmtime, strftime
min = 100.0
max = 0.0
while True:
cmd = gz.CPUTemperature().temperature
rpm = read('/sys/devices/platform/cooling_fan/hwmon/hwmon1/fan1_input')
if cmd < min :
min = cmd
if cmd > max :
max = cmd
print (strftime("%H:%M:%S", gmtime()) + " => Min: " + str('{0:.1f}'.format(min)) +
"C, Max: " + str('{0:.1f}'.format(max)) +
"C, Cur: " + str('{0:.1f}'.format(cmd)) +
"C, RPM: " + rpm )
sleep(5)
volumio@rpi5-ws1280:~/scripts$ python3 temp.py
18:18:05 => Min: 56.2C, Max: 56.2C, Cur: 56.2C, RPM: 5016
18:18:10 => Min: 56.2C, Max: 57.3C, Cur: 57.3C, RPM: 5009
18:18:15 => Min: 56.2C, Max: 57.3C, Cur: 56.8C, RPM: 5008
other option:
sudo apt-get install lm-sensors
sudo sensors-detect
Answer all questions with Y
Run:
sensors
volumio@rpi5-ws1280:~/scripts$ sensors
rp1_adc-isa-0000
Adapter: ISA adapter
in1: +0.95 V
in2: +2.51 V
in3: +1.35 V
in4: +1.40 V
temp1: +55.5 C
cpu_thermal-virtual-0
Adapter: Virtual device
temp1: +56.2 C
rpi_volt-isa-0000
Adapter: ISA adapter
in0: N/A
pwmfan-isa-0000
Adapter: ISA adapter
fan1: 4998 RPM
as bash for requested:
#!/bin/bash
sensors | grep -i fan
sensors | grep -i temp
volumio@rpi5-ws1280:~/scripts$ ./cpu.sh
pwmfan-isa-0000
fan1: 4997 RPM
temp1: +54.9 C
temp1: +55.6 C
@Wheaten i am sorry, back on this.
Not sure if i understand: is it a code which remains or a question to the system?
And again: what “Everything below a rPi5” stands for?
Thanks
rPi1,2,3,4
Only thing you could is using a 3-wire fan (5V-GND-GPIO4) and monitor if the GPIO is High or Low.
nano /boot/userconfig.txt
add:
dtoverlay=gpio-fan,gpiopin=4,temp=60000
and something like this:
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup(4, GPIO.OUT)
def get_fanspeed():
if GPIO.input(4) > 0:
do something
else:
do something
@Wheaten RPi stands for raspberry version? I have a micro atx with a 2k mhz AMD cpu.
I was trying to monitoring temperature to check if i can go for a passive heater or at least choose the fan speed
so yes i have sensors onboard, as well as the 3 wires fan
Then I can’t support any further. Don’t have any AMD cpu’s, so no clue what and how things are reported back. On top this exceeds supporting Volumio. Maybe some community members will step up.
You can expirement yourself with lm-sensors and see what is returned.
sudo apt-get update && sudo apt-get install lm-sensors
run:
sensors
or:
source
inxi -Fxz | grep 'System Temperatures: cpu'
inxi -Fxz | grep 'Fan Speeds (RPM):'
I would opt to install system info plugin, that will give some info that might fulfill your needs.
i did , unfortunately the one and only measure it doesnt show it’s the temperature. I mean, it’s in the info but it’s void