September 10, 2016

Raspberry Pi Temperature Tracking Shell Script

 So I've been bitten by the Raspberry Pi bug and put together a device to monitor my own network.  I have several tools loaded and run the device 24x7.  I noticed the device running a bit warm so I wanted to track the temperature over time.  Below is the simple shell script I put together to run via crontab as root.  The script will output the date/time along with the CPU temperature in Fahrenheit.

 During my initial setup I was running closer to 130 degrees but was able to substantially drop the temperature by purchasing a new case from Amazon.  I did take the advice of one reviewer and forced the air onto the CPU, seems to have done the trick.  I am also using a copper heatsink for extra measure.  I've attached the links for both the case and heatsink I used below.

#!/bin/bash

DATE=`date "+%m-%d-%Y %H:%M:%S"`
CELTMP=`/opt/vc/bin/vcgencmd measure_temp|cut -f2 -d"="|cut -f1 -d"'"`
FAR=$(echo "scale=2;((9/5) * ${CELTMP}) + 32" |bc)
#echo "${FAR}'F"
#echo "${CELTMP}'C"
echo "${DATE}:  ${FAR}" >> CPU.temp.txt


Raspberry Pi case and heatsink links.

https://www.amazon.com/gp/product/B00M859PA6/ref=oh_aui_detailpage_o04_s01?ie=UTF8&psc=1

https://www.amazon.com/gp/product/B00NKAKN40/ref=oh_aui_detailpage_o04_s01?ie=UTF8&psc=1


Enjoy,

--JR Miller

5 comments:

  1. Sweet. I have one runing tinyCA and another running open ldap. You can't beat a $35 computer.

    ReplyDelete
  2. I have read all the comments and suggestions posted by the visitors for this article are very fine,We will wait for your next article so only.Thanks! humidity chamber

    ReplyDelete
  3. These days, with snow falling in Atlanta at Christmastime and unlikely freezing temperatures experienced in South Florida, it makes purchasing weather stations for home an excellent idea! Be prepared for any unexpected inclement conditions by investing in your own home weather station. Barrackpore

    ReplyDelete
  4. I like your all post. You have done really good work. Thank you for the information you provide, it helped me a lot. I hope to have many more entries or so from you.
    Very interesting blog.
    Eset Smart Security Premium Crack
    AOMEI Partition Assistant Crack
    MSI Wrapper Pro Crack
    AnyDesk Crack
    AOMEI Backupper Crack

    ReplyDelete

Building a pfSense Firewall for Home

 After playing with several open firewall solutions in a virtualized sandbox I decided that pfSense was the platform for me.  I started look...