Skip to content
Metalop.comJust Another Blog about Technology
  • Technology
  • Programming
  • Other Stuff

Running Raspberry Pi 5 Active Fan at Max Speed

August 20, 2024 0 comments Article Raspberry Pi, Technology Shiva
Table of Contents
  • The overheating/hanging problem
  • Solution: Run the fan at max speed
    • Build and Install Raspberry Pi Utils
    • Setup the build tools using
      • Ubuntu only extra step
    • Setting Fan Speed to Max using pinctrl

Like most of the folks, I too was excited when the launch of Raspberry Pi 5 with the newer processor. I didn’t intend to use it for any power tasks, but mostly for casual browsing and IoT experiments. For the most part it handles these things OK until it doesn’t.

The overheating/hanging problem

I have it setup with the official Active Cooler but one problem I have constantly faced with the unit is, sometimes the Fan Ramps down and when the system load increases, its not fast enough to ramp up, leading the system hang.

Tried multiple settings, operating systems and even changed the thermal pads to better ones but this is something that constantly keeps on bugging. Its quite annoying and the only option you are left with is to terminate the power, wait for it to cool down and restart. Also if it overheats and is in the hanged state, it remains on with I am afraid at some point with damage the electronics.

Solution: Run the fan at max speed

The device is not overclocked or anything so I expect it to behave it consistently. It running stability for long period is far more important to me than performance. So my solution to this is was to always turn on the fan at max speed.

I am using Ubuntu 24.04 LTS as my OS, but the steps should work pretty much on all operating systems

Build and Install Raspberry Pi Utils

Clone the raspberrypi/utils repo using the following command

git clone https://github.com/raspberrypi/utils.git

Setup the build tools using

sudo apt install cmake device-tree-compiler libfdt-dev

now just cd in the the utils directory and run the following commands to build and install the utilities

cd utils
cmake .
make
sudo make install

Ubuntu only extra step

While building using the above command, I ran into the following error on Ubuntu

  CMake Error at CMakeLists.txt:3 (project):
  No CMAKE_CXX_COMPILER could be found.

  Tell CMake where to find the compiler by setting either the environment
  variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
  to the compiler, or to the compiler name if it is in the PATH.

Solution is to please install build-essentials package additionally

 sudo apt-get update && sudo apt-get install build-essential

Setting Fan Speed to Max using pinctrl

If every thing went well above, there would be couple of utilities installed on the machine now. You can check the official githib readme to explore them more. The one which we are interested in pinctrl.

Its replacement for raspi-gpio, a tool for displaying and modifying the GPIO and pin muxing state of a system, bypassing the kernel.

Running the following command should set the fan speed to max

sudo pinctrl FAN_PWM op dl

Creating a auto start service

One of the problems that you might observe is that after restart the setting gets reset. As the command needs to be run with sudo privileges, the easiest solution is to create a service and enable it to autorun. involves only 3 steps listed below

Create a service file in /etc/systemd/system

sudo vim /etc/systemd/system/run_fan_at_max.service

Copy the following content in the file

[Unit]
Description=Script to run fan at max

[Service]
ExecStart=pinctrl FAN_PWM op dl

[Install]
WantedBy=multi-user.target                         

Reload and enable the service using the following commands

systemctl daemon-reload
sudo systemctl enable run_fan_at_max.service
sudo systemctl start run_fan_at_max.service

If everything went well the service should be active and running with the following log

Tags: Raspberry Pi 5, RP5

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Search

Blogroll

  • Documentation
  • Plugins
  • Suggest Ideas
  • Support Forum
  • Themes

Archives

  • August 2024
  • December 2023
  • July 2019
  • June 2019
  • August 2016
  • April 2016
  • December 2015
  • August 2015
  • July 2015
  • June 2015
  • June 2014
  • October 2013
  • August 2013
  • March 2013
  • February 2013

Categories

  • Other Stuff
  • Programming
  • Raspberry Pi
  • Technology
  • Uncategorized

Most Tagged

Adaptive Streaming Android android apps apache knox Applock aviate big data classloading Contacts+ hadoop HTML5 J2SE Java JavaScript JBoss Keycloak Keycloak-1.2.0-Final knox MPEG-DASH Pushbullet Raspberry Pi Raspberry Pi 5 RP5 security SSO Video Youtube

Categories

  • Other Stuff
  • Programming
  • Raspberry Pi
  • Technology
  • Uncategorized

No Rights Reserved. | Theme by ThemeinProgress | Proudly powered by WordPress