This question already has an answer here:

I have been looking on the internet and found nothing for getting readings of the temperatures of the CPU on the Raspberry Pi.

Im using Raspbian (Wheezy).

Any help would be great for everyone!

marked as duplicate by lenik, PiBorg, Butters, nc4pk, Impulss Aug 21 '13 at 3:00

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • asked and answered multiple times: raspberrypi.stackexchange.com/a/8690/7274 – lenik Aug 20 '13 at 6:55
  • i didnt want to do jQuery or graphs. – Alex Aug 20 '13 at 7:37
  • 2
    reading /sys/class/thermal_zone0/temp does not require no graphs nor jquery – lenik Aug 20 '13 at 8:03
  • but the 2 answers in the question you linked talked about using jQuery or output with graphs. and python. – Alex Aug 20 '13 at 8:04
  • 1
    please, read the question, the quote starting from "# read the temperature and convert..." and the next 2 lines. – lenik Aug 20 '13 at 8:06

I found an answer at http://www.raspberrypi.org forums. You can read the CPU temp via bash script. Save this script as getTemp.sh in /usr/local/bin folder and give execute permission with chmod +x /usr/local/bin/getTemp.sh command. Then run it, you will get temp values.

cpuTemp0=$(cat /sys/class/thermal/thermal_zone0/temp)
cpuTempM=$(($cpuTemp2 % $cpuTemp1))

echo CPU temp"="$cpuTemp1"."$cpuTempM"'C"
echo GPU $(/opt/vc/bin/vcgencmd measure_temp)

Not the answer you're looking for? Browse other questions tagged or ask your own question.