A comment on my pictures/post of my installation from mrburns42 regarding temperature extremes prompted me to add some code to the interval program home page to display the CPU temp as a just-in-case/visibility measure. This is the first time I’ve ever touched Python so forgive any amateurishness and please post any improvements.
Added to ospi.py under Function Definitions:
res = os.popen('vcgencmd measure_temp').readline()
Added to ospi.py under Class definitions, home, Get(self):
This displays the temp in Fahrenheit (you can see the calculation above converting from Celcius). A potential expansion/improvement would be to add a setting in options F or C and then of course, display the temp value based on that setting.
If you are interested in graphing of the CPU temp I highly suggest you explore options such as Cacti. They are wonderful with dealing with this information. You can install Cacti right on the Raspberry Pi or you can have another server do Cacti and use SNMP to poll the RPi.
By the way, the solution you came up with is awesome!
I am using salbahra’s awesome web interface, so since my rPi has php on it I made some additions to his code to allow me to have custom pages….one of them being a stats page. Check out my screenshot of the stats –