DietPi Fan control?

Hello, I have searched the interwebs for a bit and havent found a solution to having a switch and a fan running dietpi. I can turn off the GPIO pins(3v3 turns off) but then i wont be able to wake the device up from a button. Also currently dont have pwm control only turn on at set temps.

I was poking around and i saw that in the github under meta, there is a dietpi fan control file with what seems to be like a pwm control. Is this not enabled(i couldnt find it on my pis)? Is there an eta on this if not? Really like dietpi but feels like i should be able to use pwm pretty easily on an rpi4

Welcome to our community.

There is no eta for the fan control script as we don’t have resources to work on it currently.

Is there anything we as a community can do to provide those resources? Im glad it is on the radar though.

Everybody is invited to join us on GitHub and start working on this item if he/she is familiar with Bash coding :wink:

We are an exceedingly small project having a single developer only, doing all this on free/spare time. Volunteers are always welcome.

And I guess some donations are also always welcome. Please donate generously. A dollar a month will be great contribution for anyone who can afford. I have done my share few times and will do as and when I have some spare money. Thanks for pitching in.

3 Likes

The dietpi-fan_control script as it is now works/worked with the legacy-kernel Odroid C2. Sadly every SBC has it’s own fan sysfs API. Some logics seem to emerge with newer mainline kernel, but it requires still a complex auto-detection to get it working in a genetic way.

Investigating/testing the sysfs API for controlling the fan of an SBC you own would be a good start.

Another approach is testing apt install fancontrol. I’m not sure how reliable it works with SBCs, but if it does, it seems much better than re-inventing the wheel.

FWIW …

I have the HighPi Pro 5V Cooling Fan installed in a HighPi case that is acting as a media server
Initially installed with

echo ‘dtoverlay=gpio-fan,gpiopin=14,temp=60000’ >> /boot/config.txt

Rebooted & then

apt install lm-sensors fancontrol
pwmconfig
systemctl enable --now fancontrol

Gives me a nice cool Raspberry Pi 4B that doesn’t seem to get over 50° even when stress testing

2 Likes

This is working for me with the GeeekPi RPi4 Aluminum Heatsink (https://www.amazon.com/dp/B091L1XKL6?psc=1&ref=dmm_asc_ir_4061861_R-UW1B1UZxyNT-px3Dynxw2DUkFS4mw5uVk-280&irgwc=1)

with it connected to the same gpio pin as listed (the one i bought calls out gpio pin 14 as well). however i will note that I had to run the echo command after ssh’ing into the root of the device, and i had to remove the single quotes, i.e. mine was:
echo dtoverlay=gpio-fan,gpiopin=14,temp=60000 >> /boot/config.txt
and then it was working, i.e. the pwmconfig then picked up the fan sensor after reboot, where it was not before.

Thanks for the help!!

1 Like