Hi, on board Rock3a, can libmraa be used to control pwm fan?

Hi, as the board Rock3a has a pwm fan interface, and official technical document gives the way to control with echo command, can this interface be controlled by mraa library?
If the answer is “yes”, what is its name to be used in the control source code?

Use c program in /usr/local/share/mraa/examples/c/pwm.c to test:

Modify the macro PWM in /usr/local/share/mraa/examples/c/pwm.c as follows to test PWM0. To test PWM1, change #define PWM 11 to #define PWM 13.

/* PWM declaration */
#define PWM 11
save and compile pwm.c

root@rockpi-4b:/usr/local/share/mraa/examples/c# gcc -o pwm pwm.c -lmraa
root@rockpi-4b:/usr/local/share/mraa/examples/c# ./pwm
PWM value is 0.010045
PWM value is 0.019985
PWM value is 0.030030
PWM value is 0.039971
PWM value is 0.050016
PWM value is 0.059956
PWM value is 0.070001
PWM value is 0.080046

But the problem is , what number does pwm fan interface use?

Hi, I have got a Rock Pi 4 SE, so that i connect the pwm fan signal pin to PIN11 or PIN13 which is can be a PWM channel.
and i’ve got read from https://wiki.radxa.com/Rockpi4/hardware/gpio
and using the test demo to drive the fan, it works fine.

Hi, I have got a Rock Pi 4 SE, so that i connect the pwm fan signal pin to PIN11 or PIN13 which is can be a PWM channel.

On Rock3a, there is a independent pwm fan interface which does not lie in gpio pins.

https://wiki.radxa.com/Rock3/hardware/3a

your board is Rock3a, seems to be another board , i am using ROCK 4 SE … maybe there is a way to drive your fan via pwm, but i don’t know, sorry for that.

Hi @Jacky_Li! Sorry for reviving this old post but I’m trying to get the fan control working on my Rock Pi 4 SE and would need some guidance :slight_smile:
You mentioned that you used the “test demo to drive the fan”. Where did you get that?
Thanks in advance!

1 Like