Raspberry Pi - Possibilidades do comando VCGENCMD: mudanças entre as edições
De Área31 Hackerspace
Sem resumo de edição |
Sem resumo de edição |
||
Linha 12: | Linha 12: | ||
Meça a temperatura, e cause um "stress" para mensurar a dissipação de calor: | Meça a temperatura, e cause um "stress" para mensurar a dissipação de calor: | ||
vcgencmd measure_temp && stress --cpu 1 -t 300 && vcgencmd measure_temp | vcgencmd measure_temp && stress --cpu 1 -t 300 && vcgencmd measure_temp | ||
Você pode notar que "sapecar" o processador aumenta a temperatura, porém não chega nem perto dos 80ºC. Eu sempre compilo bastante coisa em paralelo de forma distribuída com hosts x86_64 ou outros raspberry's do cluster. | |||
=== Controlando a temperatura do Raspberry Pi === | |||
Por questões de segurança, adicione um script que irá verificar a temperatura a cada 5 minutos e desligar o Raspberry Pi caso exceda 78ºC. | |||
<pre> | |||
# vi /usr/bin/tempcheck | |||
#!/bin/sh | |||
# This script reads the Broadcom SoC temperature value and shuts down if it | |||
# exceeds a particular value. | |||
# 80ºC is the maximum allowed for a Raspberry Pi. | |||
# Get the reading from the sensor and strip the non-number parts | |||
SENSOR="`/opt/vc/bin/vcgencmd measure_temp | cut -d "=" -f2 | cut -d "'" -f1`" | |||
# -gt only deals with whole numbers, so round it. | |||
TEMP="`/usr/bin/printf "%.0f\n" ${SENSOR}`" | |||
# How hot will we allow the SoC to get? | |||
MAX="78" | |||
if [ "${TEMP}" -gt "${MAX}" ] ; then | |||
# This will be mailed to root if called from cron | |||
echo "${TEMP}ºC is too hot!" | |||
# Send a message to syslog | |||
/usr/bin/logger "Shutting down due to SoC temp ${TEMP}." | |||
# Halt the box | |||
/sbin/shutdown -h now | |||
else | |||
exit 0 | |||
fi | |||
</pre> | |||
Configure o Crontab para executar o script a cada 5 minutos: | |||
*/5 * * * * /usr/bin/tempcheck | |||
Edição das 21h43min de 15 de outubro de 2013
Tensão
for id in core sdram_c sdram_i sdram_p ; do echo -e "$id:\t$(vcgencmd measure_volts $id)" ; done
Temperatura
vcgencmd measure_temp
Codecs
Mostra se o codec especificado está ativado, o codec pode ser um dos H264, MPG2, WVC1, MPG4, MJPG, WMV9. Por favor note que este foi executado em um Pi com as licenças MPG2 e VC1 ativadas.
for codec in H264 MPG2 WVC1 MPG4 MJPG WMV9 ; do echo -e "$codec:\t$(vcgencmd codec_enabled $codec)" ; done
Análise de desempenho
Meça a temperatura, e cause um "stress" para mensurar a dissipação de calor:
vcgencmd measure_temp && stress --cpu 1 -t 300 && vcgencmd measure_temp
Você pode notar que "sapecar" o processador aumenta a temperatura, porém não chega nem perto dos 80ºC. Eu sempre compilo bastante coisa em paralelo de forma distribuída com hosts x86_64 ou outros raspberry's do cluster.
Controlando a temperatura do Raspberry Pi
Por questões de segurança, adicione um script que irá verificar a temperatura a cada 5 minutos e desligar o Raspberry Pi caso exceda 78ºC.
# vi /usr/bin/tempcheck #!/bin/sh # This script reads the Broadcom SoC temperature value and shuts down if it # exceeds a particular value. # 80ºC is the maximum allowed for a Raspberry Pi. # Get the reading from the sensor and strip the non-number parts SENSOR="`/opt/vc/bin/vcgencmd measure_temp | cut -d "=" -f2 | cut -d "'" -f1`" # -gt only deals with whole numbers, so round it. TEMP="`/usr/bin/printf "%.0f\n" ${SENSOR}`" # How hot will we allow the SoC to get? MAX="78" if [ "${TEMP}" -gt "${MAX}" ] ; then # This will be mailed to root if called from cron echo "${TEMP}ºC is too hot!" # Send a message to syslog /usr/bin/logger "Shutting down due to SoC temp ${TEMP}." # Halt the box /sbin/shutdown -h now else exit 0 fi
Configure o Crontab para executar o script a cada 5 minutos:
*/5 * * * * /usr/bin/tempcheck
Referências:
http://elinux.org/RPI_vcgencmd_usage