8

I'm aware that the only officially supported OS that the PoE hat works on is Raspbian. I can confirm that both my hats work, and that the fan does switch on and off if I have Raspbian installed on the SD card the Pi is booting from.

Currently, however, I'm dong a project and I'm using Ubuntu Server 18.04 64bit, which runs fine on the Pi, and the PoE hat powers the device with no problems. Unfortunately, as the OS isn't Raspbian, the fan never spins up, so it can run a little hot. As a result, if I can get the fan to spin up, and down then that would be great. I have no problems with doing this with scripts, using crontab and inspecting the value of /sys/class/thermal/thermal_zone0/temp, but I just don't know how to get the fan to spin.

I did initially try my simply editing config.txt, which is located in /boot/firmware on Ubuntu, and adding the below:

dtparam=poe_fan_temp0=65000,poe_fan_temp0_hyst=5000
dtparam=poe_fan_temp1=77000,poe_fan_temp1_hyst=2000

This has no effect though (but does have the desired effects on Raspbian).

I did, therefore, wonder if I could use the GPIO pins to start the fan up, and stop it, however, I honestly have no knowledge of GPIO. I assume it is controlled via this on Raspbian, but very little on ideas here, I'm afraid.

If anyone can point me in the right direction, or has some ideas to try that would be great. Any further questions on things I haven't covered, please do ask, and I'll be happy to elaborate to the best of my ability.

Edit: Looking at this post here, it appears that it's controlled via the I2C pins, so I've added the tag, in case anyone has found how to control it via that.

Edit 2: So it seems that the drivers for the fan were added in Ubuntu 19.04, as the answer below suggests, however, it doesn't control the fan, it just switches it on. Having the fan permanently on is actually even less desired as they create constant high levels of noise (despite being quite small the fans aren't quiet). I am looking for a solution that can spin the fans up and down. I did add the above parameters to /boot/firmware/config.txt again as well, but this has no effect. Even at 40C the fan was spinning at full speed (the settings state that full speed would be at 77C, down to 75C).

Larnu
  • 185
  • 1
  • 9

4 Answers4

9

I'm using Ubuntu Server 20.04 LTS. The dtparams setting does not work, instead you need a udev rule.

The fan config is in /sys/class/thermal/cooling_device0/, if you cat /sys/class/thermal/cooling_device0/type, it should be "rpi-poe-fan".

Once you've confirmed that, use this udev rule as an example:

SUBSYSTEM=="thermal"
KERNEL=="thermal_zone0"

If the temp hits 75c, turn on the fan. Turn it off again when it goes back down to 70.

ATTR{trip_point_3_temp}="75000" ATTR{trip_point_3_hyst}="5000"

If the temp hits 78c, higher RPM.

ATTR{trip_point_2_temp}="78000" ATTR{trip_point_2_hyst}="2000"

If the temp hits 80c, higher RPM.

ATTR{trip_point_1_temp}="80000" ATTR{trip_point_1_hyst}="2000"

If the temp hits 81c, highest RPM.

ATTR{trip_point_0_temp}="81000" ATTR{trip_point_0_hyst}="5000"

Place it in /etc/udev/rules.d/50-rpi-fan.rules. To apply udev rules, issue udevadm control --reload-rules && udevadm trigger

Luke Channings
  • 206
  • 2
  • 4
3

Using 21.04, if you add this line to /boot/firmware/config.txt it should work. It seems to work a little better after doing an apt upgrade and rebooting.

dtoverlay=rpi-poe
Derrick
  • 31
  • 1
2

I'm also using 20.04 on Raspberry Pi 4s. After googling around, there is a config.txt at /boot/firmware/config.txt and the following example worked for me in that file:

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
Larnu
  • 185
  • 1
  • 9
dsmith8
  • 21
  • 1
1

You can try Ubuntu Disco Dingo for Raspberry pi 3b+. You may download it from Ubuntu releasing site. http://cdimage.ubuntu.com/releases/19.04/release/ In the new firmware, the PoE Fan driver is merged in.