Raspberry PI - get temperatur
#1
Sat, 2016-03-26 06:16
roger.newman
-
- Offline
- 1 year 11 months ago
- 2016-03-26
Hi everyone,
as there is no I was looking for a way to get the temperature of my rpi.vcgencmd
in alpine,
So here is a simple alias to get a well formated output of the current temp. Put it in you .bashrc or .zshrc and reload it.
alias
## get temperature function temp() { awk "BEGIN { printf \"%.2f°C\\n\", $(cat /sys/class/thermal/thermal_zone*/temp)/1000 }" }
output
46.16°C
edit:
The pkg raspberrypi
provides the pi-tools so /opt/vc/bin/vcgencmd measure_temp
will do the job.
Regards,
Roger Newman