This is a simple script and service setup that allows your Debian OS can monitor the temperature of the SoC regularly and then control it to be high or low speed automatically through the GPIO.
If you can use ADB to access Tinker, you can use the batch command file fancontrol-gpio_ADB-INSTALL.cmd
to push file in Debian & enable it.
Or you can follow or refernce following commands to install them to your Debian OS.
cp fancontrol-gpio.sh /usr/bin/fancontrol-gpio
sudo chmod 755 /usr/bin/fancontrol-gpio
cp fancontrol-gpio.service /lib/systemd/system/fancontrol-gpio.service
sudo chmod 644 /lib/systemd/system/fancontrol-gpio.service
sudo systemctl enable fancontrol-gpio.service
sudo systemctl start fancontrol-gpio.service
KEY | Value (default) | Description |
---|---|---|
SLEEP_INTERVAL | 1 | check temperature for GPIO control every n seconds. If you don't need that instantly, you can increase the interval time. |
FAN_GPIO | 154 | set GPIO you need. e.g. Tinker Board 2 is 154 , Tinker Edge R is 158 |
DEBUG_LOG | false | print more logs for debug |
TEMP_TRIGGER | 45000 | the trigger point (in degrees C * 1000) when turn GPIO high |
TEMP_BUFFER | 2500 | the buffer range, let GPIO not change too frequently (if the temperature is just right around the trigger point). e.g. when or higher than 45 degrees, the GPIO is triggered high , but only when it is below 42.5 (45-2.5) degrees, it will turn the GPIO to low . |