DEV Community

Discussion on: How to build AdonisJS API to store your Raspberry Pi Temperature

Collapse
 
peter279k profile image
peter279k

This temperature=$(/opt/vc/bin/vcgencmd measure_temp | tr -d temp=\'C) approach is to get the GPU temperature.

To get the CPU temperature, we can use the following command:

cpu=$(</sys/class/thermal/thermal_zone0/temp)
echo "$((cpu/1000)) c"
Enter fullscreen mode Exit fullscreen mode

And the reference is available here.

Collapse
 
bobbyiliev profile image
Bobby

Very good point! Thanks for mentioning this Peter!