Add PWM fan control to dietpi-config - #8269
Conversation
I dont have a PWN fan or an rpi 5 so i cant test any of these. maybe someone with more knowledge can work on these features |
Are you sure that this is not a PWM(-capable) fan? The See the description here: https://github.com/herbingk/pwm-gpio-fan Hence, try to use |
This is the fan I have: https://www.pishop.us/product/highpi-pro-5v-cooling-fan/ I don't know if these support PWM, could you tell me? And if we use PWM, is it backwards compatible with non-PWM fans? Or should we prompt the user to pick one? EDIT: It looks like my fan does support PWM. Overall this seems like a good default replacement, but we should still ask the user if they want to enable it.
EDIT 2: Should we include config options for fan_temp[1-3]? This would complicate the fan config a lot. |
|
Great, and yes, this seems to be quite a successor. I'd hence implement this one only for now. If users report that it does not work well with a particular 3 pins fan, we can still add the simple on/off overlay as alternative.
Consequently, this makes sense. For most, the defaults will be fine, though. For completeness, here is the script I started years ago to configure PWM fan trip points and speeds via sysfs API: https://github.com/MichaIng/DietPi/blob/dev/.meta/dietpi-fan_control |
I'm looking at the defaults for temp/speed in pwm-fan-overlay and they seem very reasonable. For now I don't want to over complicate it so Im leaving it as default. Please give me feedback on clarifying the config prompts though since I suck at UX. |
|
I have the config done now. But I tested it (just putting it into config.txt manually) and it starts out quite noisy and gets quieter as the PWM speed goes up (louder at lower speed). ChatGPT says this is because it is using software PWM which outputs 50Hz and hardware PWM outputs 25kHz, and 25kHz is required for it to be inaudible. Is there an easy way for DietPi to implement hardware PWM on GPIO 18 (the caveat is bad audio quality, but most people don't need audio for a headless setup)? |
|
this pr now depends on the merging of raspberrypi/linux#7594 |
|
What is the difference between EDIT: Ah got it, it uses a hardware PWM. It should be configurable here, IMO. Some people do use audio. Good is that parameters are the same. |
Adds GPIO fan control from raspi-config.
Will close #4003
raspi-config link: https://github.com/RPi-Distro/raspi-config/blob/master/raspi-config#L1308
I named the config option "GPIO fan control" because I don't think this affects the Active Cooler on rpi 5. but i dont have an rpi5 to test with.
Dependencies: