Adding fan control buttons to the system page on a Pi5 with a GPIO controlled fan #4908
Replies: 3 comments 4 replies
-
|
I did something similar a while ago. Starting/stopping the fan from a button as well as automatically based on the temperature. |
Beta Was this translation helpful? Give feedback.
-
|
Nice, thanks for documenting that. I m not sure if you are aware but there is a module that can control. fan based upon temperature. In the next release this cN LSO BE PWM Controlled |
Beta Was this translation helpful? Give feedback.
-
|
@chvvkumar, |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Wanted to document my steps to get system page buttons working to control a 12v GPIO Fan connected through a relay which is on GPIO21. Not sure if this is the right way but this is how I got it working using
pinctrl.Prerequisites
Allsky camera software installed
Raspberry Pi 5 with GPIO fan connected to pin 21
Root/sudo access to the Pi
Directory Structure
File Contents
Initial Status Data File (/home/pi/fan_control/fan_status.txt)
data 0 Fan Status <span style='color: orange;'>Unknown</span>Button Configuration File (/home/pi/fan_control/fan_buttons.txt)
Setup Commands
Add www-data to GPIO Group
sudo usermod -a -G gpio www-dataConfigure Sudo Permissions
sudo visudo -f /etc/sudoers.d/fan_controlAdd these lines to the file:
Fix Sudo File Permissions
sudo chmod 440 /etc/sudoers.d/fan_controlConfigure Allsky System Page Additions
In the Allsky WebUI, go to
Allsky SettingsSet System Page Additions setting to:
/home/pi/fan_control/fan_status.txt:/home/pi/fan_control/fan_buttons.txtAutomatic Status Monitoring script Setup
chmod +x /home/pi/fan_control/cron_status_update.sh(crontab -l 2>/dev/null; echo "* * * * * /home/pi/fan_control/cron_status_update.sh") | crontab -crontab -lTesting
Command Line Testing
GPIO Testing
Troubleshooting
Verify Sudo Configuration, All files should show "parsed OK"
udo visudo -cCheck Group Membership
Debug GPIO Access
Check File Permissions
Beta Was this translation helpful? Give feedback.
All reactions