Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Automatic Kernel Control of NanoPi M4 / M4V2 Metal Case Fan

Featured Replies

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:

  1. Fan is currently triggered only by CPU temperature, not GPU.
  2. 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.
  3. PWM frequency (40000) is a total guess. Better period to use?
  4. 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

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

tmon-log.thumb.png.98a220adeb309575ae0be329ac1f388c.png

 

  • Author

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.

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.

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.