Oct 142017
 

While building my Pi 3 cluster I looked around for an easy bash script to monitor the CPU temperature. I found Vivek Gite’s original script worked nicely but I wanted it to monitor continuously until I stopped the script, I wanted the CPU temperature to be reported with the same precision as the GPU temperature and lastly, I wanted to discard the “temp=” output in the GPU temperature. To achieve all that, I edited the script and installed bc on the system (for the CPU temperature precision):

pi@localhost:~ $ sudo apt-get install bc

The following script continuously monitors temperatures for the CPU and GPU.

#!/bin/bash
# Display the CPU and GPU temperature of the Raspberry Pi 3
# Author: Samuel Trassare (trassare.com) based on original script by Vivek Gite (cyberciti.biz) under GPL v2.x+
# Requires bc for proper formatting of the CPU temperature.

cpu=$(echo "scale=1; `cat /sys/class/thermal/thermal_zone0/temp` / 1000.0" | bc)

echo "$(date) @ $(hostname)"
echo "Press [ctrl+c] to end monitoring"

while true
do
  echo ""
  echo "CPU => $cpu'C"
  echo "GPU => $(/opt/vc/bin/vcgencmd measure_temp | cut -d = -f2)"
  sleep 3s
done

You can set the wait time between temperature reads by editing the line

  sleep 3s

to whatever you want.

Some folks have pointed out that the CPU and GPU don’t need to be read separately as both sensors are on the same SOC however I have noticed that the two sensors frequently report slightly different temperatures so I want them both reported.

This script can be downloaded from its github repository.

Oct 142017
 
A 5-node Raspberry Pi 3 cluster.

A 5-node Raspberry Pi 3 cluster.

Here’s my latest project. I realize I’m late getting on the bandwagon. I heard of the Raspberry Pi ahead of it’s initial introduction way back in February of 2012 but it didn’t pique my interest back then. This past summer, when my interest in SETI@home was again stirred up, I began looking into building a cheap computing cluster. I had long considered buying a set of cheap laptops for the project but none ever hit a reasonable price point for me. In particular, I always considered buying a bunch of Dell Latitude C400 units as I already had one that has been running almost non-stop since I bought it used in 2006. Unfortunately, a complete, working unit never was cheap enough for me.

With the news of the Pi 3 release, I started seeing articles of people building BOINC clusters with them. In particular, I found this YouTube video and it’s sequel, both by KF7IJZ which really illustrated how easy a Pi 3 cluster is to build. So I set about building one for myself.

I’m glad I decided on the Pis rather than the C400. With the two of them running side-by-side, I can see that the Pi is beating the C400 by quite a bit just by looking at the RAC. I’m up to five nodes right now but I intend to eventually have eight nodes and secure it all in some kind of case.