Get temperature of your Raspberry Pi

7 Responses

  1. grant says:

    Hi there how do i get vcgencmd?

  2. adnen says:

    Hi,
    please any one know how i can Display this Values “Temperature” into a PHP pages,
    please Help

    • This is really easy. There is a php command for executing shell commands (exec). So with this little php script you can display the temperature:

  3. LinuxMaven says:

    #!/bin/bash

    for id in core sdram_c sdram_i sdram_p ; do \
    echo -e “$id:\t$(vcgencmd measure_volts $id)” ; \
    done

    C2F() {
    TC=$1
    TC1=echo $TC | cut -d '.' -f1
    TC2=echo $TC | cut -d '.' -f2
    #echo TC=$TC, $TC1 $TC2
    TF=$(( (9*(10*$TC1 + $TC2) +25)/50 +32 ))
    }

    tm=/opt/vc/bin/vcgencmd measure_temp
    TC=echo $tm| cut -d '=' -f2 | sed 's/..$//'
    C2F $TC

    echo temp = $TC\°C \($TF\°F\)

Leave a Reply

Your email address will not be published. Required fields are marked *