tparys Posted February 12, 2021 Posted February 12, 2021 So, I was doing some reading on how to control PWM fans under Linux. The lm-sensors package has a fancontrol script, but pwmconfig doesn't recognize the PWM devices on my NanoPi M4V2. There's also this repository which has a pwm-fan service, which might be the same one that Friendly Desktop uses (referenced in this post). But then I found this rather interesting link from the Kobol guys: https://wiki.kobol.io/helios4/pwm/. Apparently the Linux kernel has built-in thermal control and user space scripting isn't even required, just editing the Device Tree. But as we have easy user overlays for the RK3399, let's go ... tparys@m4v2:~$ sudo armbian-add-overlay nanopi-m4-fan.dts Compiling the overlay Copying the compiled overlay file to /boot/overlay-user/ Reboot is required to apply the changes ... or manually compile via DTC and copy to /boot/overlay-user, update /boot/armbianEnv.txt. Whichever makes you happy. Seems to work well with the metal case I have for my M4V2 and NVME hat. Don't have a SATA hat, but if uses the same PWM pins, it should work there as well. No separate userspace package or SystemD service, and it should even kick in if the system gets stuck in boot (SystemD emergency mode). Probably several improvements that could be made: Fan is currently triggered only by CPU temperature, not GPU. The fan replaces the first CPU trip point, which looks like it scales back the two big CPU cores. Not sure if this still needed. PWM frequency (40000) is a total guess. Better period to use? I don't see a much fan speed difference between cooling states 1-3. They should be 25, 50, and 100%, but all sound the same. Might have missed something. Would be interested to hear any thoughts/feedback or if it's useful to anyone else. nanopi-m4-fan.dts
usual user Posted February 12, 2021 Posted February 12, 2021 5 hours ago, tparys said: Would be interested to hear any thoughts/feedback I'm curious how your thermal system performs, an opinion to post a tmon log while your device is being stressed? This is mine running for three hours with all six cores at 100%: Spoiler
tparys Posted February 13, 2021 Author Posted February 13, 2021 Well, the thermal solution was made by FriendlyElec, not me. I just asked Linux to spin the knobs for me. But, I spun up several jobs, the kernel pegged the fan shortly after, and after a few minutes got up to just over 60 C.
usual user Posted February 13, 2021 Posted February 13, 2021 6 hours ago, tparys said: But, I spun up several jobs, the kernel pegged the fan shortly after, and after a few minutes got up to just over 60 C. This is only feeling and guesswork. I don't have your device model so can't check your setup by myself. Hence my request for a tmon log to see what is really going on. But if you are satisfied with your results, I have no further request and stop my curiosity.
Recommended Posts