DEPRECATED
Use pwm-fan device tree overlay.
https://github.com/alexander-kurichenko/devicetree-custom/tree/master/rpi4
To make it work, desolder controller pin and use Rpi PWM instead:
original image source: Argon40Tech/Argon-ONE-i2c-Codes#1
Installation:
-
Install i2c-tools package:
RaspberryPi OS / Debian / Ubuntu:
sudo apt install i2c-tools
Arch:
sudo pacman -S i2c-tools
Fedora:
sudo dnf install i2c-tools
-
Update /boot/config.txt:
# Enable i2c
dtparam=i2c_arm=on
# Argon One poweroff button (triggered by double-click)
dtoverlay=gpio-key,gpio=4,active_low=1,gpio_pull=down,keycode=116
Note for Ubuntu users: you can find this file in /boot/firmware
-
Copy these files to specified location in your system:
-
/usr/local/bin/fanctrl
Simple script to control fan speed depending on measured CPU temperature and options in /etc/default/fanctrl
-
/etc/default/fanctrl
Main configuration file
-
/etc/systemd/system/hw-shutdown.service
Sends poweroff command at shutdown
-
/etc/systemd/system/fanctrl.service
Starts /usr/local/bin/fanctrl.
-
-
Enable autostart:
systemctl enable fanctrl hw-shutdown
Manual control:
Usage: fanctrl [-D] [on|off] [0-4]
on/off - starts/stops fan (1st speed)
0/1/2/4 - set fan speed. More values were not implemented because of noisy fan
-D - this option is used to start it by systemd
NOTE: If fan was turned off or set to lower speed manually, it will be automatically started when temperature exceeds configured values