ROC-RK3328-CC PWM fan control

I just purchased a case PWM fan for my Renegade. I can power it just fine from either the 5V or 3.3V pins, but I’d like to be able to throttle the fan down when the system isn’t under load (it’s loud).
I also own a Le Potato which has several pwm-*-fan ldto overlays available for this purpose. Has anyone created a similar overlay for the Renegade? Or is there a good guide that I could use to translate the Potato’s overlay to Renegade? Has anyone achieved fan control some other way?

1 Like

See libretech-wiring-tool/libre-computer/roc-rk3328-cc/dt/pwm2.dts at master · libre-computer-project/libretech-wiring-tool · GitHub

There’s no fan overlay. We will add it in the future or you can use the Le Potato ones as a reference and write new overlays for Renegade. We will merge it if you submit a request via GitHub.

I’ll give it a shot. Any pointers on what needs to be changed between the potato and the renegade? I’m a programmer by profession, but I haven’t done anything with device trees before, so this is all new to me

You can reference the files below. The base pwm2 overlay already exists for Renegade.

Base Device Trees

Le Potato Overlays for Fan and Temperature-based Control

The first overlay sets the default GPIO pin bias to be a weak pull up so the fan RPM can be monitored via interrupts. The fan will pull down the GPIO twice every revolution so this is the basis of fan RPM monitoring.

The second overlay adds temperature hystersis values to determine the activation temperatures.

I got it working. See https://github.com/libre-computer-project/libretech-wiring-tool/pull/15 for the PR.

I took a stab at converting the -fan-auto overlay as well, but I can’t figure out how to use it in the Le Potato, nor on the Renegade, so I can’t adequately test it. I have the fan speed governed using fancontrol instead on both machines.

And thank you for the help! I’m glad to have it working and not have to hear that stupidly loud fan all the time any more