-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Make the RPI POE Hat Fan user-controllable and adjustable #2715
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
For now I have unplugged the fan and of course I destroyed one of the connectors. Can someone also please let me know the exact name of the connector so I can order a replacement connector with cables so I can easily solder it back on? |
If you don't need the fan, you can turn it off by putting Device tree can be a bit tricky, so some of the options have been made adjustable through config.txt. That feature hasn't made it into the pre-built kernel yet. Some links which could be useful: |
Hi there, I've tried setting
in Is there another way to set the fan thresholds? This is on an RPi4 with the POE hat, using 4.19.56-v7l+. EDIT:
|
Also, I'm a little confused by the default settings:
The dtb file shows these reversed (that is, trip point 0 should be 50k, trip point 1 55k). I'm also seeing this switch when I edit the dtb to increase the temps directly. Is this expected? |
I've tried it on my RPi4 with the official PoE HAT as well, and I indeed see the same behavior:
(I guess the temp was 50°C, but just went down to 48°C when executing the command) The fan seems still to turn on at 50 °C, even the fact I've overritten it to 60 °C. In my environment the fan always turns on for a few seconds every few minutes, as it always comes across the trip0 temperature limit for a relatively short time. So increasing the trip0 should basically solve that for me - but unfortunately does not seem to work as expected. |
I managed to work around this by decompiling the overlay with
editing the
and then moving the |
@XECDesign Any thoughts? |
I can take a look in the morning. |
It looks like there might be two issues here - the overlay parameters and the trip point ordering.
To make the documentation correct and to avoid future confusion, I've added real parameters to the overlay.
(*) It is possible to pass parameters to a HAT overlay - the overlay is "in scope" until the next |
@pelwell - thanks for the response. I take that back. I forgot to comment out the |
I believe the order of the trip points is irrelevant - their content and that of the cooling maps defines the implicit ordering. If you (or anyone else) feels the cooling isn't working as it should then please correct me. |
@pelwell - thanks so much for your help here. I've run using the Man, those PoE fans are loud :) |
Closing, as I think the issues raised have been addressed. |
kernel: i2c: bcm2835: Set clock-stretch timeout to 35ms See: raspberrypi/linux#3064 kernel: xhci: add quirk for host controllers that don't update endpoint DCS See: raspberrypi/linux#3060 kernel: tty: amba-pl011: Make TX optimisation conditional See: #1017 kernel: overlays: Add real parameters to the rpi-poe overlay kernel: overlays: Correct gpio-fan gpio flags for 4.19 See: raspberrypi/linux#2715 kernel: overlays: i2c-gpio: Fix the bus parameter See: raspberrypi/linux#3062 kernel: overlays: Rename pi3- overlays to be less model-specific See: raspberrypi/linux#3052 firmware: dispmanx: Fix handling of disable_overscan to not disable it totally See: raspberrypi/linux#3059 firmware: power: Enable/disable H264 and ISP clocks with domain firmware: arm_loader: arm_64bit=0 should disable loading of kernel8.img firmware: dt-blob: CM has no activity LED
kernel: i2c: bcm2835: Set clock-stretch timeout to 35ms See: raspberrypi/linux#3064 kernel: xhci: add quirk for host controllers that don't update endpoint DCS See: raspberrypi/linux#3060 kernel: tty: amba-pl011: Make TX optimisation conditional See: raspberrypi/firmware#1017 kernel: overlays: Add real parameters to the rpi-poe overlay kernel: overlays: Correct gpio-fan gpio flags for 4.19 See: raspberrypi/linux#2715 kernel: overlays: i2c-gpio: Fix the bus parameter See: raspberrypi/linux#3062 kernel: overlays: Rename pi3- overlays to be less model-specific See: raspberrypi/linux#3052 firmware: dispmanx: Fix handling of disable_overscan to not disable it totally See: raspberrypi/linux#3059 firmware: power: Enable/disable H264 and ISP clocks with domain firmware: arm_loader: arm_64bit=0 should disable loading of kernel8.img firmware: dt-blob: CM has no activity LED
I placed
but the fan is running at much lower temperatures. Is there a more complete documentation for how this is done from start to end somewhere? |
How are you measuring the temperature? |
With
Also, I hear the fan running when the RPi4 is pretty much idle (i.e. has 0 load average). |
@pelwell Just an FYI the line @kjetilk My output with Summary of my now-fixed situation: using my Pi with a PoE hat to run my UniFi Controller and Pi-hole. Average idle temps were around 49.4 °C and constantly creeping over the default 50 °C threshold causing the fan to trigger constantly. After updating the threshold to 60 °C with Device Tree overlays with the dtparams above, I'm sitting at about 54.8 °C at idle with no case and I'm no longer needing to listen to the fan loudly spin while trying to sleep. 🙂 Since this basically sits between at 55 °C on idle with no case, would it make sense to increase the default threshold to 60 °C instead of 50 °C? That's still under 70 °C limit for the board. Maybe get some more life out of the fan this way too if it's not constantly spinning up. |
Well spotted - I've corrected the example. |
Thanks, but I did in fact correct it when I entered into the boot config. :-) Just didn't think about it when I did a cutnpaste here. So that has been correct all along. Is there anything else I need to do with the overlays, or something? FWIW, my current device tree says:
|
Hey, I don't know if anyone cares at this point, but I was previously controlling the fan speed with:
This seems to be enough pwm for the fan to start (at lower levels it would sometimes stall) but is low enough that you really cannot hear it. The small amount of airflow with the pwm set to 50 is enough extra cooling to stop my Pi from spinning the fan up once a minute even when it's idle. The latest firmware (probably not very recent, this particular Pi hasn't rebooted since September I think) seems to have removed this option for speed control (grr), but inspired by @sbromberger and @kjetilk I tried updating my rpi-poe.dtbo to change the "level 1" fanspeed from 150 (0x96) to 50 (0x32). It appears to work great! (based on approx 5 mins of evidence, YMMV, don't blame me).
I guess a better alternative might be to instead set the fanspeed for "level 0" to 0x32, then the cooling will still kick in at the appropriate levels, it'll just never switch off completely. I've not looked to see if there's a kernel command-line option to set the 'cooling levels' values: that might be a simpler way to tinker with these parameters. |
I've been trying to work this out. Based just on looking at images online it looks a lot like a 2-pin molex picoblade, as used here, and if it weren't for COVID-19 I'd swing by my local electronics supply to try one out. I'd like a spare connector as I've experimented with using a larger and slower fan for silent operation (and it works like a dream) but to do that connector-wise I've just been impaling the wire ends on the pins and that's not a good permanent arrangement. Edit: changed connector identification |
Can we consider re-opening this this bug/issue? I would prefer more granularity in the ability to control the fan, specifically... Possible solutions to the above Thoughts? |
It sounds like you haven't noticed that the rpi-poe overlay was updated at the end of March, adding two new temperature thresholds and fan speeds:
|
@pelwell Hey hey, that's pretty good didn't know that. I'll have to check if this works and/or update my overlay so it can. Still sorely missing the ability to set the fan speed though. Thanks! |
The ability to set the fan speed per threshold has been present all along; the Feb 19 comment above from @bennetts2 explains it in detail. Even without updating to the new overlay, I've been getting results on a Pi 4 that suit my pretty ordinary use case very well, simply by setting
and
This causes the fan to come on very quietly indeed at 57°, and cool it below 50° in less than 20 seconds even under the highest CPU load in my use case, around 200%. If for some reason the temperature were to continue to climb, the fan will increase to full at 67°, still well short of throttling speed. I don't expect that to happen in the real world but it's reassuring to have it there as a backstop. Under a more typical CPU load range of 10%-80% the temperature stabilizes passively around ~50° and the fan never needs to come on at all. My reading around the web suggests this is fairly typical, so I'm not overly thrilled with the new defaults in the 25 Mar commit . This has it start spinning -- albeit fairly quietly -- at 40° which suggests to me it'd be coming on more frequently than necessary under conditions that I'd guess are pretty common. |
I'm sorry if I feel that decompiling an overlay and recompiling it with edits isn't my idea of fun. :P The "howto" modify the |
You never need to decompile any of our overlays - the source is in the kernel tree: https://github.com/raspberrypi/linux/blob/rpi-5.4.y/arch/arm/boot/dts/overlays/rpi-poe-overlay.dts You really can't mess up the overlay enough to prevent a Pi from booting - it would take knowledge and intent. If somebody really wants to submit a PR adding parameters (with README documentation) to control the fan speeds then I will consider merging it, but I won't be adding them myself. |
Don't know if I need to open a new ticket or continue this one, but I have a problem when setting temperature threshold for the fan: the
|
Are you saying that the other values change correctly, just not the trip3 temperature? Can I see the contents of your config.txt? You can leave out anything which is obviously unrelated. |
Sorry, false alert. After more investigation, it seems to be a problem of line length. The following definitions are working for temperatures 0 to 2, but not for temperature 3:
or:
But if I split the parameters into multiple lines, it works correctly:
|
I'm seeing this also. If the dtparams are set on the same line as dtoverlay, the temp3 setting is ignored and stays at the default 55000. Setting them one per line works as expected. Can confirm by checking /sys/class/thermal/thermal_zone0/trip_point_* (note that sequencing is reversed). Not sure if this is an issue specific to the fan overlay or a general issue with long lines for overlay params? Maybe a new issue should be created? |
There is a line length limit for config.txt - it used to be 80 but (from what I remember) it's more like 100 now. Splitting the parameters onto separate lines avoids hitting this limit, but otherwise it makes no difference. |
Just a quick note for the people like me that are a little slow. If you dont overwrite the default limit for all 4 thresholds it will used the default. I didn't want the fan to kick in until 60C and set temp0 and temp1 correctly. however because temp2 was set at 50C the fan was running anyway. make sure you overwrite all for levels. |
Hi, I´m running Rasbian 10 (buster) on a Raspberry Pi 4, Model B, Is there a guide how to set the fan speeds for this model in 2021? Works great, but the fan on the PoE-hat starts spinning loud all time. Help? Best regards |
Does this (4 comments back in the thread) not work?:
|
Probably. But since I'm n00b, I'd appreciate a guide on exactly how to do it. I appreciate your answer. I'll read more about how to do it. Best regards |
|
Thank you for taking the time to make a guide, I followed it and it worked just as it should. I am very grateful! :) |
@pelwell has the latest kernel upgrade or boot loader introduced a problem with the poe hat fan? I updated my RasPi 4 today and the fan no longer seems to be operating. Details of the update (32bit Buster Raspi OS) were: Get:1 http://archive.raspberrypi.org/debian buster/main armhf libraspberrypi-doc armhf 1.20210201-1 [31.4 MB] Since updating - and after a number of reboots (including toggling the power by removing the ethernet cable after shutdown), the temperature is no longer being controlled by the poe-hat fan. The RasPi is remote, so I can't actually listen to see if the fan is operating). The processor load has not changed as these graphs show - update just before 8:00am local time. Local temperatures have not varied significantly over the 48 hours: Is there a command to read the current fan state? |
That problem was reported in raspberrypi/firmware#1531. |
Thanks for the workaround referenced in raspberrypi/firmware#1531 Graphic evidence of its effectiveness: |
@JRG1956 what utility are you using to get graphical representations of CPU/Mem/GPU utilization and max core temp? |
@felker the charts are part of wiedehopf's graphs1090 package https://github.com/wiedehopf/graphs1090 I mainly use my Pi as an ADSB receiver for aircraft tracking, and graphs1090 reports statistics related to that - the Pi performance charts are one of the things it produces. It is a great package, but unfortunately not a general purpose utility. |
Bit of a late reply here, but because the edits needed in rpi-poe.dtbo to change the cooling-levels are so minor, if you don't want to recompile, you can simply hex edit the file. Overall though, I agree with @AndrewFarley that having these fan levels in a dtparam would be quite nice. I do not find the default levels for the POE+ hat to be very useful (level 1 is almost never active because it does not provide enough cooling, the fan simply toggles between levels 2 and 3), so I increased them a bit in my setup. However, doing this is a bit tiresome as my Pi case does not allow SD card access, and the OS I am running (Home Assistant OS) could overwrite my edits on updates, necessitating me to repeat this process. Changing config.txt is a lot quicker 🙂 |
I am controlling my kids gecko/hamster cams with a RPI and got POE hats for these PIs. All was great when the fan was still not controlled, e.g. turned off at all times. Now, with the october raspbian update the fan was on all time as it seems the temp it turns on is 45 and that pretty much the case at all times.
As I was running the PEO hats for several weeks with the fan completely off and my cpu temp is just a little above the 45 degrees, it seems fair to at least adjust the fan temps to some degree. I would hope that raspi-config would allow me to turn the fan-control on/off completely and for on I would love to see different levels (aggressive fan, less aggressive).
I really think this needs fixing as many will have RPIs with POE hats around during night time and especially for all private users at home (potentially with kids) the subtle humming / cracking of the fan can be very disturbing.
The text was updated successfully, but these errors were encountered: