Edited by tkaiser at Fri Jan 30, 2015 05:09 |
EDIT: Before you trust in the CPU's/SoC's temperature values jump directly to the final conclusions later in this thread!
When using RPi-Monitor to do some lightweight monitoring on the Banana Pi I realized that under heavy load both SoC/CPU temperature as well as SSD temps couldn't be read always and were therefore missing on the graphs.
To prevent this and to ensure RPi-Monitor's abilities to collect thermal data in its RRDs (round robin databases) I created a quick&ugly daemon that tries to read out thermal values from SoC/CPU and HDD/SDD and if that fails simply do a fallback to the value queried 5 seconds ago.
Save the following code to /usr/local/bin/temp-daemon.sh and make it executable (chmod 755 /usr/local/bin/temp-daemon.sh)
You have to ensure that the sunxi_dbgreg.ko module is available to read out the registers of the A20 SoC. In case you want to measure the internal thermal sensor of a HDD/SSD connected via SATA you must install the hddtemp package and have to setup hddtemp accordingly
Ensure that /usr/local/bin/temp-daemon.sh will be called at startup eg. by adding
to the end of /etc/rc.local. The daemon will update every few seconds the contents of /run/soc-temp and /run/hdd-temp (you might want to adjust these paths to eg. /var/run/ if they don't exist or the target filesystem isn't RAM based) Copy the Code
- nohup /usr/local/bin/temp-daemon.sh &
Then you have to install RPi-Monitor (2.9 or above for the gauge graphs) according to the official simple tutorial (if you do it this way it will be automatically updated afterwards via the package management).
And then it's time to configure RPi-Monitor since RasPi's 'sensors' are somewhat different compared to those available on the Banana Pi (applies to other A20/AXP209 based boards identically, eg. Cubietruck, A20-OLinuXino-Lime2)
1) Create the following files after installation of RPi-Monitor:
2) Fetch http://www.apkdad.com/wp-content/uploads/2013/01/Battery-Icon1.png, scale it down to 64x64 pixels and store it as /usr/share/rpimonitor/web/img/pmu.png
3) Delete /etc/rpimonitor/data.conf and create a new symlink to /etc/rpimonitor/template/bananian.conf:
4) restart RPi-Monitor: Copy the Code
- cd /etc/rpimonitor && rm data.conf && ln -s /etc/rpimonitor/template/bananian.conf data.conf
A few final words: Copy the Code
- service rpimonitor restart
The stuff outlined above works on Bananian and Igor's great Wheezy image out of the box. No idea what has to be adjusted on other Distros -- feedback welcome.
You can use the aforementioned quick&dirty daemon with any other monitoring/RRD solution since you can read out SoC/disk temperatures from /run/soc-temp and /run/hdd-temp afterwards.
Running such a daemon means creating some load (might increase by 0.1) so as usual: Measuring something itself changes the values you get. You have been warned
The temperature read out from the A20's registers is uncalibrated. Therefore a correction value is necessary (read/understand the comments in this thread). I used "SoCTempAdjustment=1447" in the daemon as suggested and this seems to work on my Banana Pi. On my A20-OLinuXino-Lime2 I had to decrease $SoCTempAdjustment so don't trust the values you get unless you can verify them with a suitable thermometer. As a rough check you can carefully touch the A20 SoC while running --> temperature must decrease immediately by a few degrees but shouldn't be below 38°C. Beware of destroying your Pi when you're touching it while running.
This is what you get:
(10:15-10:20 iozone disk test, 10:39-10:46 "apt-get update/upgrade", 11:17-11:23 both iozone and "stress -c 2 -m 2 -i 2", 11:30-11:36 just "stress -c 2 -m 2 -i 2")
View Rating Log