Fan Control Software for ROCK5B | ROCK5B PWM风扇控制软件

A open source PWM fan control software for ROCK5B.
Tool to control fan speed by temperature automatically for ROCK5B.

source: https://github.com/pymumu/fan-control-rock5b

Features

  1. Control fan speed by temperature.
  2. set fan speed manually

Build & install

make package
dpkg -i fan-control*.deb

Usage

systemctl enable fan-control
systemctl start fan-control

License

MIT License

10 Likes

大佬,插板子自带的2pin风扇口也能调速么

就是板子自带的2p口调速,板子上标注了fan的

给力,才发现大佬还是smartdns的开发者,我都给点亮了

map初始转速太高了,我改了一下温度和转速的map,很好用,感谢分享

Hi,

which pins are controlled by pwm?

The white 2 pin fan connector nearest the cpu nope now I remember where I got it from
“Molex PicoBlade” 1.25mm pitch 2-pin cable https://thepihut.com/products/miniature-5v-cooling-fan-with-molex-picoblade-connector * ZH (1.5mm pitch)

@shenmuecn Its not your software unless its how pwm01 is registered but usually pwm is 25Khz and can cope as low as 10%.
The gpio is driving http://www.aosmd.com/pdfs/datasheet/ao3416.pdf which maybe someone with better electronics can say why it doesn’t seem to be applying enough current or seem to like higher (more normal 25khz switching)

Its on the 20.Power_DC IN page of https://dl.radxa.com/rock5/5b/docs/hw/radxa_rock5b_v13_sch.pdf

There is a fan socket on the board

https://wiki.radxa.com/Rock5/hardware/5b

Still really confused as if you take @shenmuecn software out of the equation you should be able to do manual control and it still makes no sense.

So without software installed you can do watch -n 1 sudo cat /sys/kernel/debug/pwm in a cli windows and just watch the settings

We set up /pwm0 with
echo 0 > /sys/devices/platform/fd8b0010.pwm/pwm/pwmchip1/export
set the polarity to normal
echo normal > /sys/devices/platform/fd8b0010.pwm/pwm/pwmchip1/pwm0/polarity
set frequency to 25Khz in ns
echo 40000 > /sys/devices/platform/fd8b0010.pwm/pwm/pwmchip1/pwm0/period
set the duty_cycle to 50% (speed)
echo 20000 > /sys/devices/platform/fd8b0010.pwm/pwm/pwmchip1/pwm0/duty_cycle
Enable pwm0
echo 1 > /sys/devices/platform/fd8b0010.pwm/pwm/pwmchip1/pwm0/enable

Change the duty cycle and until you get to 35000 %87.5 it doesn’t spin.

What @shenmuecn did gets more control with setting the period to
echo 10000 > /sys/devices/platform/fd8b0010.pwm/pwm/pwmchip1/pwm0/period that in nano seconds by my calcs is 100Khz which dunno though was pretty high but at least works better!?!

Its prob just vcc5v0_sys can not supply enough current as been using stress-ng and can hear the fan slow when I stress the cpu and speed back up again when it stops.

2 Likes

does anyone know how to control the fan via GPIO for the PoE hat?

any help would be appreciated

I made a fork of @shenmuecn’s repository with a fan curve that doesn’t unnecessarily make the board sound like a vacuum cleaner:

3 Likes

No logging, no way to see current temp nor fan duty cycle status.

I’m unable to get the FAN to work on my Rock5B board. I’ve tested the following on both the Ubuntu Jammy CLI image, and the Debian Bullseye CLI image, with the same exact results.

I’ve tried the following:

  1. I tried manually doing the echo 0 > /sys/devices/platform/fd8b0010.pwm/pwm/pwmchip1/export but it said:
    write error: Device or resource busy

I don’t see a pwm0 listed under: /sys/devices/platform/fd8b0010.pwm/pwm/pwmchip1/pwm0

All I see is device, export, npwm, power/, subsystem/, uevent and unexport.

I assume this is the main reason why nothing is working.

  1. Tried running this: https://github.com/XZhouQD/Rock5B_Naive_Pwm_Fan
  2. I tried installing the fan-control service from: https://github.com/pymumu/fan-control-rock5b. I tried tweaking the duty cycle in the JSON file but still nothing.

Any help is appreciated.

Maybe you connected it to the battery connector?

My fan is connected to the FAN connector, next to the MASKROM button. I did have that thought too but I double-checked that it is connected to the FAN connector.

I think I should probably create a new post for this, since it is a little off-topic from this post.

So far I’ve tried to enable the PWM FAN in clean images of Debian, Ubuntu and Armbian. The result is always the same: echo 0 > /sys/devices/platform/fd8b0010.pwm/pwm/pwmchip1/export but it said: write error: Device or resource busy

Is it possible that something is faulty on my Rock5B PCB itself?

The fan control scripts won’t work as the kernel driver now overrides them.

2 Likes

@ incognito
Thank you! I will test this tomorrow and let you know how things go. I appreciate you taking the time to provide such a thorough response.

1 Like

As a follow up, the instructions posted by @incognito worked for me and I am now able to use the PWM FAN on my Rock5B. Thank you again for the help.

1 Like