Skip to main content
Question

Can we control the fan speed on Aetina RK3588?

  • July 26, 2025
  • 10 replies
  • 280 views

llrds
Ensign
Forum|alt.badge.img

I have SDK Version 1.3.3, there is a comment in release notes about fan but it seems to be for the Metis. I saw already threads discussing the PCIe and M.2 fan speed on the Metis, this question is about the Aetina evalkit running at 100% fan all the time.

There are none of these types of details in here.

https://support.axelera.ai/hc/en-us/articles/22846665291794-AETINA-RK3588-Industrial-Motherboard-M-2

I tried wider searching Aetina and Firefly on Google, there are some suggestion that control might be possible in /sys/class/hwmon but I could not find a match, or I should be looking for something else in there.

Can I make the fan speed of the SBC by dynamic?

10 replies

Forum|alt.badge.img
  • Axelera Team
  • July 28, 2025

@llrds the fan speed of our PCIe is indeed controlled by our software.
Control of the Aetina RK3588 fanspeed is up to the user so I would suggest to look into Aetina RK3588 documentation on info how to control the fan speed. 


saadtiwana
Ensign
Forum|alt.badge.img+1
  • Ensign
  • July 29, 2025

Btw, has anyone been able to find any documentation for the Aetina RK3588 board? Even the Aetina website only has a flyer for the board, and no detailed datasheet etc as far as I could see.


llrds
Ensign
Forum|alt.badge.img
  • Author
  • Ensign
  • July 30, 2025

I also cannot find any documentation for the Aetina board, I’d checked their website already. 

I guess the Axelera guys would have linked it if they had any, I'll reach out to Aetina. 


Forum|alt.badge.img
  • Community Manager
  • August 1, 2025

Hi, 

Thanks for the question!

Aetina usually has this firefly_fan_control binary running as a background process to control the fan, I know we have this on their Firefly boards, so if this binary is available, then perhaps it can be used to control the fan speed. And for a feedback we can read the temp from sysfs via /sys/class/thermal/thermal_zone*/temp

Hope this helps!


llrds
Ensign
Forum|alt.badge.img
  • Author
  • Ensign
  • August 1, 2025

yes, firefly_fan_control is there and we can read the temp from sysfs.

There is a reference here to that command - with reference to being able too control fan speed here, but it’s not successful for me.

https://wiki.t-firefly.com/en/EC-A1684XJD4/fan_strategy.html

I don't think firefly_fan_control is there for interacting with, it’s just doing it’s thing and seems to allow no input for control.


Forum|alt.badge.img
  • Community Manager
  • August 4, 2025

@llrds 

Thanks for the reply!

Can you please try these [1] two scripts, hysteresis_fan.py and read_temp.sh, the latter either needs to be placed in the /home/firefly/Downloads or we can modify the TEMP_SCRIPT var in the former, and we run them as follows:

python3 -u hysteresis_fan.py --low-threshold 30 --high-threshold 45 --high 50 --low 90 --interval 5

Hope this helps! 
Please do let us know if you have any more questions, comments or suggestions.
Thanks again!

---

[1] https://gist.github.com/ha6i6khalid/61af34a28c4ca37ca289d03da343c81c
For some reason I am unable to post the snippets here in the post, hence made a public gist


llrds
Ensign
Forum|alt.badge.img
  • Author
  • Ensign
  • August 9, 2025

Hi ​@Habib , Thanks for making this & sorry for the delay. But so far it does not make a difference to the fan speed for me. 

I can see the Python script working and interfacing with the firefly program:

aetina@aetina:~/voyager-sdk$ sudo journalctl --follow | grep firefly

Aug 09 13:04:09 aetina sudo[4140]: root : TTY=pts/3 ; PWD=/home/aetina/voyager-sdk ; USER=root ; COMMAND=/usr/bin/firefly_fan_control ITX-3588J 90

When I try to interface directly with the firefly_fan_control, there are some errors that would suggest the fan program is not up to date - it’s looking for something that just isn't there for this board I think:

(venv) aetina@aetina:~/voyager-sdk$ sudo /usr/bin/firefly_fan_control ITX-3588J 90

board ITX-3588J

sh: 1: cannot create /sys/devices/platform/pwm-fan/hwmon/hwmon7/pwm1: Directory nonexistent

set_PWM: 229

pwm: 90

set_ITX_3588J_fan_pwm: Can not open /sys/devices/platform/pwm-fan/hwmon/hwmon7/pwm1 file

27769.000000

26846.000000

27769.000000

27769.000000

26846.000000

26846.000000

27769.000000

sum = 24.636084

 

If you have any other suggestions I'd be glad to try it!


Forum|alt.badge.img
  • Community Manager
  • August 9, 2025

@llrds 
The scripts don’t work perhaps because your board version might be different … (that’s my bad, should have added the --model-version argument as well, apologies)

Can you please let me know your board version; with:
cat /sys/firmware/devicetree/base/model

E.g. in my case I get:

firefly@firefly:~$ cat /sys/firmware/devicetree/base/model
Firefly ITX-3588J MIPI(Linux)

and for me ITX-3588J worked

maybe you can try using the firefly_fan_control binary with your board-version (as follows):
sudo /usr/bin/firefly_fan_control <your-board-version> 90


Hope this helps!


llrds
Ensign
Forum|alt.badge.img
  • Author
  • Ensign
  • August 10, 2025

Hi ​@Habib, my board is indeed different. 

aetina@aetina:~$ cat /sys/firmware/devicetree/base/model 
RKC-A02_V0.4.2aetina@aetina:~$ 


And trying the binary directly 

aetina@aetina:~$ sudo /usr/bin/firefly_fan_control RKC-A02_V0.4.2 90
sh: 1: echo: echo: I/O error
sh: 1: cannot create /sys/class/pwm/pwmchip0/pwm0/period: Directory nonexistent
sh: 1: cannot create /sys/class/pwm/pwmchip0/pwm0/polarity: Directory nonexistent
sh: 1: cannot create /sys/class/pwm/pwmchip0/pwm0/duty_cycle: Directory nonexistent
sh: 1: cannot create /sys/class/pwm/pwmchip0/pwm0/enable: Directory nonexistent
set_PWM: 91000
 pwm: 90
set_CS_R1_3399JD4_MAIN_fan_pwm: Can not open /sys/class/pwm/pwmchip0/pwm0/duty_cycle file
no such file /tmp/fan_temperature
no such file /tmp/fan_temperature
no such file /tmp/fan_temperature
no such file /tmp/fan_temperature
no such file /tmp/fan_temperature
no such file /tmp/fan_temperature
no such file /tmp/fan_temperature
no such file /tmp/fan_temperature
no such file /tmp/fan_temperature
no such file /tmp/fan_temperature

 

The binary gives some hints to what models are supported, yours is listed, mine is unfortunately not :( I have tried all of those, they all have a similar error that a file does not exist.

aetina@aetina:~$ sudo /usr/bin/firefly_fan_control 
./main CS-R1-3399JD4-MAIN 50
./main CS-R2-3399JD4-MAIN --debug
./main ROC-RK3588S-PC 50
./main ITX-3588J 50
./main ROC-RK3588-PC 50
./main AIO-3588Q 50
./main AIO-3588MQ 50
./main AIO-3588SG 50
./main CS-A1-N8S-3588S-JD4-MAIN 50


Forum|alt.badge.img
  • Community Manager
  • April 2, 2026

@llrds 

Were you able to solve this issue? If this is still unsolved then perhaps try following script (this is working with my Aetina host, which shows same version as yours): 

> cat /sys/firmware/devicetree/base/model 

RKC-A02_V0.4.2


Thanks 🙏
--

#!/bin/bash

# -----------------------------
# Fan Control Script with PWM
# -----------------------------
# This script controls a PWM fan based on CPU temperature.
# Logs are printed to the console for easy monitoring.
# -----------------------------

PWM_CHIP=2
PWM_CHANNEL=0
PERIOD=50000 # PWM period in ns
HIGH_DUTY=40000 # Fan ON (~80%)
LOW_DUTY=5000 # Fan OFF (~20%)

# Temperature thresholds
TEMP_ON=50 # Fan goes to HIGH_DUTY above this temp (°C)
TEMP_OFF=40 # Fan goes to LOW_DUTY below this temp (°C)

echo "=== Starting PWM Fan Control ==="
echo "PWM Chip: $PWM_CHIP, Channel: $PWM_CHANNEL"
echo "Temperature thresholds: ON=$TEMP_ON°C, OFF=$TEMP_OFF°C"
echo "Duty cycle: HIGH=$HIGH_DUTY, LOW=$LOW_DUTY"
echo "Checking CPU temperature every 5 seconds..."
echo

# Export PWM channel if not already exported
if [ ! -d "/sys/class/pwm/pwmchip$PWM_CHIP/pwm$PWM_CHANNEL" ]; then
echo "Exporting PWM channel $PWM_CHANNEL..."
echo $PWM_CHANNEL | sudo tee /sys/class/pwm/pwmchip$PWM_CHIP/export >/dev/null 2>&1
sleep 1
else
echo "PWM channel $PWM_CHANNEL already exported."
fi

# Set PWM period
echo "Setting PWM period to $PERIOD ns..."
echo $PERIOD | sudo tee /sys/class/pwm/pwmchip$PWM_CHIP/pwm$PWM_CHANNEL/period >/dev/null

# Set PWM polarity
echo "Setting PWM polarity to normal..."
echo normal | sudo tee /sys/class/pwm/pwmchip$PWM_CHIP/pwm$PWM_CHANNEL/polarity >/dev/null

# Enable PWM
echo "Enabling PWM output..."
echo 1 | sudo tee /sys/class/pwm/pwmchip$PWM_CHIP/pwm$PWM_CHANNEL/enable >/dev/null

echo "PWM initialization complete."
echo

# Infinite loop to monitor CPU temperature
while true; do
cpu_temp=$(cat /sys/class/thermal/thermal_zone0/temp)
cpu_temp=$((cpu_temp / 1000)) # Convert from millidegree to degree Celsius

echo "$(date '+%Y-%m-%d %H:%M:%S') - CPU Temperature: ${cpu_temp}°C"

if [ $cpu_temp -ge $TEMP_ON ]; then
echo "Temperature above $TEMP_ON°C → setting fan to HIGH duty cycle ($HIGH_DUTY)..."
echo $HIGH_DUTY | sudo tee /sys/class/pwm/pwmchip$PWM_CHIP/pwm$PWM_CHANNEL/duty_cycle >/dev/null
elif [ $cpu_temp -le $TEMP_OFF ]; then
echo "Temperature below $TEMP_OFF°C → setting fan to LOW duty cycle ($LOW_DUTY)..."
echo $LOW_DUTY | sudo tee /sys/class/pwm/pwmchip$PWM_CHIP/pwm$PWM_CHANNEL/duty_cycle >/dev/null
else
echo "Temperature in hysteresis range ($TEMP_OFF°C - $TEMP_ON°C), no change to fan."
fi

sleep 5
done