Edge2 Cooling Fan

Which version of system do you use? Khadas official images, self built images, or others?

**Khadas image: Ubuntu 22.04 desktop, image of Dec, 2022**

Please describe your issue below:

  1. Today I tried to find a quieter but in the same time safe for the computer fan setting. I looked at the “Edge2 Cooling Fan” manual and I don’t understand something. Can someone help me please? I am missing some logical element. I can set the values of the three threshold temperatures (this is how I understand the term “trigger temperature”), but I do not see the possibility of setting one of those three temperatures (low, mid, high) as the one that actually regulates the fan’s work in auto mode. The manual describes how to set the trigger temperatures’ values, with an example for the low one (I understand that I can set the values for mid and high trigger temperatures in the same way):

$ echo 40 | sudo tee /sys/class/fan/trigger_temp_low

It’s clear, but where is the ability to put this very temperature, or one of the other two, “into action”? I checked “experimentally” that this is the “low” threshold temperature which is most likely set in the auto mode. The default is 50 Celsius — checking with the “fan.sh temp” command, the fan keeps 50 Celsius all the time. The “fan.sh mid” and “fan.sh high” commands have nothing to do with the setting I need, because I see that they only turn on the fan for continuous operation at the desired speed level.

I would expect to have the ability to set auto mode with one of three threshold temperatures, e.g. high, which is set to 70 degrees Celsius, would actually maintain the temperature at 70 degrees. Reading the manual (or executing the command “fan.sh --help”) I don’t see this possibility.

Have I missed or misunderstood something?

  1. It would be useful to be able to set the fan speed for continuous low mode or/and for auto mode. I found discussions for the VIM4 (How to change lowest fan speed?) and for the VIM3 (https://forum.khadas.com/t/how-to- control-fan-speed-precisely/18602) but they seem unfinished and without a precise closing answer. How can I set the fan speed on my Edge2 so that it stays continuously (I mean returns after a break in operation) in the auto mode?

I’m not sure if it helps your scenario 100% however here is what I am using on my Edge2 and it seems to work very well. Adjust the temps to your preferred points. I have it starting just at boot with this. Let me know if you need anymore information.

echo 40 | sudo tee /sys/class/fan/trigger_temp_low
echo 50 | sudo tee /sys/class/fan/trigger_temp_mid
echo 60 | sudo tee /sys/class/fan/trigger_temp_high

Hi Tenakawa,

what I wanted to express in my post is that I think the fan.sh script is a bit illogical in some aspect. It allows you to set three trigger temperatures, but it still uses only one of them (trigger_temp_low) as the actual, operational one. There is no option to set this operational trigger temperature to trigger_temp_mid or trigger_temp_high. You may ask why the author of the fan.sh script gives the user the ability to set the trigger_temp_mid and trigger_temp_high parameters, if it is not possible to set the actual, operational trigger temperature (the one that actually works in auto mode as the threshold temperature) to one of them. The fan.sh script lacks, in my opinion, one more parameter, e.g. possibility for tree commands: “fan.sh triggerlow”, “fan.sh triggermid”, and “fan.sh triggerhigh” to set the trigger temperature equal to one of the three preset values (currently, the “fan.sh trigger” command lists only the current values of trigger_temp_* parameters and it doesn’t change anything).

To change the trigger operating temperature to e.g., 65 degrees Celsius, I used the following workaround:

$ echo 69 | sudo tee /sys/class/fan/trigger_temp_mid
$ echo 65 | sudo tee /sys/class/fan/trigger_temp_low

The first command is because trigger_temp_low cannot be greater than trigger_temp_mid. So, I have to artificially raise the latter so that the former can be higher than the default latter. After entering these commands, the fan keeps the temperature in the range of 63–66 degrees Celsius (of course, when the processor is working “hard enough”, when it is resting, the temperature may be lower than 63).

In one sentence: it seems to me that currently the only parameter regulating the trigger temperature is the trigger_temp_low and the other two exist in the fan.sh script for some unknown to me reason.

I see what you mean if that is the way the script is working (I need to go pull a copy of the script and take a look, I’ve always just worked directly with the devices nodes and the MCU). Do you have a current download link for the fan script? Thanks.

I see it on my edge2 here:


I definitely see some hardcoding in the script that makes it adjust it strangely. I was able to manually get the fan to run at all three speeds finally after testing different combinations however I am not sure if the multiple levels can be triggered by temp yet… Its just doing the same echos as listed above so it should… I’m also finding limits to what temps each one will allow. Low would allow 55 degrees however not 60 for example. I find that my Edge2 never hits the second trigger point temperature to even have it change speeds.

echo 55 | sudo tee /sys/class/fan/trigger_temp_low
echo 60 | sudo tee /sys/class/fan/trigger_temp_low
tee: /sys/class/fan/trigger_temp_low: Invalid argument