Jump to content

Odroid XU4 fan control


tomislav177

Recommended Posts

Hello I have Odroid xu4 with fan mounted on heatsink. I found several tutorials online and I have one problem.

I have  Armbian buster with Linux 5.4.28-odroidxu4

I tried edit temp curve and I did it with nano /etc/rc.local

 

# Target temperature: 30°C, 50°C, 70°C

TRIP_POINT_0=30000

TRIP_POINT_1=50000

TRIP_POINT_2=70000

echo $TRIP_POINT_0 > /sys/devices/virtual/thermal/thermal_zone0/trip_point_0_temp

echo $TRIP_POINT_0 > /sys/devices/virtual/thermal/thermal_zone1/trip_point_0_temp

echo $TRIP_POINT_0 > /sys/devices/virtual/thermal/thermal_zone2/trip_point_0_temp

echo $TRIP_POINT_0 > /sys/devices/virtual/thermal/thermal_zone3/trip_point_0_temp  

echo $TRIP_POINT_1 > /sys/devices/virtual/thermal/thermal_zone0/trip_point_1_temp  

echo $TRIP_POINT_1 > /sys/devices/virtual/thermal/thermal_zone1/trip_point_1_temp  

echo $TRIP_POINT_1 > /sys/devices/virtual/thermal/thermal_zone2/trip_point_1_temp  

echo $TRIP_POINT_1 > /sys/devices/virtual/thermal/thermal_zone3/trip_point_1_temp  

echo $TRIP_POINT_2 > /sys/devices/virtual/thermal/thermal_zone0/trip_point_2_temp  

echo $TRIP_POINT_2 > /sys/devices/virtual/thermal/thermal_zone1/trip_point_2_temp  

echo $TRIP_POINT_2 > /sys/devices/virtual/thermal/thermal_zone2/trip_point_2_temp  

echo $TRIP_POINT_2 > /sys/devices/virtual/thermal/thermal_zone3/trip_point_2_temp

 

This code above is working fine but when I try to edit fan speeds I can't find it

 

 

 

$ echo "0 204 220 240" | sudo tee /sys/devices/platform/pwm-fan/hwmon/hwmon0/fan_speed

 

when I do ls -l /sys/devices/platform/pwm-fan/hwmon/hwmon0/ there is no fan_speed file

 

Please can you tell me where is location of file that has attributes to control pwm state so I can do echo from rc.local

 

Why I want to do that, well I have one idea. When I try edit /sys/devices/platform/pwm-fan/hwmon/hwmon0/pwm1 with nano I try several speed of fan.  Minimun of my fan is 40 but it doesn't start on that speed but is iq quiet and on that speed temp of my CPU is 43C. This is why I edited target temp.  when fan is in stop state 40 in pwm1 doesn't have enough voltage to start fan. But 50 C will activate fan and it will drop to 40 pwm1 and it will keep spining. If it stops, againt 50C activate the fan and so on...

 I only need $ echo "0 40 120 240" | sudo tee /sys/devices/platform/pwm-fan/hwmon/hwmon0/fan_speed to correct place

 

Thanks.

 

 

Reply to:  soerenderfor

 

I can't reply so I will edit this post I will cut this part of post when system unlock option for reply I get one per day :)

 

when I do

sudo find /sys -name pwm1 | grep hwmon

I get

/sys/devices/platform/pwm-fan/hwmon/hwmon0/pwm1
I know for that pwm1, I even manualy edited it with nano but some part is constantly being updating this pwm1 and this just replace what ever I try to put in this file.

when I do

cat /sys/devices/platform/pwm-fan/hwmon/hwmon0/pwm1

I get

120

when I change this 120 to 40 after some time it gets updated to 120

 

Critical is to find location of that pwm or fan_speed file that contains 120 180 240 which is doing editing pwm1 file so I can echo into that file and problem is sloved. I tried everything but I just can't find that file. If I can find that file odroid xu4 will be extra quiet on performance mode with 43C

 

Edited by tomislav177
Link to comment
Share on other sites

7 hours ago, tomislav177 said:

I have  Armbian buster with Linux 5.4.28-odroidxu4


This kernel is not yet on the support level of stock 4.14.y ... Modern kernel is always a trade. Good at some features, bad or non-existing others.

Link to comment
Share on other sites

You can also use the first script in /etc/rc.local and set them to

 

# Target temperature: 25°C, 30°C, 65°C

TRIP_POINT_0=25000

TRIP_POINT_1=30000

TRIP_POINT_2=65000

 

I use these trip points on my XU4 Cloudshell2 - and it works like charm, the fan speeds will then run around 180,.

Link to comment
Share on other sites

Hello I was gone for few days. I did some experimets, I was stupid enough for my first install to go with kernel Kernel 5.4.y now I flashed stock kernel 4.14.y and all is working fine. But one BIG drawback of kernel 5.4.y. is samba transfer speed on my home network which was max 48MB/s now with 4.14.y kernel is 98-100MB/s

I use odroid as a home server and this is one big thing to consider if you want to go with experimental kernel. In kernel 4.14 you can control fan because you have file fan_speed.

I managed to control fan by editing

 

nano /etc/rc.local

 

TRIP_POINT_0=25000
TRIP_POINT_1=55000
TRIP_POINT_2=70000

echo $TRIP_POINT_0 > /sys/devices/virtual/thermal/thermal_zone0/trip_point_0_te$
echo $TRIP_POINT_0 > /sys/devices/virtual/thermal/thermal_zone1/trip_point_0_te$
echo $TRIP_POINT_0 > /sys/devices/virtual/thermal/thermal_zone2/trip_point_0_te$
echo $TRIP_POINT_0 > /sys/devices/virtual/thermal/thermal_zone3/trip_point_0_te$

echo $TRIP_POINT_1 > /sys/devices/virtual/thermal/thermal_zone0/trip_point_1_te$
echo $TRIP_POINT_1 > /sys/devices/virtual/thermal/thermal_zone1/trip_point_1_te$
echo $TRIP_POINT_1 > /sys/devices/virtual/thermal/thermal_zone2/trip_point_1_te$
echo $TRIP_POINT_1 > /sys/devices/virtual/thermal/thermal_zone3/trip_point_1_te$

echo $TRIP_POINT_2 > /sys/devices/virtual/thermal/thermal_zone0/trip_point_2_te$
echo $TRIP_POINT_2 > /sys/devices/virtual/thermal/thermal_zone1/trip_point_2_te$
echo $TRIP_POINT_2 > /sys/devices/virtual/thermal/thermal_zone2/trip_point_2_te$
echo $TRIP_POINT_2 > /sys/devices/virtual/thermal/thermal_zone3/trip_point_2_te$

# Target fan speed (PWM): 0, 60 180, 240
echo "0 60 180 240" > /sys/devices/platform/pwm-fan/hwmon/hwmon0/fan_speed

 

Now my odroid is super quiet as home server with 45C in average, I run on it OMV5, in docker (PiHole, transmission, unifi-controller, duckdns and watchtower).

echo "0 60 180 240" > /sys/devices/platform/pwm-fan/hwmon/hwmon0/fan_speed

value of 60 is not enough to start odroid fan, but second value of 180 starts the fan and then it continues to spin on 60pwm. This is something that will everyone need to try for himself but quiet is precious. :)

I hope this will help someone like me. 

Regards.
 

Edited by tomislav177
Link to comment
Share on other sites

On 6/1/2020 at 11:52 AM, tomislav177 said:

Hello I was gone for few days. I did some experimets, I was stupid enough for my first install to go with kernel Kernel 5.4.y now I flashed stock kernel 4.14.y and all is working fine. But one BIG drawback of kernel 5.4.y. is samba transfer speed on my home network which was max 48MB/s now with 4.14.y kernel is 98-100MB/s

I use odroid as a home server and this is one big thing to consider if you want to go with experimental kernel. In kernel 4.14 you can control fan because you have file fan_speed.

I managed to control fan by editing

 

nano /etc/rc.local

 

TRIP_POINT_0=25000
TRIP_POINT_1=55000
TRIP_POINT_2=70000

echo $TRIP_POINT_0 > /sys/devices/virtual/thermal/thermal_zone0/trip_point_0_temp$
echo $TRIP_POINT_0 > /sys/devices/virtual/thermal/thermal_zone1/trip_point_0_temp$
echo $TRIP_POINT_0 > /sys/devices/virtual/thermal/thermal_zone2/trip_point_0_temp$
echo $TRIP_POINT_0 > /sys/devices/virtual/thermal/thermal_zone3/trip_point_0_temp$

echo $TRIP_POINT_1 > /sys/devices/virtual/thermal/thermal_zone0/trip_point_1_temp$
echo $TRIP_POINT_1 > /sys/devices/virtual/thermal/thermal_zone1/trip_point_1_temp$
echo $TRIP_POINT_1 > /sys/devices/virtual/thermal/thermal_zone2/trip_point_1_temp$
echo $TRIP_POINT_1 > /sys/devices/virtual/thermal/thermal_zone3/trip_point_1_temp$

echo $TRIP_POINT_2 > /sys/devices/virtual/thermal/thermal_zone0/trip_point_2_temp$
echo $TRIP_POINT_2 > /sys/devices/virtual/thermal/thermal_zone1/trip_point_2_temp$
echo $TRIP_POINT_2 > /sys/devices/virtual/thermal/thermal_zone2/trip_point_2_temp$
echo $TRIP_POINT_2 > /sys/devices/virtual/thermal/thermal_zone3/trip_point_2_temp$

# Target fan speed (PWM): 0, 60 180, 240
echo "0 60 180 240" > /sys/devices/platform/pwm-fan/hwmon/hwmon0/fan_speed

 

Now my odroid is super quiet as home server with 45C in average, I run on it OMV5, in docker (PiHole, transmission, unifi-controller, duckdns and watchtower).

echo "0 60 180 240" > /sys/devices/platform/pwm-fan/hwmon/hwmon0/fan_speed

value of 60 is not enough to start odroid fan, but second value of 180 starts the fan and then it continues to spin on 60pwm. This is something that will everyone need to try for himself but quiet is precious. :)

I hope this will help someone like me. 

Regards.
 

I have one mistake in code that I use in /etc/rc.local this is now correct.

Link to comment
Share on other sites

On 6/1/2020 at 11:52 AM, tomislav177 said:

Hello I was gone for few days. I did some experimets, I was stupid enough for my first install to go with kernel Kernel 5.4.y now I flashed stock kernel 4.14.y and all is working fine. But one BIG drawback of kernel 5.4.y. is samba transfer speed on my home network which was max 48MB/s now with 4.14.y kernel is 98-100MB/s

I use odroid as a home server and this is one big thing to consider if you want to go with experimental kernel. In kernel 4.14 you can control fan because you have file fan_speed.

 

I noticed the same regressions (low samba speed and lack of fan control) with 5.4.28, so I went back to my trusty 4.14.133. Moving data from one USB-drive to another - both connected to the XU4 with 5.4.28 - was almost as slow as samba, 40'ish MB/s. However, reliability with 5.4.28 was fine even when moving huge amounts of data - albeit slowly...

Edited by tbylit
Minor corrections.
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines