Score:2

Ubuntu 21.04 Failed to apply overlay '0_rpi-poe' (kernel)

sj flag

I have Ubuntu 21.04 installed on a Raspberry Pi 4. I want to control the fan on the POE+ HAT (https://www.raspberrypi.org/products/poe-plus-hat/)

By default the fan does not spin at all. When I add dtoverlay=rpi-poe to /boot/firmware/config.txt the fan works in a seemingly default mode. But when I do sudo dtoverlay -l there are no overlays loaded so I don't know why it makes a difference.

Custom settings like these do not work as expected. When I add these the fan stops completely or falls back to default mode.

dtparam=poe_fan_temp0=50000
dtparam=poe_fan_temp1=58000
dtparam=poe_fan_temp2=64000
dtparam=poe_fan_temp3=68000

When I try to load the overlay rpi-poe I get the response * Failed to apply overlay '0_rpi-poe' (kernel) which maybe means it's not available in this kernel? GNU/Linux 5.11.0-1012-raspi aarch64

Carles Mateo avatar
cn flag
What model do you have? https://uk.pi-supply.com/products/pi-poe-switch-hat-power-over-ethernet-for-raspberry-pi ? https://www.raspberrypi.org/products/poe-hat/ ?
Thijs avatar
sj flag
https://www.raspberrypi.org/products/poe-plus-hat/ the POE+ hat
Score:1
cn flag
oot

On Ubuntu 21.04 builds for the Pi 4 with the PoE+ hat there is one slight difference that you're missing which is causing this issue. The firmware driver and associated device tree overlay is named rpi-poe-plus, not rpi-poe (this is for the older PoE hat).

You can find this out by seeing the available device tree overlays with the following command and noting that there are two listed.

ls /boot/firmware/overlays | grep poe

Add the following to the /boot/firmware/config.txt file to get the fan working with the PoE+ hat.

dtoverlay=rpi-poe-plus
dtparam=poe_fan_temp0=80000,poe_fan_temp0_hyst=2000
dtparam=poe_fan_temp1=70000,poe_fan_temp1_hyst=5000
dtparam=poe_fan_temp2=65000,poe_fan_temp2_hyst=3000
dtparam=poe_fan_temp3=60000,poe_fan_temp3_hyst=5000

You can adjust the poe_fan_temp values to what you like so as to ramp the fan at different temperature values of the CPU. The values are degrees C x 1000.

Thijs avatar
sj flag
awesome, thank you! also explained well. you may have forgotten the "=" after dtoverlay in the code example.
oot avatar
cn flag
oot
Good catch! @Thijs
Score:0
us flag

ubuntu 21.04. You don't need to do anything. I just added a POE-plus to an RASPI4/8g and the fan adheres to the default settings as shown by Carlos (thanks Carlos) above.
The current version 21.04 has all you need. Verify with:

Enter the following command:

od -An --endian=big -td4 /proc/device-tree/thermal-zones/cpu-thermal/trips/trip?/temperature /proc/device-tree/thermal-zones/cpu-thermal/trips/trip?/hysteresis

you should get:

   40000       45000       50000       55000
    2000        2000        2000        5000
Score:0
cn flag

After being frustrated by the lack of documentation, I found this github project that seems to nail it:

https://github.com/raspberrypi/linux/issues/2715#issuecomment-769405042

rpi-poe was updated in March 2020 adding:

Name:   rpi-poe
Info:   Raspberry Pi PoE HAT fan
Load:   dtoverlay=rpi-poe,<param>[=<val>]
Params: poe_fan_temp0           Temperature (in millicelcius) at which the fan
                                turns on (default 40000)
        poe_fan_temp0_hyst      Temperature delta (in millicelcius) at which
                                the fan turns off (default 2000)
        poe_fan_temp1           Temperature (in millicelcius) at which the fan
                                speeds up (default 45000)
        poe_fan_temp1_hyst      Temperature delta (in millicelcius) at which
                                the fan slows down (default 2000)
        poe_fan_temp2           Temperature (in millicelcius) at which the fan
                                speeds up (default 50000)
        poe_fan_temp2_hyst      Temperature delta (in millicelcius) at which
                                the fan slows down (default 2000)
        poe_fan_temp3           Temperature (in millicelcius) at which the fan
                                speeds up (default 55000)
        poe_fan_temp3_hyst      Temperature delta (in millicelcius) at which
                                the fan slows down (default 5000)

Config suggested:

# PoE Hat Fan Speeds
dtoverlay=rpi-poe   
dtparam=poe_fan_temp0=65000   
dtparam=poe_fan_temp0_hyst=1000   
dtparam=poe_fan_temp1=70000
dtparam=poe_fan_temp1_hyst=2500
dtparam=poe_fan_temp2=80000
dtparam=poe_fan_temp2_hyst=5000
dtparam=poe_fan_temp3=90000
dtparam=poe_fan_temp3_hyst=5000

Check if in dmesg you have an error like, then you're hitting a problem with a firmware update:

[...] rpi-poe-fan rpi-poe-fan@0: Failed to get default PWM value: -5
[...] rpi-poe-fan: probe of rpi-poe-fan@0 failed with error -5

Explanations on how to use a previous firmware in here: https://github.com/raspberrypi/firmware/issues/1531

After you change config.txt and reboot, check that values are Ok with:

od -An --endian=big -td4 /proc/device-tree/thermal-zones/cpu-thermal/trips/trip?/temperature /proc/device-tree/thermal-zones/cpu-thermal/trips/trip?/hysteresis

You should get:

65000 70000 80000 90000
1000 2500 5000 5000

Cheers

Thijs avatar
sj flag
There are 57 comments in the link to issue 1531 so I'm not sure what you refer to but I don't have the dmesg message with rpi-poe so I think it's not a firmware issue then if I understand correctly
Carles Mateo avatar
cn flag
Did the config suggested work?
Thijs avatar
sj flag
no the cooler does not do anything anymore, less than using the defaults
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.