[HOWTO] Control automatic fan settings on XU3/XU4

Moderators: meveric, mdrjr, odroid

Re: [HOWTO] Control automatic fan settings on XU3/XU4

Unread postby rupy » Mon Jun 12, 2017 10:23 pm

Ok, that does not work, as I have outlined before. The fan goes crazy if I lower the tip point... it does not stay inside the speeds defined by:

echo "25 25 25 25" > /sys/devices/platform/pwm-fan:/hwmon/hwmon0/fan_speed

I tried:

echo "250 250 250 250" > /sys/devices/platform/pwm-fan\:/hwmon/hwmon0/fan_speed

and the speed of the fan is the same... that file does nothing is it the right file?!

ok, if I try to set the last 3 values the file resets to the original values?! This is so much voodoo magic... I just need the fan to always spin slowly no matter the temperatures...
rupy
 
Posts: 47
Joined: Fri Mar 04, 2016 7:38 am
languages_spoken: english

Re: [HOWTO] Control automatic fan settings on XU3/XU4

Unread postby rupy » Mon Jun 12, 2017 11:39 pm

echo "25 26 27 28" > /sys/devices/platform/pwm-fan:/hwmon/hwmon0/fan_speed

might fix it... the numbers need to increase apparently...
rupy
 
Posts: 47
Joined: Fri Mar 04, 2016 7:38 am
languages_spoken: english

Re: [HOWTO] Control automatic fan settings on XU3/XU4

Unread postby moon.linux » Tue Jun 13, 2017 1:03 am

If you have using the 3.10.x kernel we need to calculate the percentage of PWD values with the ratio of temperature and duty_cycle.
Please find the link below for more details.

viewtopic.php?f=52&t=16308#p191812
moon.linux
 
Posts: 935
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english

Re: [HOWTO] Control automatic fan settings on XU3/XU4

Unread postby rupy » Tue Jun 13, 2017 4:56 am

No I couldn't find a .img that worked so I'm back to the latest but the fix above works... the code that should control the fan is completely bonkers and thinks the CPU is at many temperatures during a very short time, I wonder where can you read the temp in the latest?
rupy
 
Posts: 47
Joined: Fri Mar 04, 2016 7:38 am
languages_spoken: english

Re: [HOWTO] Control automatic fan settings on XU3/XU4

Unread postby jeffa » Thu Jun 22, 2017 1:05 am

Has there been any progress on determining how to control the fan and speed on 4.9 kernel? I installed a nice quiet fan so now I would like to have the fan run more often and keep the CPU/GPU temp down. I don't care if it runs at high speed. I'd like to stay on the 4.9 kernel as it seems to be more efficient and have better drivers for my devices. I'm using the XU4 as a desktop replacement for my Windows machine. I'm fairly literate on Linux/UNIX but I won't be insulted if you pretend I'm a noob and spell out the details. "You want to fan run silently then we need to lower the tip point so that the PWM signal is generated at low temperature." is too high level for me, I need more details - what files to edit etc. I've tried some of the things listed above and like others the fan seems to run however it wants.
jeffa
 
Posts: 3
Joined: Thu Jun 22, 2017 12:42 am
languages_spoken: english
ODROIDs: Odroid Xu4, Odroid C2

Re: [HOWTO] Control automatic fan settings on XU3/XU4

Unread postby moon.linux » Thu Jun 22, 2017 2:27 am

If you want to run the cpu fan consitantly then best way is to lower the trip temperature.

Code: Select all
echo 35000 > /sys/class/thermal/thermal_zone1/trip_point_0_temp
echo 35000 > /sys/class/thermal/thermal_zone2/trip_point_0_temp
echo 35000 > /sys/class/thermal/thermal_zone3/trip_point_0_temp
echo 35000 > /sys/class/thermal/thermal_zone4/trip_point_0_temp


Note: you can append the above in /etc/rc.local
You can alter the temp value as per your setting it could range between 35000 to 45000
this the mid range temperature when in idle state.
moon.linux
 
Posts: 935
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english

Re: [HOWTO] Control automatic fan settings on XU3/XU4

Unread postby jeffa » Sat Jun 24, 2017 2:05 am

Thank you. Now the use of the settings files is becoming a little more clear, and I'm getting the behavior I want.
jeffa
 
Posts: 3
Joined: Thu Jun 22, 2017 12:42 am
languages_spoken: english
ODROIDs: Odroid Xu4, Odroid C2

Re: [HOWTO] Control automatic fan settings on XU3/XU4

Unread postby trikster » Tue Jul 04, 2017 5:00 am

moon.linux wrote:
If you are using 3.10.x then their is another parameter to control the fan speed.

Code: Select all
sudo echo "1 20 50 95" > /sys/devices/odroid_fan.14/fan_speeds
sudo echo "50 70 80" > /sys/devices/odroid_fan.14/temp_levels

I'm using 3.10.105+ kernel version and the settings above don't seem to be working. The fan turns on/off often. Are there any other settings I need to change so that my fan would spin continuously even when the load is low?
Code: Select all
root@dpi:~# cat /sys/devices/odroid_fan.14/temp_levels
56 70 80
root@dpi:~# cat /sys/devices/odroid_fan.14/fan_speeds
1 29 50 95
root@dpi:~#
trikster
 
Posts: 5
Joined: Mon Nov 02, 2015 8:16 pm
languages_spoken: english

Re: [HOWTO] Control automatic fan settings on XU3/XU4

Unread postby mad_ady » Tue Jul 04, 2017 2:28 pm

You would need to set the temp levels lower to get a continuosly spinning fan. For example try 20 70 80. Also note that the stock fan may sound worse at low rpm than at high rpm.
User avatar
mad_ady
 
Posts: 2886
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2

Re: [HOWTO] Control automatic fan settings on XU3/XU4

Unread postby Un4Seen » Sun Sep 10, 2017 8:30 am

Hi! Is there any updated script for the new kernel for making the fan less noisy?

I have a quite large heat sink on my XU4, I would like to either stop the fan completely or run it at low speeds constantly when the CPU passes a certain temperature level. How can I do this?

Thank you!
Un4Seen
 
Posts: 23
Joined: Thu Apr 10, 2014 6:16 pm
Location: Romania
languages_spoken: english, hungarian, romanian

Re: [HOWTO] Control automatic fan settings on XU3/XU4

Unread postby moon.linux » Sun Sep 10, 2017 1:00 pm

I have not tested this application but we could modify and tweak this to support XU4.
Code: Select all
git clone --depth 1 https://github.com/nmaas87/odroidu2-fan-service.git
cd odroidu2-fan-service
make
# install it as upstart service, i.e. < Ubuntu 16.04
make usi
# install it as systemd, i.e. Ubuntu 16.04 / Xenial
make systemd
moon.linux
 
Posts: 935
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english

Re: [HOWTO] Control automatic fan settings on XU3/XU4

Unread postby Un4Seen » Sun Sep 10, 2017 8:55 pm

I've updated the above mentioned service to run on the XU4 with the latest (>=4.0) kernel. See attachment.

Unfortunately this isn't quite what I wanted. I want to run the fan on a constant lower speed while having the CPU fully loaded and only switch to a high speed when the CPU gets very hot (>85 degrees). I tried all kinds of settings in the trip point temperature files and in the fan speed file, but it's still not going at a constant rate.
Attachments
odroidxu4-fan-service.tar.gz
(7.92 KiB) Downloaded 34 times
Un4Seen
 
Posts: 23
Joined: Thu Apr 10, 2014 6:16 pm
Location: Romania
languages_spoken: english, hungarian, romanian

Re: [HOWTO] Control automatic fan settings on XU3/XU4

Unread postby mad_ady » Sun Sep 10, 2017 10:06 pm

I'm using the following in /etc/rc.local to set trip points and fan speeds:
Code: Select all
#thermal points
if [ -f /sys/devices/virtual/thermal/thermal_zone0/trip_point_0_temp ]; then
echo Set thermal trip points to 60C
echo '60000' > /sys/devices/virtual/thermal/thermal_zone0/trip_point_0_temp
echo '70000' > /sys/devices/virtual/thermal/thermal_zone0/trip_point_1_temp
echo '80000' > /sys/devices/virtual/thermal/thermal_zone0/trip_point_2_temp
fi

if [ -f '/sys/devices/platform/pwm-fan:/hwmon/hwmon0/fan_speed' ]; then
    #set fan speed
    echo Set fan speed
    echo "0 80 150 245" > /sys/devices/platform/pwm-fan:/hwmon/hwmon0/fan_speed
fi
User avatar
mad_ady
 
Posts: 2886
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2

Re: [HOWTO] Control automatic fan settings on XU3/XU4

Unread postby Un4Seen » Sun Sep 10, 2017 10:55 pm

Shouldn't you be setting the trip points in ALL thermal zones (0 to 4)?
Un4Seen
 
Posts: 23
Joined: Thu Apr 10, 2014 6:16 pm
Location: Romania
languages_spoken: english, hungarian, romanian

Re: [HOWTO] Control automatic fan settings on XU3/XU4

Unread postby mad_ady » Sun Sep 10, 2017 11:55 pm

I don't know. I think thermal_zone0 measures temperatures from the cpu sensors. I don't know about the other zones.
User avatar
mad_ady
 
Posts: 2886
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2

Re: [HOWTO] Control automatic fan settings on XU3/XU4

Unread postby moon.linux » Sun Sep 10, 2017 11:59 pm

Change the cpufreq governor to "ondemand" in boot.ini and see if this help.
moon.linux
 
Posts: 935
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english

Re: [HOWTO] Control automatic fan settings on XU3/XU4

Unread postby Un4Seen » Mon Sep 11, 2017 3:22 am

Probably a very noob question, but where is this boot.ini?
I found two different such files on the system (identical ones)(see below), I changed the governor option in both, both I can't see any difference in behavior...

/usr/share/bootini/boot.ini
/media/boot/boot.ini
Un4Seen
 
Posts: 23
Joined: Thu Apr 10, 2014 6:16 pm
Location: Romania
languages_spoken: english, hungarian, romanian

Re: [HOWTO] Control automatic fan settings on XU3/XU4

Unread postby moon.linux » Mon Sep 11, 2017 3:29 am

You can update the /media/boot/boot.ini as below

Code: Select all
# CPU Governor Selection
# Available governos: conservative, userspace, powersave, ondemand, performance, schedutil
setenv governor "ondemand"


Edited : ondemand governor reduce the clk freq update.
moon.linux
 
Posts: 935
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english

Re: [HOWTO] Control automatic fan settings on XU3/XU4

Unread postby Un4Seen » Mon Sep 11, 2017 4:14 am

Here's a useful little shell script that I put together to easily change the trip point temperatures and the fan speeds with using just one line in the shell:
Code: Select all
#!/bin/bash

if [ "$#" -ne 7 ]; then
        echo "Usage: $(basename $0) TripPointTemp0 TripPointTemp1 TripPointTemp2 FanSpeed1 FanSpeed2 FanSpeed3 FanSpeed4"
        echo "The trip point temperatures must be specified in Celsius degrees (eg. 60)"
        echo "The fan speeds must be specified in PWM units (0-255)"
        echo "Example: $(basename $0) 58 70 80 0 100 150 250"
        exit 1
fi

for ((thermalzone=0;thermalzone<=4;++thermalzone))
do
        for ((triptemp=0;triptemp<=2;++triptemp))
        do
                idx=$triptemp+1
                echo -n $((${@:$((triptemp+1)):1}*1000)) >> "/sys/devices/virtual/thermal/thermal_zone"$thermalzone"/trip_point_"$triptemp"_$
        done
done

echo -n $4 $5 $6 $7 >> "/sys/devices/platform/pwm-fan:/hwmon/hwmon0/fan_speed"


I might also experiment with the hysteresis values for the trip point temperatures, but I'm not sure how they work if the intervals overlap...
Un4Seen
 
Posts: 23
Joined: Thu Apr 10, 2014 6:16 pm
Location: Romania
languages_spoken: english, hungarian, romanian

Re: [HOWTO] Control automatic fan settings on XU3/XU4

Unread postby alex_dom » Mon Sep 18, 2017 6:43 am

Un4Seen, your code didn't work, so I fixed it. Here is the final version:

Code: Select all
#!/bin/bash

if [ "$#" -ne 7 ]; then
        echo "Usage: $(basename $0) TripPointTemp0 TripPointTemp1 TripPointTemp2 FanSpeed1 FanSpeed2 FanSpeed3 FanSpeed4"
        echo "The trip point temperatures must be specified in Celsius degrees (eg. 60)"
        echo "The fan speeds must be specified in PWM units (0-255)"
        echo "Example: $(basename $0) 58 70 80 0 100 150 250"
        exit 1
fi

for ((thermalzone=0; thermalzone<=4; thermalzone++))
do
        for ((triptemp=0; triptemp<=2; triptemp++))
        do
                idx=$triptemp+1
                echo -n $((${@:$(($idx)):1}*1000)) >> "/sys/devices/virtual/thermal/thermal_zone"$thermalzone"/trip_point_"$triptemp"_temp"
        done
done

echo -n $4 $5 $6 $7 >> "/sys/devices/platform/pwm-fan:/hwmon/hwmon0/fan_speed"

exit 0
alex_dom
 
Posts: 7
Joined: Sat Jan 07, 2017 10:12 am
languages_spoken: english

Re: [HOWTO] Control automatic fan settings on XU3/XU4

Unread postby Un4Seen » Mon Sep 18, 2017 1:41 pm

What was the problem? For me it worked and is still working well in the form I posted...

I see 3 changes that you made:
1. Change the prefix increment operator to postfix form - that shouldn't matter, it's a question of coding preference
2. Started using idx variable - yeah, good catch, but still shouldn't make any diffrerence
3. Added the "_temp" postfix to the output file names - this is probably what matters - although for me it works just fine without it.
Un4Seen
 
Posts: 23
Joined: Thu Apr 10, 2014 6:16 pm
Location: Romania
languages_spoken: english, hungarian, romanian

Re: [HOWTO] Control automatic fan settings on XU3/XU4

Unread postby Un4Seen » Mon Sep 18, 2017 1:51 pm

Ah, yes, I see why that "_temp" postifx was missing... it was truncated by nano as I copy-pasted out the code from my SSH window into the forum. Thanks!
Un4Seen
 
Posts: 23
Joined: Thu Apr 10, 2014 6:16 pm
Location: Romania
languages_spoken: english, hungarian, romanian

Re: [HOWTO] Control automatic fan settings on XU3/XU4

Unread postby christian667 » Wed Oct 11, 2017 7:21 am

Okay I found the fan/temp control quite simple with 4.9.x.

To get the current state I used this simple script:

Code: Select all
#!/bin/bash
THERMAL="/sys/devices/virtual/thermal"
FAN="/sys/devices/platform/pwm-fan:/hwmon/hwmon0"
while [ true ]
do
   for f in $(ls $THERMAL|grep thermal)
   do
      echo "$f -> $(cat $THERMAL/$f/temp)"
   done

   echo "FAN -> $(cat $FAN/pwm1)"

   sleep 1

   echo "--"
done


There are 5 thermal zones controlling the fan reaction, each of the 7 trip points seems to lead to a higher fan speed.
As there are 4 fan speeds found in

/sys/devices/platform/pwm-fan:/hwmon/hwmon0/fan_speed

to get the fan less noise the easiest way was for me to adjust the lowest trip points (*/trip_point_0_temp) of all zones (default 65, now 70) and lower the default fan speed from

0 150 190 252

to

0 50 100 252

I also found some cooling devices in /sys/devices/virtual/thermal, but I didn't figure out how they may affect the fan speeds.
christian667
 
Posts: 5
Joined: Fri Feb 03, 2017 8:26 am
languages_spoken: english german
ODROIDs: xu4 c1+

Re: [HOWTO] Control automatic fan settings on XU3/XU4

Unread postby minca » Thu Oct 12, 2017 4:42 pm

Hi guys,

so whats the final version? it will be nice if the 1st post is updated with the "best" values for both kernels.
minca
 
Posts: 22
Joined: Fri Oct 06, 2017 5:23 am
languages_spoken: english
ODROIDs: xu4

Re: [HOWTO] Control automatic fan settings on XU3/XU4

Unread postby Un4Seen » Thu Oct 12, 2017 4:50 pm

This is my script that I use to control the trip points and the fan speed:
Code: Select all
#!/bin/bash

if [ "$#" -ne 7 ]; then
        echo "Usage: $(basename $0) TripPointTemp0 TripPointTemp1 TripPointTemp2 FanSpeed1 FanSpeed2 FanSpeed3 FanSpeed4"
        echo "The trip point temperatures must be specified in Celsius degrees (eg. 60)"
        echo "The fan speeds must be specified in PWM units (0-255)"
        echo "Example: $(basename $0) 58 70 80 0 100 150 250"
        exit 1
fi

for ((thermalzone=0;thermalzone<=4;++thermalzone))
do
        for ((triptemp=0;triptemp<=2;++triptemp))
        do
                idx=$triptemp+1
                echo -n $((${@:$(($idx)):1}*1000)) >> "/sys/devices/virtual/thermal/thermal_zone"$thermalzone"/trip_point_"$triptemp"_temp"
        done
done

echo -n $4 $5 $6 $7 >> "/sys/devices/platform/pwm-fan:/hwmon/hwmon0/fan_speed"


And this is my script that I use to monitor CPU temperature and frequency:
Code: Select all
#!/bin/bash

echo -n "Frequency  : "
FREQUENCY_COUNT=8
for ((i=0;i<$FREQUENCY_COUNT;++i))
do
        frequencyPath="/sys/devices/system/cpu/cpu"$i"/cpufreq/scaling_cur_freq"
        frequency=`cat $frequencyPath`
        echo -n  "`echo "scale=1; $frequency/1000" | bc` "
done
echo "MHz"

echo -n "Temperature: "
TEMPERATURE_COUNT=5
for ((i=0;i<$TEMPERATURE_COUNT;++i))
do
        temperaturePath="/sys/devices/virtual/thermal/thermal_zone"$i"/temp"
        temperature=`cat $temperaturePath`
        echo -n "`echo "scale=2; $temperature/1000" | bc` "
done
echo "C"

echo -n "Fan        : "
fanspeed=`cat /sys/devices/platform/pwm-fan:/hwmon/hwmon0/pwm1`
echo -n "`echo "scale=0; $fanspeed/2.55" | bc` "
echo "%"


For continuous monitoring I use:
Code: Select all
watch -t ./cpu_freq_temp.sh

where the cpu_freq_temp.sh script file contains the above monitoring script code.

I don't know if this is the best approach or not, works well for me.
Un4Seen
 
Posts: 23
Joined: Thu Apr 10, 2014 6:16 pm
Location: Romania
languages_spoken: english, hungarian, romanian

Re: [HOWTO] Control automatic fan settings on XU3/XU4

Unread postby christian667 » Thu Oct 12, 2017 4:55 pm

After some testing I like to share my configurations scripts für the 4.9.x kernel.

fanread.sh - shows the current thermal trip points & fan configuration

Code: Select all
#!/bin/bash
THERMAL="/sys/devices/virtual/thermal"
FAN="/sys/devices/platform/pwm-fan:/hwmon/hwmon0"
for f in $(ls $THERMAL|grep thermal)
do
   echo "--"
   for trip in $(ls $THERMAL/$f|grep trip|grep temp)
   do
      echo "$f.$trip -> $(cat $THERMAL/$f/$trip)"
   done
done
echo "--"
echo "FAN -> $(cat $FAN/fan_speed)"


fanwrite.sh - configures the fan / thermal trip points. I start this using /etc/rc.local with every boot

Code: Select all
#!/bin/bash
THERMAL="/sys/devices/virtual/thermal"
FAN="/sys/devices/platform/pwm-fan:/hwmon/hwmon0"


# THERMAL 0/1/2/3

# FROM
# thermal_zone0.trip_point_0_temp -> 65000
# thermal_zone0.trip_point_1_temp -> 70000
# thermal_zone0.trip_point_2_temp -> 75000

# TO
# thermal_zone0.trip_point_0_temp -> 75000
# thermal_zone0.trip_point_1_temp -> 80000
# thermal_zone0.trip_point_2_temp -> 85000

echo 75000 > $THERMAL/thermal_zone0/trip_point_0_temp
echo 80000 > $THERMAL/thermal_zone0/trip_point_1_temp
echo 85000 > $THERMAL/thermal_zone0/trip_point_2_temp

echo 75000 > $THERMAL/thermal_zone1/trip_point_0_temp
echo 80000 > $THERMAL/thermal_zone1/trip_point_1_temp
echo 85000 > $THERMAL/thermal_zone1/trip_point_2_temp

echo 75000 > $THERMAL/thermal_zone2/trip_point_0_temp
echo 80000 > $THERMAL/thermal_zone2/trip_point_1_temp
echo 85000 > $THERMAL/thermal_zone2/trip_point_2_temp

echo 75000 > $THERMAL/thermal_zone3/trip_point_0_temp
echo 80000 > $THERMAL/thermal_zone3/trip_point_1_temp
echo 85000 > $THERMAL/thermal_zone3/trip_point_2_temp

# FAN

# FROM
# 0 150 190 252

# TO
# 10 50 80 252

echo "10 50 80 252" > $FAN/fan_speed


And fancheck.sh - reads the current state of the fan / thermal zones

Code: Select all
#!/bin/bash
THERMAL="/sys/devices/virtual/thermal"
FAN="/sys/devices/platform/pwm-fan:/hwmon/hwmon0"
while [ true ]
do
   for f in $(ls $THERMAL|grep thermal)
   do
      echo "$f -> $(cat $THERMAL/$f/temp)"
   done

   echo "FAN -> $(cat $FAN/pwm1)"

   sleep 1

   clear
done


The fan spins always at a very low level but without load this is hardly hearable.
christian667
 
Posts: 5
Joined: Fri Feb 03, 2017 8:26 am
languages_spoken: english german
ODROIDs: xu4 c1+

Re: [HOWTO] Control automatic fan settings on XU3/XU4

Unread postby minca » Fri Oct 13, 2017 8:31 am

@christian667
I've tested your scripts but after setting the fan speed (fanwrite.sh) I've heared a whistleing sound

previously I was using https://github.com/f1vefour/odroid-xu4-fan-control
but it doesn't work on 4.9.x anymore
minca
 
Posts: 22
Joined: Fri Oct 06, 2017 5:23 am
languages_spoken: english
ODROIDs: xu4

Re: [HOWTO] Control automatic fan settings on XU3/XU4

Unread postby ArraY80 » Wed Oct 18, 2017 4:29 pm

I have ubuntu mate... Linux odroid 4.9.37-49 #1 i read all post. But what can I do so that it does not sound so much. It's very noisy it looks like a plane !!
ArraY80
 
Posts: 14
Joined: Thu Jul 13, 2017 3:48 am
languages_spoken: english spanish
ODROIDs: XU4

Re: [HOWTO] Control automatic fan settings on XU3/XU4

Unread postby minca » Wed Oct 18, 2017 11:46 pm

ArraY80 wrote:I have ubuntu mate... Linux odroid 4.9.37-49 #1 i read all post. But what can I do so that it does not sound so much. It's very noisy it looks like a plane !!

Hi

I've used those Scripts:

viewtopic.php?f=52&t=16308&p=204129#p204100

@christian667 thx man!!

and adjusted the values to in "fanwrite.sh":

Code: Select all
echo "35 75 100 252" > $FAN/fan_speed


you've to play with those values to a bit, for me was "10 50" too low and it has frequently jumped from 10 to 50 and 50 was loud...75 isn't that loud at all - note that my XU4 is runnin 24/7 for 23 months allready...

especially 1st two values 35 75 100 252
minca
 
Posts: 22
Joined: Fri Oct 06, 2017 5:23 am
languages_spoken: english
ODROIDs: xu4

Re: [HOWTO] Control automatic fan settings on XU3/XU4

Unread postby ArraY80 » Thu Oct 19, 2017 3:53 pm

with those parameters still heard when it is with 3 cores to full. Anything else I can do? 35 75 how can I put it better? I'm tired of testing values ​​and keeps on ringing ... :(
minca wrote:
ArraY80 wrote:I have ubuntu mate... Linux odroid 4.9.37-49 #1 i read all post. But what can I do so that it does not sound so much. It's very noisy it looks like a plane !!

Hi

I've used those Scripts:

viewtopic.php?f=52&t=16308&p=204129#p204100

@christian667 thx man!!

and adjusted the values to in "fanwrite.sh":

Code: Select all
echo "35 75 100 252" > $FAN/fan_speed


you've to play with those values to a bit, for me was "10 50" too low and it has frequently jumped from 10 to 50 and 50 was loud...75 isn't that loud at all - note that my XU4 is runnin 24/7 for 23 months allready...

especially 1st two values 35 75 100 252
ArraY80
 
Posts: 14
Joined: Thu Jul 13, 2017 3:48 am
languages_spoken: english spanish
ODROIDs: XU4

Re: [HOWTO] Control automatic fan settings on XU3/XU4

Unread postby mad_ady » Thu Oct 19, 2017 4:11 pm

You could try to have it run at full speed all the time by reducing the trigger temperature (e.g. to force the box to run at 20C). The alternative is to replace the fan with something quieter like a Noctua 5V 40x40 fan.
User avatar
mad_ady
 
Posts: 2886
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2

Re: [HOWTO] Control automatic fan settings on XU3/XU4

Unread postby ArraY80 » Fri Oct 20, 2017 5:15 am

How to to force the box to run at 20C?

I have put these values in fanwrite.sh:


echo 95000 > $THERMAL/thermal_zone0/trip_point_0_temp
echo 95000 > $THERMAL/thermal_zone0/trip_point_1_temp
echo 95000 > $THERMAL/thermal_zone0/trip_point_2_temp

echo 95000 > $THERMAL/thermal_zone1/trip_point_0_temp
echo 95000 > $THERMAL/thermal_zone1/trip_point_1_temp
echo 95000 > $THERMAL/thermal_zone1/trip_point_2_temp

echo 95000 > $THERMAL/thermal_zone2/trip_point_0_temp
echo 95000 > $THERMAL/thermal_zone2/trip_point_1_temp
echo 95000 > $THERMAL/thermal_zone2/trip_point_2_temp

echo 95000 > $THERMAL/thermal_zone3/trip_point_0_temp
echo 95000 > $THERMAL/thermal_zone3/trip_point_1_temp
echo 95000 > $THERMAL/thermal_zone3/trip_point_2_temp

echo "75 75 100 252" > $FAN/fan_speed


Can I carry it? I'm going to damage the odroid?
ArraY80
 
Posts: 14
Joined: Thu Jul 13, 2017 3:48 am
languages_spoken: english spanish
ODROIDs: XU4

Re: [HOWTO] Control automatic fan settings on XU3/XU4

Unread postby mad_ady » Fri Oct 20, 2017 2:35 pm

You're basically telling it not to do anything until it reaches 95C! That's bad. For always on fan try setting the trip point temperatures to 20000 (20C)
User avatar
mad_ady
 
Posts: 2886
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2

Re: [HOWTO] Control automatic fan settings on XU3/XU4

Unread postby moon.linux » Fri Oct 20, 2017 6:32 pm

pwm-fan has relation with thermal-zone trip it only trigger when the trip is crossed for any cpu's

So in my investigation the thermal-zone temperature vs clk frequency remain very much high when cpu frequency-governer is "performace"
and their is very little scaling of frequency from up to down

Code: Select all
root@odroid:~# ./temp.sh performance
Mode : performance
0   1   2   3   4
===================
40  41  42  41  37: 1400000 1400000 1400000 1400000 2000000 2000000 2000000 1400000: 09:23:42
42  42  44  43  38: 1400000 1400000 1400000 1400000 2000000 2000000 2000000 1400000: 09:23:43
42  43  44  44  38: 1400000 1400000 1400000 1400000 2000000 2000000 2000000 1400000: 09:23:45
43  43  45  44  39: 1400000 1400000 1400000 1400000 2000000 2000000 2000000 1400000: 09:23:46
43  43  45  44  39: 1400000 1400000 1400000 1400000 2000000 2000000 2000000 1400000: 09:23:47
44  43  45  44  39: 1400000 1400000 1400000 1400000 2000000 2000000 2000000 1400000: 09:23:48
43  43  45  45  39: 1400000 1400000 1400000 1400000 2000000 2000000 2000000 1400000: 09:23:49

so up when I change the cpu frequency-governer to ondemand their is study change in frequency which help maintain cooler temperature.
this means that the best algorithm as of now is "ondemand"
Code: Select all
root@odroid:~# ./temp.sh ondemand
Mode : ondemand
0   1   2   3   4
===================
45  45  47  47  41: 200000 200000 200000 200000 2000000 2000000 2000000 200000: 09:25:11
43  44  45  43  40: 200000 200000 200000 200000 1700000 1700000 1700000 200000: 09:25:12
42  43  45  43  40: 200000 200000 200000 200000 600000 600000 600000 200000: 09:25:13
42  43  44  42  39: 200000 200000 200000 200000 800000 800000 800000 200000: 09:25:14
42  43  44  42  39: 200000 200000 200000 200000 1700000 1700000 1700000 200000: 09:25:15
41  43  44  42  39: 200000 200000 200000 200000 1700000 1700000 1700000 200000: 09:25:17
41  43  44  42  39: 200000 200000 200000 200000 1700000 1700000 1700000 200000: 09:25:18
41  43  44  42  39: 200000 200000 200000 200000 500000 500000 500000 200000: 09:25:19
41  43  44  42  39: 200000 200000 200000 200000 1000000 1000000 1000000 200000: 09:25:20
41  42  43  41  39: 200000 200000 200000 200000 1700000 1700000 1700000 200000: 09:25:21

This could be a bug in kernel or clk so my advice is the change the cpu frequency governor to ondemand for better result of this board.
Attachments
temp.sh
temp cpufreq
(2.44 KiB) Downloaded 29 times
moon.linux
 
Posts: 935
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english

Re: [HOWTO] Control automatic fan settings on XU3/XU4

Unread postby christian667 » Thu Oct 26, 2017 5:46 am

Hey folks,

after some testing I came out with my final configuration:

fanwrite.sh

Code: Select all
#!/bin/bash

# -----------

POINT0="75000"
POINT1="80000"
POINT2="85000"
FANSPEED="0 22 80 252"

# -----------

THERMAL="/sys/devices/virtual/thermal"
FAN="/sys/devices/platform/pwm-fan:/hwmon/hwmon0"

# THERMAL 0/1/2/3

# FROM
# thermal_zone0.trip_point_0_temp -> 65000
# thermal_zone0.trip_point_1_temp -> 70000
# thermal_zone0.trip_point_2_temp -> 75000

# TO
# thermal_zone0.trip_point_0_temp -> ${POINT0}
# thermal_zone0.trip_point_1_temp -> ${POINT1}
# thermal_zone0.trip_point_2_temp -> ${POINT2}

echo ${POINT0} > $THERMAL/thermal_zone0/trip_point_0_temp
echo ${POINT1} > $THERMAL/thermal_zone0/trip_point_1_temp
echo ${POINT2} > $THERMAL/thermal_zone0/trip_point_2_temp

echo ${POINT0} > $THERMAL/thermal_zone1/trip_point_0_temp
echo ${POINT1} > $THERMAL/thermal_zone1/trip_point_1_temp
echo ${POINT2} > $THERMAL/thermal_zone1/trip_point_2_temp

echo ${POINT0} > $THERMAL/thermal_zone2/trip_point_0_temp
echo ${POINT1} > $THERMAL/thermal_zone2/trip_point_1_temp
echo ${POINT2} > $THERMAL/thermal_zone2/trip_point_2_temp

echo ${POINT0} > $THERMAL/thermal_zone3/trip_point_0_temp
echo ${POINT1} > $THERMAL/thermal_zone3/trip_point_1_temp
echo ${POINT2} > $THERMAL/thermal_zone3/trip_point_2_temp

# FAN

# FROM
# 0 150 190 252

# TO
# ${FANSPEED}

echo ${FANSPEED} > $FAN/fan_speed


I also figured out the governor of both cpu sets (big little after all) is set per default to performance - which in my case (idle 90% of the time) is not a smart choice. I decided to switch to the ubuntu default - ondemand. The little cpu set dropped the frequency from 1.400 mhz to 200 mhz and the big cpu set from 2.000 mhz to 300 mhz which brought the idle core tempratures down from 75-80 to finaly ~60 degrees celsius. Using my adjusted fan control (even the default threasholds should be just fine) the fan stays off - like all the time.

To switch the governor and start the script to adjust the threasholds, add to /etc/rc.local

Code: Select all
echo ondemand > /sys/devices/system/cpu/cpufreq/policy4/scaling_governor
echo ondemand > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor
/root/fanwrite.sh


The fanwrite.sh is placed at /root/fanwrite.sh and executable (chmod a+x fanwrite.sh).

If you are using netdata (which I love to track the system load - https://my-netdata.io/) you may also install nodejs and use a small plugin I wrote to integrate the fan speed and the temperature zones:

/usr/libexec/netdata/node.d/odroidfan.node.js

Code: Select all
const fs = require("fs")
const netdata = require("netdata");

const THERMAL = "/sys/devices/virtual/thermal"
const FAN = "/sys/devices/platform/pwm-fan:/hwmon/hwmon0"

function getFanData() {
    data = {}
    fs
        .readdirSync(THERMAL)
        .filter(d => d.includes("thermal"))
        .forEach(l => data[l.toLowerCase()] = {
            value: parseInt(fs.readFileSync(`${THERMAL}/${l}/temp`).toString()),
            unit: "Degree Celsius"
        })
    data.fan = {
        value: parseInt(fs.readFileSync(`${FAN}/pwm1`).toString()),
        unit: "PWM 0-255"
    }
    return data
}

netdata.processors.fetchodroiddata = {
    name: "fetchodroiddata",
    process: function (service, callback) {
        callback(getFanData())
    }
}

const charts = {}

module.exports = {
    processResponse: function (service, data) {
        if (service.added !== true) {
            service.commit()
        }

        Object
            .keys(data)
            .forEach(name => {
                const id = "Odroid." + name
                let chart = charts[id]

                if (!chart) {
                    const chartConfig = {
                        id,
                        name: "",
                        title: name,
                        family: "Temperature",
                        units: data[name].unit,
                        dimensions: {}
                    }
                    chartConfig.dimensions[name] = {
                        id: name,
                        name,
                        algorithm: netdata.chartAlgorithms.absolute,
                        multiplier: 1,
                        divisor: 1
                    }
                    chart = service.chart(id, chartConfig);
                    charts[id] = chart
                }

                service.begin(chart);
                service.set(name, data[name].value);
                service.end();
            })
    },
    configure: function (config) {
        netdata
            .service({name: "Odroid", update_every: this.update_every, module: this, processor: netdata.processors.fetchodroiddata})
            .execute(this.processResponse)
        return 1
    },
    update: function (service, callback) {
        service
            .execute(function (service, data) {
                service
                    .module
                    .processResponse(service, data)
                callback()
            })
    }
}
Attachments
Bildschirmfoto 2017-10-25 um 22.47.54.png
Bildschirmfoto 2017-10-25 um 22.47.54.png (260.72 KiB) Viewed 765 times
christian667
 
Posts: 5
Joined: Fri Feb 03, 2017 8:26 am
languages_spoken: english german
ODROIDs: xu4 c1+

Re: [HOWTO] Control automatic fan settings on XU3/XU4

Unread postby moon.linux » Thu Oct 26, 2017 12:22 pm

Thanks for your conformation on cpufreq governor. so best practice is the set the default governor as "ondemand"
moon.linux
 
Posts: 935
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english

Re: [HOWTO] Control automatic fan settings on XU3/XU4

Unread postby tmihai20 » Fri Oct 27, 2017 5:21 am

@christian667: nice find with my-netdata.io. I have installed it on my oDroid running OMV and I am in the process of adding plugins. It is not 100% clear how to do it. The only think I do not like is that authentication is not built-in and I am not using HTTPS on my installation (sorry for the offtopic). It certainly looks very nice and I like a lot more than the official interface, it makes it easier to watch the CPU temperature and other parameters.
Riddle me this, riddle me that
Who is afraid of the big, black bat?
I write (in Romanian mostly) on a blog (see my profile)
tmihai20
 
Posts: 63
Joined: Mon Nov 07, 2016 10:56 pm
Location: Romania
languages_spoken: english, french, italian, romanian
ODROIDs: XU4

Re: [HOWTO] Control automatic fan settings on XU3/XU4

Unread postby christian667 » Fri Oct 27, 2017 5:37 am

@tmihai20
Netdata is quite nice in perfomance aspects as it has nearly no footprint, but the plugin api is not good documentet at all.
If you install netdata system-wide (using the official installer and cloning the git repo) it will create /etc/netdata/ as well as /usr/libexec/netdata.
To add my nodejs plugin you need to install nodejs (using https://nodejs.org/en/download/package-manager/), netdata and place the plugin right to /usr/libexec/netdata/node.d/odroidfan.node.js - after restarting netdata the "Odroid" section will appear in the right side menu.
christian667
 
Posts: 5
Joined: Fri Feb 03, 2017 8:26 am
languages_spoken: english german
ODROIDs: xu4 c1+

Re: [HOWTO] Control automatic fan settings on XU3/XU4

Unread postby fnkngrv » Fri Oct 27, 2017 2:40 pm

OK, so this thread has become a bit confusing for me. I see that the OP was probably referencing the 3.10 kernel which is fine because that is what I am running, but I am seeing people also saying that the steps aren't enough and settings need to be tweaked or other issues with settings not sticking after reboot. Can someone please provide a stable set of documentation for both the 3.10 and then the 4.9 kernels in the SAME post that actually work so that the fan isn't forever cycling and stays on at a constant while not being overtly noticeable? I mean I haven't ever seen so much trouble to get a straight answer about setting up a fan for any of my other SBCs.
fnkngrv
 
Posts: 31
Joined: Fri Aug 18, 2017 2:09 pm
languages_spoken: english
ODROIDs: none yet...looking to pick up XU4

Re: [HOWTO] Control automatic fan settings on XU3/XU4

Unread postby jeffa » Tue Oct 31, 2017 5:58 am

Yes I agree this should be documented formally somewhere by the board/software creators. I've done quite a bit of experimentation since my last post in June, here is what I learned:

The original fan that comes with the board is horrible - it sounds like a small buzz saw and mine quit working completely after about 6 months. I replaced it with Gdstime DC 5V 40mm x 40mm x 7mm Thin Small Black Plastic Brushless Cooling Fan, which is almost silent. Because of that I want the fan to run more - the cooler the electronics stays the longer it lasts is my opinion. I also bought the Noctua A-Series Cooling Fan Blades with AAO Frame, SSO2 Bearing (NF-A4X10-FLX 5V), but did not try it yet. The Gdstime fits the stock case without protruding so I'll stay with it till it breaks.

Sorry I only worked with the 4.9 kernel....

Here are my settings from /etc/rc.local

Code: Select all
#set temperature triggers - I want it to run cooler than stock
#settings since I installed a quieter fan (original one broke
#anyway)
echo 50000 > /sys/class/thermal/thermal_zone0/trip_point_0_temp
echo 50000 > /sys/class/thermal/thermal_zone1/trip_point_0_temp
echo 50000 > /sys/class/thermal/thermal_zone2/trip_point_0_temp
echo 50000 > /sys/class/thermal/thermal_zone3/trip_point_0_temp
echo 50000 > /sys/class/thermal/thermal_zone4/trip_point_0_temp
echo 60000 > /sys/class/thermal/thermal_zone0/trip_point_1_temp
echo 60000 > /sys/class/thermal/thermal_zone1/trip_point_1_temp
echo 60000 > /sys/class/thermal/thermal_zone2/trip_point_1_temp
echo 60000 > /sys/class/thermal/thermal_zone3/trip_point_1_temp
echo 60000 > /sys/class/thermal/thermal_zone4/trip_point_1_temp
echo 70000 > /sys/class/thermal/thermal_zone0/trip_point_2_temp
echo 70000 > /sys/class/thermal/thermal_zone1/trip_point_2_temp
echo 70000 > /sys/class/thermal/thermal_zone2/trip_point_2_temp
echo 70000 > /sys/class/thermal/thermal_zone3/trip_point_2_temp
echo 70000 > /sys/class/thermal/thermal_zone4/trip_point_2_temp
echo 120000 > /sys/class/thermal/thermal_zone0/trip_point_3_temp
echo 120000 > /sys/class/thermal/thermal_zone1/trip_point_3_temp
echo 120000 > /sys/class/thermal/thermal_zone2/trip_point_3_temp
echo 120000 > /sys/class/thermal/thermal_zone3/trip_point_3_temp
echo 120000 > /sys/class/thermal/thermal_zone4/trip_point_3_temp


So my fan comes on at 50C and gets progressively faster as temp increases. One note - be very careful with trip_point_3_temp!!! That appears to be the thermal shutdown temperature! I set it to 80C once, apparently something briefly exceeded 80C during boot and my board immediately shutdown. So I went back to 120C.

Fan speeds are set to:
/sys/devices/platform/pwm-fan\:/hwmon/hwmon0/fan_speed
0 150 190 252

I obviously changed this once in my experimentation, now I cannot seem to find where that was. If I change it in my rc.local script something changes it back to 0 150 190 252. Fan speed definitions appear in multiple files in multiple places so I'm do not remember what I changed way back when. I suspect something that runs after rc.local moves the fan speeds in from another file somewhere. Since this setting is is ok for me I don't mess with it. If anyone has ideas please post them.

I found a script for displaying 3.10 kernel temps and modified for where I think files store the operating temperature, fan speed level, etc for the 4.9 kernel. I know its not very sophisticated - my simple mind creates simple (but hopefully easily readable) scripts.

Code: Select all
#!/bin/bash
####echo "<img>/home/odroid/scripts/system-monitor.png</img>"
declare -i cpuFreq1
declare -i cpuFreq2

while :
do

    cpuFreq1=$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq | cut -f3 -d" " | cut -f1 -d".")
    cpuFreq2=$(cat /sys/devices/system/cpu/cpu4/cpufreq/scaling_cur_freq | cut -f3 -d" " | cut -f1 -d".")

    if [ $cpuFreq1 -ge 1000000 ]
    then
      cpu=$(echo $cpuFreq1 | cut -c1).$(echo $cpuFreq1 | cut -c2)GHz
    else
      cpu=$(echo $cpuFreq1 | cut -c1-3).$(echo $cpuFreq1 | cut -c2)Mhz
    fi
#### other CPU group 
    if [ $cpuFreq2 -ge 1000000 ]
    then
      cpu2=$(echo $cpuFreq2 | cut -c1).$(echo $cpuFreq2 | cut -c2)GHz
    else
      cpu2=$(echo $cpuFreq2 | cut -c1-3).$(echo $cpuFreq2 | cut -c2)Mhz
    fi

    zone0=$(echo "Zone 0 = "$(cat /sys/devices/virtual/thermal/thermal_zone0/temp  | awk ' { print $1 / 1000 }' | sed 's/\ \ */ /g' | cut -f2 -d" ")"C")
    zone1=$(echo "Zone 1 = "$(cat /sys/devices/virtual/thermal/thermal_zone1/temp  | awk ' { print $1 / 1000 }' | sed 's/\ \ */ /g' | cut -f2 -d" ")"C")
    zone2=$(echo "Zone 2 = "$(cat /sys/devices/virtual/thermal/thermal_zone2/temp  | awk ' { print $1 / 1000 }' | sed 's/\ \ */ /g' | cut -f2 -d" ")"C")
    zone3=$(echo "Zone 3 = "$(cat /sys/devices/virtual/thermal/thermal_zone3/temp  | awk ' { print $1 / 1000 }' | sed 's/\ \ */ /g' | cut -f2 -d" ")"C")
    zone4=$(echo "Zone 4 = "$(cat /sys/devices/virtual/thermal/thermal_zone4/temp  | awk ' { print $1 / 1000 }' | sed 's/\ \ */ /g' | cut -f2 -d" ")"C")
    fanlev=$(cat /sys/devices/virtual/thermal/cooling_device0/cur_state | cut -c1)
    echo "$(date)"
    echo "$zone0" "$zone1" "$zone2" "$zone3" "$zone4"
    echo "Freq1: "$cpu"  ""Freq2: "$cpu2""
    echo "Fan Level: "$fanlev""
    echo " "
    sleep 5
done


The files I read temps and stuff from is not from any documentation - its from me peeking and poking and making educated guesses on what resides where.

The fan seems to work the script output indicates it should. For example if the fan speed is under 50C in zones the fan is off and fan speed level is zero. If it goes goes over 50C in any zone I usually see a fan speed level of 1 and fan is running, Temp over 60 shows a fan level of 2 and so on.

I agree ONDEMAND not PERFORMANCE is the proper setting if you are concerned about temps. The CPU speed changing is not noticable in my use of the XU4. Or a mix - I run the 2GHZ CPUs as ONDEMAND and the 1.4 GHZ CPUs on PERFORMANCE. For the 1.4 GHZ CPUs whether its ONDEMAND or PERFORMANCE does not seem to affect the temp much in my application. I use my XU4 mostly as my desktop PC, web surfing, word processing, playing YOUTUBE videos, etc. Nothing terribly CPU intensive.

I hope this helps someone.
jeffa
 
Posts: 3
Joined: Thu Jun 22, 2017 12:42 am
languages_spoken: english
ODROIDs: Odroid Xu4, Odroid C2

Re: [HOWTO] Control automatic fan settings on XU3/XU4

Unread postby moon.linux » Wed Nov 01, 2017 3:05 am

I feel their is not need to alter the temperature or cpu fan_speed, the reason it when tmu driver initialized
it monitor the trip point and maps internally to the cooling device emulator, which is mapped to the dts change.

We could control the fan speed via alternate the pmw value and the ratio of the temperature.
I have modified the above demon too support all 4 thermal zone, this demon update the pmw value to turn on fan speed.
this is the safe way to make this work.

Code: Select all
Temperature: 41 C, target PWM value: 0, last PWM value: 0
Temperature: 42 C, target PWM value: 0, last PWM value: 0
Temperature: 42 C, target PWM value: 0, last PWM value: 0
Temperature: 48 C, target PWM value: 5, last PWM value: 0
Temperature: 46 C, target PWM value: 1, last PWM value: 5
Temperature: 44 C, target PWM value: 0, last PWM value: 1
Temperature: 45 C, target PWM value: 0, last PWM value: 0
Temperature: 53 C, target PWM value: 14, last PWM value: 0
Temperature: 59 C, target PWM value: 24, last PWM value: 14
Temperature: 63 C, target PWM value: 31, last PWM value: 24
Temperature: 65 C, target PWM value: 35, last PWM value: 31
Temperature: 66 C, target PWM value: 36, last PWM value: 35
Temperature: 68 C, target PWM value: 40, last PWM value: 36
Attachments
odroidxu4-fan-service.tar.gz
cpu fan demon
(3.19 KiB) Downloaded 22 times
moon.linux
 
Posts: 935
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english

Re: [HOWTO] Control automatic fan settings on XU3/XU4

Unread postby SGS » Wed Nov 01, 2017 1:36 pm

christian667 wrote:@tmihai20
Netdata is quite nice in perfomance aspects as it has nearly no footprint, but the plugin api is not good documentet at all.
If you install netdata system-wide (using the official installer and cloning the git repo) it will create /etc/netdata/ as well as /usr/libexec/netdata.
To add my nodejs plugin you need to install nodejs (using https://nodejs.org/en/download/package-manager/), netdata and place the plugin right to /usr/libexec/netdata/node.d/odroidfan.node.js - after restarting netdata the "Odroid" section will appear in the right side menu.

Sorry, netdata system-wide installed, package-manager? = (
Code: Select all
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
too. Your node.js also in the right path, but nothing. Will see your work. Any tip for help?
Hope Mods are not angry if I put some small german letters in this thread :)

Ich würde es so gern nutzen, bekomme es aber nicht hin. Ein YT-Video für dummies wie mich wäre cool :)
README.md verstehe ich auch nicht, mein englisch ist mies. Nur fronius und stiebel.eltron werden hier angenommen?
If no configuration is given, the module will be disabled. Each `update_every` is optional, the default is `5`.
Code: Select all
# Disclaimer
Module configurations are written in JSON and **node.js is required**. to be edited.
---
The following node.d modules are supported:
# fronius ..
SGS
 
Posts: 12
Joined: Fri Sep 18, 2015 10:42 pm
languages_spoken: english (brackish), german (better)
ODROIDs: XU4

Re: [HOWTO] Control automatic fan settings on XU3/XU4

Unread postby fnkngrv » Thu Nov 09, 2017 1:53 pm

moon.linux wrote:I feel their is not need to alter the temperature or cpu fan_speed, the reason it when tmu driver initialized
it monitor the trip point and maps internally to the cooling device emulator, which is mapped to the dts change.

We could control the fan speed via alternate the pmw value and the ratio of the temperature.
I have modified the above demon too support all 4 thermal zone, this demon update the pmw value to turn on fan speed.
this is the safe way to make this work.

Code: Select all
Temperature: 41 C, target PWM value: 0, last PWM value: 0
Temperature: 42 C, target PWM value: 0, last PWM value: 0
Temperature: 42 C, target PWM value: 0, last PWM value: 0
Temperature: 48 C, target PWM value: 5, last PWM value: 0
Temperature: 46 C, target PWM value: 1, last PWM value: 5
Temperature: 44 C, target PWM value: 0, last PWM value: 1
Temperature: 45 C, target PWM value: 0, last PWM value: 0
Temperature: 53 C, target PWM value: 14, last PWM value: 0
Temperature: 59 C, target PWM value: 24, last PWM value: 14
Temperature: 63 C, target PWM value: 31, last PWM value: 24
Temperature: 65 C, target PWM value: 35, last PWM value: 31
Temperature: 66 C, target PWM value: 36, last PWM value: 35
Temperature: 68 C, target PWM value: 40, last PWM value: 36



pardon my ignorance, but looking at the readme in your file pack can these steps be used on the 3.10 kernel as I find the reference to "I changed some settings to use this on an 4.10.0-rc2-next-20170106 Kernel"
fnkngrv
 
Posts: 31
Joined: Fri Aug 18, 2017 2:09 pm
languages_spoken: english
ODROIDs: none yet...looking to pick up XU4

Re: [HOWTO] Control automatic fan settings on XU3/XU4

Unread postby moon.linux » Thu Nov 09, 2017 2:42 pm

@fnkngrv I think I removed the mode setting for 3.10.x, which could use to map the thermal zone. I will double check this and update.
moon.linux
 
Posts: 935
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english

Re: [HOWTO] Control automatic fan settings on XU3/XU4

Unread postby fnkngrv » Fri Nov 10, 2017 10:59 am

Great...thanks!
fnkngrv
 
Posts: 31
Joined: Fri Aug 18, 2017 2:09 pm
languages_spoken: english
ODROIDs: none yet...looking to pick up XU4

Re: [HOWTO] Control automatic fan settings on XU3/XU4

Unread postby moon.linux » Fri Nov 10, 2017 2:15 pm

@fnkngrv sorry I could not find valid way to tune the pmw setting on 3.10.x odroid fan driver is propitiatory.
Code: Select all
root@odroid:~# ls -ls  /sys/bus/platform/drivers/odroid-fan/odroid_fan.14/
total 0
0 lrwxrwxrwx 1 root root    0 Nov 10 05:02 driver -> ../../bus/platform/drivers/odroid-fan
0 -rw-r--r-- 1 root root 4096 Nov 10 05:02 fan_mode
0 -rw-r--r-- 1 root root 4096 Nov 10 05:02 fan_speeds
0 -r--r--r-- 1 root root 4096 Nov 10 05:02 modalias
0 drwxr-xr-x 2 root root    0 Nov 10 05:00 power
0 -rw-r--r-- 1 root root 4096 Nov 10 05:03 pwm_duty
0 -rw-r--r-- 1 root root 4096 Nov 10 05:04 pwm_enable
0 lrwxrwxrwx 1 root root    0 Nov 10 04:17 subsystem -> ../../bus/platform
0 -rw-r--r-- 1 root root 4096 Nov 10 05:02 temp_levels
0 -rw-r--r-- 1 root root 4096 Nov 10 04:17 uevent
root@odroid:~#

Here are the setting we could tune for 3.10.x kernel.
Code: Select all
root@odroid:~# cat /sys/bus/platform/drivers/odroid-fan/odroid_fan.14/pwm_duty
2
root@odroid:~# cat /sys/bus/platform/drivers/odroid-fan/odroid_fan.14/pwm_enable
PWM_0 : on
root@odroid:~# cat /sys/bus/platform/drivers/odroid-fan/odroid_fan.14/pwm_duty
2
root@odroid:~# cat /sys/bus/platform/drivers/odroid-fan/odroid_fan.14/temp_levels
68 73 85
root@odroid:~#
moon.linux
 
Posts: 935
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english

Re: [HOWTO] Control automatic fan settings on XU3/XU4

Unread postby fnkngrv » Sat Nov 11, 2017 12:18 am

thanks for the reply. I will give that a stab and see how it goes. :-)


so to confirm we are changing the duty cycle from 130 to 2?
fnkngrv
 
Posts: 31
Joined: Fri Aug 18, 2017 2:09 pm
languages_spoken: english
ODROIDs: none yet...looking to pick up XU4

Previous

Return to Ubuntu (All Linux'es)

Who is online

Users browsing this forum: No registered users and 1 guest