Core Electronics Forum

How to Stress Test Temperature on Raspberry Pi (Stressberry)

Graham just shared a new tutorial: “How to Stress Test Temperature on Raspberry Pi (Stressberry)”

First of all, why subject your Raspberry Pi to this level of stress? In the case of Raspberry Pi 4, the A72 CPU is so powerful that it can overheat if it doesn’t have enough cooling. This results with the CPU being governed (slowed down) to red…

Read more

I ran the test on my Pi4 using the Dual Fan Aluminium Heatsink Case for Raspberry Pi 4 Black. It is a cool day in Sydney (22℃) but it took 10 minutes before it even activated the fan.

NOTE in instructions mkdir ~\TemperatureTests should be mkdir ~/TemperatureTests

1 Like

Nice test, that’s a whole lot better than the bare board and official case in my guide. Looks like the Dual Fan case is about as good as it gets for cooling.

Great pickup, fixed!

I’m trying this on a pi 3b+, I copied and pasted everything from this page and the stress test ran fine and completed, but when I enter
MPLBACKEND=Agg /home/pi/.local/bin/stressberry-plot mytest.out -f -d 300 -f -l 400 1600 -t 30 90 -o mytest.png --hide-legend --not-transparent --line-width 2

I am getting errors:

Traceback (most recent call last):
File “/home/pi/.local/bin/stressberry-plot”, line 11, in
File “/home/pi/.local/lib/python3.5/site-packages/stressberry/”, line 152, in plot
AttributeError: ‘NoneType’ object has no attribute ‘plot’

Am I missing something?

Hi Michael,

Nothing comes to mind why it fails at that line, if everything was setup correctly. The 3B+ doesn’t affect how the script works. If it works in one RPi, it will work in others.

Might be worth checking the basics, like updating Raspbian:

sudo apt update
sudo apt full-upgrade

If it still happens, I would lean to a botched install of stress/stressberry. A bunch of ways to solve this, though perhaps the safest would be to download a fresh Raspbian and then install the packages in the vanila environment.

Hello Michael , Hello Graham,

I’ve been running the stresstests on both, Raspi 4 and Raspi 3b+. On both devices I receive the same error message.

I’ve ran the commands you described in your reply, but continnue to receive the same error message again.

Traceback (most recent call last):
File “/home/pi/.local/bin/stressberry-plot”, line 11, in
File “/home/pi/.local/lib/python3.5/site-packages/stressberry/”, line 152, in plot
AttributeError: ‘NoneType’ object has no attribute ‘plot’

Do you have any idea what i could do to solve this issue?

You couldn’t get that error on a Pi4 because it needs Buster which has python3.7

Out of curiosity, have you run an update?

sudo apt update
sudo apt full-upgrade

FLIRC case with plastic top removed

Board Raspberry Pi 4 (4GB)
Storage Samsung EVO Plus 128GB microSD
Room temperature 28 C
Humidity 40%

1 Like

I had the same problem. i hope this helps you. It did the trick for me.
Edit /home/pi/.local/lib/python3.7/site-packages/stressberry/ and change line 150 as follows.

ax1 = plt.subplot() #fig.add_subplot()


1 Like

ok so here is what i did and what i used:
raspberry pi 4 gig model running rsapian.
case: argon neo case with the icetower attached on the 2 attach points after the case is installed. plus 2 penies with the stock thermal pads between them and the ice tower and the case. so the stack goes:
pi, stock thermal pad from argon, argon neo case with the slide off top removed, thermal pad from ice tower, shiny penny, thermal pad from ice tower, shiny penny, thermal pad from ice tower, ice tower low profile cooling fan with the fan reversed from stock position so it pulls air up and away from the pi to eliminate heat (it comes stock with the fan blowing down on to the pi).
this is sofar the best cooling i have seen for the pi 4 whie using a case. i didnt even reach 56 celcius even once. topped at 55c only on one reading at 1500mhz next read after that was back at 54c. but as you can see it hung out at the 53c to 54c range for the most intense parts of the test.
not as good as just the bare ice tower and pi, but i need a case on mine so that it is properly protected. i may tr dremmeling the case so as to fit the ice tower directly to the pi at some later date.

1 Like

Thank you for a great guide! Used this script to test the thermals on my overclocked Pi 4!
I’m using the case I got from the OKDo Starter Kit, heatsinks attached with thermal pads on the SoC, RAM and USB 3.0 chips and a 5V fan attached above the SoC (or. I’ve OCed it to 1750Mhz and the GPU to 750MHz and it never got any hotter than 56* C :slight_smile:

I think I might stick around onj this site!


What does this mean? It looks like my Pi 4B never throttled at all (always at 1500Mhz during test)
It was in an AC room (bare board) at 24 C ambient.
I ran this test to see if putting on cheap aluminium heat sinks would make a difference.
Should I run a more demanding test ? How would I do that?

Hi Kevin,

Yep, that’s right. The RPi was not governed and performed well. Which it ought to given the thermal properties you described (bare board, air conditioning).

Performance issues can trigger when the RPi is in a case and has less airflow or other factors such as warmer ambient temperatures.

For this purpose, it doesn’t get more stressful then that. It is unlikely that the RPi is going to be at 100% load at all times, but if it is, you could run the test for longer to see if heat over longer periods becomes an issue.

Performance aside, it’s best to have a case for your RPi to avoid accidents. If it’s not going to be under heavy load then any case ought to be fine. Otherwise, go with passive cooling for silent/indoor applications and only consider active cooling for warmer/industrial applications.