Page 1 of 1

Adding PWM fan control to Gargoyle on BPi-R3

Posted: Sun Oct 19, 2025 1:39 am
by Mr.nsingh2
Hello,

Feature request for PWM control of cooling fan. Is it possible to control the fans attached to CN22 and CN23 connectors on Bpri-R3 PCB? I know in Open-WRT there is mechanism to control the fan speed based on CPU temp. I noticed that Gargoyle is already polling and showing the CPU temperature on the Status Page of Bpi-R3. There is a small 5v fan modded on to my Bpi-R3 case. However, the fan does make noticeable sound. Without the fan, temperature can go as high as 60-65 degrees when router is very active, it will be sweet to be able to control/slow down/stop the fan when temperature is normal around 35-40 degrees.

Thanks in advance for your time. Gargoyle is an awesome firmware, I feel it makes OpenWRT much more user friendly, keep up the good work.

Sincerely- Navi

Re: Adding PWM fan control to Gargoyle on BPi-R3

Posted: Sun Oct 19, 2025 2:28 am
by pythonic
Mr.nsingh2 wrote:
Sun Oct 19, 2025 1:39 am
Is it possible to control the fans attached to CN22 and CN23 connectors on Bpri-R3 PCB? I know in Open-WRT there is mechanism to control the fan speed based on CPU temp.
Could you please check whether the instructions at https://github.com/openwrt/openwrt/issu ... 3184538336 work? Please also check other suggestions in that issue as well.

If not, do the instructions at https://openwrt.org/toh/sinovoip/banana ... tion_speed work?

Note that you might need to use hwmon2 instead of hwmon1 in some of the /sys/devices/... references depending on which connector you've used.

Please keep in mind that the developers probably don't have access to your hardware and rely on hardware owners to test such things.

Re: Adding PWM fan control to Gargoyle on BPi-R3

Posted: Mon Oct 20, 2025 10:00 am
by Mr.nsingh2
Pythonic, Thanks for pointing me in the right direction. Had to do tons of reading to understand PWM based control of fans on BPi-R3. Spent the whole day understanding the logic and came up with following changes to my rc.local file. Now the setup is working smoothly and temperature is not going beyond 49 degrees centigrade. (Note: Bpi-R3 on Open-Wrt has 5 trip points, 0 is reserved for critical and 1 is reserved for Hot, 2,3,4 can be active.
Here are the changes I made:

---------------Sample rc.local file---------------

# Set critical trip point at 95°C on thermal_zone0
echo "critical" > /sys/class/thermal/thermal_zone0/trip_point_0_type
echo 95000 > /sys/class/thermal/thermal_zone0/trip_point_0_temp


# Set Hot trip point at 75°C on thermal_zone0
echo "hot" > /sys/class/thermal/thermal_zone0/trip_point_1_type
echo 75000 > /sys/class/thermal/thermal_zone0/trip_point_1_temp
echo 5000 > /sys/class/thermal/thermal_zone0/trip_point_1_hyst

# Set active trip point at 49°C on thermal_zone0
echo "active" > /sys/class/thermal/thermal_zone0/trip_point_2_type
echo 49000 > /sys/class/thermal/thermal_zone0/trip_point_2_temp
echo 2500 > /sys/class/thermal/thermal_zone0/trip_point_2_hyst

#Set active trip point at 59°C on thermal_zone0
echo "active" > /sys/class/thermal/thermal_zone0/trip_point_3_type
echo 49000 > /sys/class/thermal/thermal_zone0/trip_point_3_temp
echo 2500 > /sys/class/thermal/thermal_zone0/trip_point_3_hyst

#Set active trip point at 69°C on thermal_zone0
echo "active" > /sys/class/thermal/thermal_zone0/trip_point_4_type
echo 49000 > /sys/class/thermal/thermal_zone0/trip_point_4_temp
echo 2500 > /sys/class/thermal/thermal_zone0/trip_point_4_hyst

exit 0

--------------------------------------------------------
Edit:
Note2: 3-Pin/Lead PWM fans will not work because these fans do not have PWM signal wire, the third wire on these fans is speed/tachometer wire.
Note3: Make sure to use 4Pin PWM fan. Since CN23 connector on BPi-R3 is not 4 pin connector, you will need to modify the 4pin/4lead fan to only use 3 Pins/leads. You do not need the 3rd lead in 4 pin PWM fan, which is speed/tachometer signal lead, securely tape it. Instead Connect the 4th lead of the PWM fan, which is the PWM signal wire, to the third signal pin of "CN23 PWM Fan 3Pin PH-JST connector" on the BPi-R3 PCB.
-------------------------------------------------------

Thank you for your time.
-----Navi