Power & Source of Big Ideas

Control PMW with Wiringpi on M4

Moderators: chensy, FATechsupport

Hi,

my main goal is to install a fan and control it's speed. I have a Noctua fan with PWM support. I've tested the functionality on a raspberry pi 3B+ with the GPIO.18 pin that generates PWM.

I have a bunch of questions about how to replicate this on a Nanopi M4. I'm not experienced in electronics, so please don't get mad if I say something stupid, I'm just trying to learn.

- Is there a GPIO pin on a NonoPI that generates a PWM signal? I saw that there is one on the 24-pin header, but I don't know how to use it.
- Can I set the PWM with Wiringpi? This is the main library that I use so script something with GPIO. According to http://wiki.friendlyarm.com/wiki/index. ... t_value.29 I should be able to set a pin mode to PWM_OUTPUT, but it gives me a warning: pinMode : Unknown Mode 3
- I would be very thankful for any other recommendations as my nanopi overheats very fast without a fan and it's a bit too noisy to have the fan running at 100% all the time
According to RK3399 Wiki / PWM you should (as root):

Export PWM0 to users
echo 0 > /sys/class/pwm/pwmchip1/export

Control a PWM fan's speed by setting the PWM's period and duty_cycle.
echo 0 > /sys/class/pwm/pwmchip1/pwm0/enable
echo 50000 > /sys/class/pwm/pwmchip1/pwm0/period
echo 1 > /sys/class/pwm/pwmchip1/pwm0/enable
echo 45000 > /sys/class/pwm/pwmchip1/pwm0/duty_cycle


I am running Armbian on my M4 and it works perfectly.
May I ask what version of armbian are you using? I have tried it on friendlydesktop and friendlycore and it does not work, the fan just spins at full speed all the time.
grm wrote:
May I ask what version of armbian are you using? I have tried it on friendlydesktop and friendlycore and it does not work, the fan just spins at full speed all the time mcdvoice

yeah same problem with me
peguerosdc wrote:
According to RK3399 Wiki / PWM you should (as root): acaeronetExport PWM0 to users
echo 0 > /sys/class/pwm/pwmchip1/export

Control a PWM fan's speed by setting the PWM's period and duty_cycle.
echo 0 > /sys/class/pwm/pwmchip1/pwm0/enable
echo 50000 > /sys/class/pwm/pwmchip1/pwm0/period
echo 1 > /sys/class/pwm/pwmchip1/pwm0/enable
echo 45000 > /sys/class/pwm/pwmchip1/pwm0/duty_cycle


I am running Armbian on my M4 and it works perfectly.


Which version of armbian are you using?
grm wrote:
May I ask what version of armbian are you using? I have tried it on friendlydesktop and friendlycore and it does not work, the fan just spins at full speed all the time.

hey,

I also have this problem, if someone has a solution, please tell me

Regards.:) 9apps apk cartoon hd

Who is online

In total there are 12 users online :: 0 registered, 0 hidden and 12 guests (based on users active over the past 5 minutes)
Most users ever online was 5185 on Wed Jan 22, 2020 1:44 pm

Users browsing this forum: No registered users and 12 guests