I didn't find a good script for my needs for speed controling the fan of my odroid. So I wrote my own.
Between 40-50°C the fan will be at low speed, otherwise will be auto controlled. Delay is 10 seconds.
This script give another curve than which is possible with just the auto mode.
Perhaps it's usefull for somebody else

PS: I'm still improving it, so it may change

Code: Select all
#!/bin/bash
last=0
var=100000
#set auto start_temp to 50
echo 50 > /sys/devices/platform/odroidu2-fan/start_temp
while true; do
sleep 10
var=$(< /sys/devices/virtual/thermal/thermal_zone0/temp)
echo $var
echo $last
if [ $var -lt 50000 ] && [ $var -gt 40000 ];then
if [ $last -eq 1 ] || ( [ $last -eq 2 ] && [ $var -le 42000 ] );then
continue
fi
last=1
echo manual > /sys/devices/platform/odroidu2-fan/fan_mode
echo 100 > /sys/devices/platform/odroidu2-fan/pwm_duty
sleep 1
echo 34 > /sys/devices/platform/odroidu2-fan/pwm_duty
echo "low speed"
else
if [ $last -eq 2 ];then
continue
fi
last=2
echo auto > /sys/devices/platform/odroidu2-fan/fan_mode
echo "auto"
fi
done