Taking control of the Pi PoE HAT's overly-aggressive fan

I am starting to rack up more Pis (quite literally) using the official Pi PoE HAT to save on cabling.

The one thing I hate most about those little HATs is the fact the fans spin up around 40°C, and then turn off a few seconds later, once the temperature is back down to 39 or so, all day long.

I'd be happy to let my Pis idle around 50-60°C, and only have the little whiny fans come on beyond those temperatures. Even under moderate load, the Pi rarely goes above 55°C in my basement, where there's adequate natural convection, so the fans would only really be necessary under heavy load.

As it turns out, there are some device tree overlays you can configure in the Pi's /boot/config.txt to control the speeds and temperatures when the fan runs on the PoE HAT, and I liked the defaults user Nooblet-69 suggested on GitHub:

# PoE Hat Fan Speeds
dtparam=poe_fan_temp0=50000
dtparam=poe_fan_temp1=60000
dtparam=poe_fan_temp2=70000
dtparam=poe_fan_temp3=80000

Toss those lines in the bottom of the boot config file, reboot the Pi, and it should start picking up the new temperature settings.

Ahh, blissful silence. Well, at least mostly. My rack-mount UPS's fan needs a good cleaning.

Edit: It looks like the PoE+ HAT is controlled the same way. For the gory technical details, see the rpi-poe-fan.c file.

Comments

I'll be checking into this asap. I've been experimenting with the dtparam stuff, but still not satisfied.

The only Pi that I run an ethernet hat on is my TOR router for my super secret communications about creating a death ray designed to target vehicles that don't correctly use their turn signals… ;-)

This. All this.
For the Pi laptop I'm building right now, I am going to make a custom fan governor that turns on at, say, 48 degrees, then turns off again at 40. This way, if the fans are going off, that will mean that I have some time before they turn on again, but they might also just stay off. Coupled with an update resolution of 20-30 seconds or so, this will keep me from having constant on/off cycles.

Hi, thanks for your post. You say that you like the defaults suggested on GitHub, however the values don't match up.

Any idea how to get the PoE+ HAT to work in non-raspbian distro's? I've been bashing my head against the wall trying to run k3os.io and after finally getting it running on the raspi4 I noticed that no fans ever run. So far I've added the following to config.txt:
dtoverlay=pwm
dtoverlay=gpio-fan
dtoverlay=rpi-poe
dtparam=poe_fan_temp0=80000,poe_fan_temp0_hyst=2000
dtparam=poe_fan_temp1=78000,poe_fan_temp1_hyst=5000
dtparam=poe_fan_temp2=73000,poe_fan_temp2_hyst=3000
dtparam=poe_fan_temp3=70000,poe_fan_temp3_hyst=5000

If you are using a linux distribution other than Raspian OS, there is a POE Fan kernel module now available starting with linux kernel 5.13. Configuration is still a bit awkward as a standard companion overlay for the firmware device tree is not yet available. My notes on how I got the fan working on fedora 34 for my K82 raspberry pi cluster are at https://raspberrypi.stackexchange.com/questions/118863/how-can-i-enable…. The kernel module is only for Raspberry Pi 4 (and possibly related models).

Just setting up my cluster with PoE+ hat and what a relief to have silence again! Thanks Jeff.

Heh, just yesterday I noticed a weird buzzing sound in my basement... realized after I re-flashed on of my racked Pis, I forgot to add in the fan settings, so it was almost constantly spinning up and down. I set the low threshold to 50°C and now it barely ever kicks in the fan :)

For what it's worth (/ for anyone else coming by in the future), if this doesn't influence the speed of your fans (PoE or PoE+) then check dmesg for an error message mentioning PWM value. I had to replace two PoE+ hats because the fan would just run at full speed without any way to control.

Reference: https://github.com/raspberrypi/firmware/issues/1531

(PS - I ended up buying a USB -> 2x120mm fan set on Amazon, works great for keeping a bramble of four Pis cool when idle / low usage. Also _much_ quieter!)

Hi Jeff.

Thanks! This did the job for me and the PoE+ HAT. Will this work on Ubuntu and other distributions?

/Kristian

I'm happy to report that this works if you're running Ubuntu on your Pis as well (at least 20.04.3 or later, can't vouch for earlier versions). Ubuntu puts user modifications for config.txt into a separate /boot/firmware/usercfg.txt file.

Thank you for this brief guide, my Pi4's with PoE+ hats were driving me crazy before applying this change!

Thanks a ton for this, I could not believe the racket after I installed the PoE hat in my Pi4. Blissful silence after I added those lines...hope it stays that way!

This worked beautifully on my Raspberry Pi 4 & Raspberry Pi PoE+ HAT. Saved my sanity from the constant high-pitched whirring of the fan.

This really improves the fan noise, but overall - what's your experience with power consumptio with and without POE+ HAT - my switch report 6+ Watts with POE+, this is way above 3W normal RPi4B should use.

My PoE+ switch reports between 4-7W on the Pi 4's. Typically 5-6W, so that seems normal. There's definitely some overhead loss on the PoE+ HAT itself.

Any ideas on where to configure this setting for a Pi running HomeAssistant?

Never mind. Figured it out. Needed to pull the drive/card and plug into another PC and edit the file. Now all is blissfully quiet. CPU does run 3 degrees (F) hotter at idle but seeing it run between 124-128.

When using a RPi POE Plus model on a fresh updated install of Ubuntu 22.04LTS and of PiOS (Debian 11);

sudo cat /sys/class/thermal/cooling_device0/type reports back pwm-fan , not rpi-poe or rpi-poe-plus.

How does this change the dtparam approach?

Thanks - great relief. Glad I found this info here.

Every once in a while, you search for something and get the exact thing you're looking for with easy to follow steps. This worked like a dream and my rack is so much quieter now (and it also opens up for more Pis!). Thanks for all the ideas and work Jeff! Raspberry Pi's are so much more fun because of your support.

Hi Jeff, I love everything you do, and the great help you give to the community. I tell you. I am in a project where I want to install ROS2 on a CM4, from here we get that in order to install ROS2 on a CM4/RPI, we have to install Ubuntu Server 22.04 (64 bits), everything is fine here, and everything is installed and works so far Well, and I have the problem of how to manage the fan installed in the i2c port, which I have not seen the formula to be able to control and see through the i2c port, it seems that it does not recognize the EMC2301 module. Could you help me and give a little of your magical light. Is there a way for Ubuntu server to see the i2c fan hardware?

Thanks in advance and a smile

thanks
this might stop the buzzing in the loft from my adsb and lorawan stuff hopefully

Thanks Jeff! I've endured two nights with PoE+ Hats on default settings. Now I can sleep peacefully again.