====== Cooling Fan ======
===== Introduction =====
This page mainly introduces [[https://www.khadas.com/product-page/3705-cooling-fan | Cooling Fan]]. The first half describes how to control the Cooling Fan on Ubuntu, and the second half describes how to control the Cooling Fan on Android.
===== Ubuntu =====
This setting is only applicable to 4.9, 5.4, and 5.15 linux kernel
==== Fan Application ====
The following method is recommended if you are using desktop OS. Find ''Fan Setting'' from the applications list. Open the app to control the cooling fan speed.
{{/products/sbc/common/accessories/gnome_application_fan.png|gnome_application_fan}}
==== Command Line ====
You can also use command to control the FAN from terminal.
=== Set the fan mode ===
^ fan mode ^ command ^
| off | ''fan.sh off'' |
| on | ''fan.sh on'' |
| auto | ''fan.sh auto'' |
=== Get the fan mode ===
```shell
fan.sh mode
```
=== Set the fan speed ===
^ fan speed ^ command ^
| high | ''fan.sh high'' |
| mid | ''fan.sh mid'' |
| low | ''fan.sh low'' |
=== Get CPU temperature ===
```shell
fan.sh temp
```
=== Get and Set the trigger temperature ===
You can get the trigger temperature from the nodes below:
^ fan mode ^ trigger temp parameter ^
| low | ''/sys/class/fan/trigger_temp_low'' |
| mid | ''/sys/class/fan/trigger_temp_mid'' |
| high | ''/sys/class/fan/trigger_temp_high'' |
e.g. Get the low trigger temperature:
```shell
cat /sys/class/fan/trigger_temp_low
```
e.g. Set the low trigger temperature to ''40'' Celsius.
```shell
echo 40 | sudo tee /sys/class/fan/trigger_temp_low
```
The trigger temperature only effect the fan works in auto mode.
=== Mainline linux ===
Fan is controlled automatically by linux, and unit will be in millicelcius
eg. get the auto trigger temp with
```
cat /sys/class/thermal/thermal_zone0/trip_point_3_temp
```
eg. set the auto trigger temp to 40000 millicelcius
```
echo 40000 | sudo tee /sys/class/thermal/thermal_zone0/trip_point_3_temp
```
To turn off the fan, set trigger temp to higher amount such as 80000, \\
To turn on the fan, set the trigger temp to lower amount such as 10000.
===== Android =====
Check system settings to control the fan.