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:
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).