LuCI PWM Fan Control - PID, Fan Curves and temp Monitoring for OpenWrt

My motivation for this is two fold. I keep my 5G antenna cables short and due to that the modem/router lives in the attic, which can get quite hot. Due to that I made a custom box with 120mm fan for my router. I noticed when I keep the modem temps down I get better and more stable connection.

So I developed a new graphical fan control app for OpenWrt

pwm-fan-control controls Linuxipwm-fan devices on OpenWrt. It operates as a CLI program and as a procd service. luci-app-pwm-fan is the graphical interface for pwm-fan-control.

The controller supports these modes:

  • Kernel mode - observes the fan while the Linux thermal policy controls it.
  • Auto - uses a PID controller.
  • Curve - uses configured temperature points.
  • Manual - for fixed output (has additonal timeout option)
  • Disabled - stops the service and does not access the hardware.

The LuCI application has following features:

  • Router CPU and optional modem temp history graphs with selectable data series
  • Live fan, CPU, modem and subsystem status
  • Configuration for multiple controller modes
  • Interactive temperature curve editor

The app features multiple control modes, that should cover most needs

The curve editor:

This sould in theory work with any OpenWrt router that has a built in fan and the device profile must also select kmod-hwmon-pwmfan by default. It has been tested already on few different devices. The app is available for testing from here: https://github.com/MayorBug/pwm-fan-builds

10 Likes

Please consider a PR to the main package repo, so this can be available for all users.

Thats eventually the plan. First wanted to gather info how well or bad it works for others.

2 Likes

Nice asthetics.

Feel free to put a dress on this:


Well...

...not my project but.

How heavy is that package?

Thanks, I was going for nice modern UI. Package size wise my luci bit isn't bigger than the statistics app.

1 Like

Nice!

It´s possible make a opkg package?

I´m running a 24.10.5 version of OpeWRT and I receive this error:

root@horus:~# wget -qO- https://github.com/MayorBug/pwm-fan-builds/releases/latest/download/install.sh | sh
pwm-fan installer: this installer supports APK-based OpenWrt only
root@horus:~#

Thanks

I don't have an device that uses .ipk builds to test with. I can look into adding ipk builds on the weekend for you if you want to test

1 Like

@topsbr
I tought about this. Since I am lazy and I don't plan to work with 24.x devices the effort to add ipk to my own git builds doesn't make sense.

I plan to push the app to main repos quite soon after few planned updates, if it gets accepted then the .ipk will be made available anyway. However If you want to try sooner I can give you commands to build the ipk packages on your PC.

1 Like