[BPI-R4] CPU fan setup

@Alexago, a quick tldr:

https://www.kernel.org/doc/Documentation/thermal/sysfs-api.txt

cat /sys/class/thermal/thermal_zone0/temp # read current temp

42678

Thermal zone types:

cat /sys/class/thermal/thermal_zone0/trip_point_0_type

critical

cat /sys/class/thermal/thermal_zone0/trip_point_1_type

hot

cat /sys/class/thermal/thermal_zone0/trip_point_2_type

active

cat /sys/class/thermal/thermal_zone0/trip_point_3_type

active

cat /sys/class/thermal/thermal_zone0/trip_point_4_type

active

Stock settings (currently):

cat /sys/class/thermal/thermal_zone0/trip_point_0_temp

125000

cat /sys/class/thermal/thermal_zone0/trip_point_1_temp

120000

cat /sys/class/thermal/thermal_zone0/trip_point_2_temp

115000

cat /sys/class/thermal/thermal_zone0/trip_point_3_temp

85000

cat /sys/class/thermal/thermal_zone0/trip_point_4_temp

40000

Updating:

echo 40000 > /sys/class/thermal/thermal_zone0/trip_point_1_temp # override echo 120000 > /sys/class/thermal/thermal_zone0/trip_point_1_temp # set to default

echo 35000 > /sys/class/thermal/thermal_zone0/trip_point_2_temp # override echo 115000 > /sys/class/thermal/thermal_zone0/trip_point_2_temp # set to default

echo 32000 > /sys/class/thermal/thermal_zone0/trip_point_3_temp # override echo 85000 > /sys/class/thermal/thermal_zone0/trip_point_3_temp # set to default

echo 30000 > /sys/class/thermal/thermal_zone0/trip_point_4_temp # override echo 40000 > /sys/class/thermal/thermal_zone0/trip_point_4_temp # set to default

I’ve heard that overriding the values via echoing to the sysfs path will persist on reboot, but have not confirmed; it may need to be set via an rc.local or sysctl.conf manner

1 Like

No, that is not true (at least not on this board).

Sorry for just disappearing / not answering.

My grandmother has gotten bowel cancer and is going into surgery tomorrow, so I have helped her a lot and haven’t had time to write here.

I don’t have time to try to submit patches to either the kernel or OpenWrt for the next few weeks either - can someone else here please do it for me ? :slight_smile:

I’m sorry to hear that. Unfortunately I also don’t have much time right now to pick up your work. Anyone?

1 Like

:slightly_smiling_face:

Thank you for your Work!

Don’t care about the project so much, care about your grandmother :+1:.

1 Like

I believe this is not a 3-PIN PWM fan. The third pin from the fan is output to the host for reporting fan speed.

Do you have a way to measure PWM signal? If so, do you get pulses from the 3rd PIN of this fan in your experiment? I would like some assurance that this fan is indeed a 3-pin PWM fan…lol

Update

@Hypnotize confirms the fan is indeed PWM fan in this post

I want to have this question also in this chat:

I think it is really important that Frank and/or dangowrt gets your code into the actual Openwrt snapshot. I was really happy to hear about your progress. Some people will not find this chat, this is why it is so important to get it into the snapshot!

How I can update kernel on this one to 6.1.8 ? Because :

Version: 6.1.86-r1
Size: ~180.00 KiB installed
Dependencies:
kernel VERSION INCOMPATIBLE
kmod-hwmon-core INSTALLED
Description
Kernel module for NVM Express solid state drives directly connected to the PCI or PCI Express bus.

The installed version of package kernel is not compatible, require 6.1.86~0dc73eff…-r1 while 6.1.82~c31a377a…-r1 is installed.

I guess you use openwrt snapshot,right? Please make own topic as this is for bpi-r4 fan setup,not nvme.

I’m using compiled image from Hypnotize. So exactly with PWM fan patch. But if I want keep this build and add as example nvme, I cannot due to compatibility.

Independ from this it is unrelated to cpu fan setup…you can link to the image and maybe hypnotize build an image to include the nvme part or upgrade to actual openwrt where you maybe can install additional packages

setup 1: at /BPI-R4-OPENWRT-V21.02/target/linux/mediatek/mt7988/base-files/etc/init.d/fanspeed if [ ! -d /sys/devices/platform/pwm-fan ]; then exit 0 fi

setup 2: at //home/jiang/BPI/BPI-R4-OPENWRT-V21.02/target/linux/mediatek/mt7988/base-files/sbin/fan-speed

USE this file and replace it fan-speed (5.7 KB)

Then rebuild

or edit and replace

setup 1: the file in /etc/init.d/fanspeed. find and edit it

setup 2 : replace fan-speed with my file in /sbin/

Where can we set these values before compiling?

example: /sys/class/thermal/thermal_zone0/trip_point_1_temp

I cannot for my life find that info, and it’s not in the notes and patches on getting the pwm working.

The trip-point temperatures are already set in mt7988a.dtsi so not part of the patches…

1 Like

Got it, thank you. Now to move on to other items on my list.

Where to buy this heatsink and fan for BPI-R4?

This looks like the r3 heatsink…i saw it on aliexpress but more expensive than r4 heatsink

Indeed apparently it’s the R3 heatsink, but hey if it works it doesn’t matter.

https://de.aliexpress.com/item/1005006544838058.html