Jump to content

PWM on an OrangePi 3 (or Lite2)


Anna Vahtera

Recommended Posts

I want to control a fan via a script. I found a bunch of tutorials for pwm, but they were either for older version of Armbian, or for another board. I could not find a tutorial for Allwinner H6 boards.

Apparently simple overlays=pwm doesn't work anymore.

 

Anyone have any pointers as to how to go about it?

 

my goal is to do something like

$ ./setfan.sh 50
Setting Fan Duty Cycle to 50%...

Nothing more complicated. I have a 5V fan for the system and I just want to tune how fast it should run - now it's going full 100% and it's louder than I'd like. I planned to do this with a trimmer but because the world situation and distances, the trimmers will arrive only after several weeks. And while I was thinking about it I figure why not just use the GPIO pins for driving the fan with pwm? Should be easily doable, I think. I just don't know how :)

 

 

 

EDIT: I've been trying with WiringOP (now that I found a recent version that had support), but I've bumbed into another weird problem: The PWM pin on the OPi3 board is (physical) pin #7. If I do "gpio readall", it even lists that pin as "PWM.0" (It has WPi number 2), but when I try to put it into pwm mode (via 'gpio -1 mode 7 pwm' or 'gpio mode 2 pwm'), I only get an error that says:

the pin you choose doesn't support hardware PWM
you can select wiringPi pin 42 for PWM pin
or you can use it in softPwm mode

There is no WPi pin number 42. If I try to enable pwm on that ('gpio mode 42 pwm') I get an error "[pinMode:L1384] the pin:-1 is invaild,please check it over!"

So no dice there either, unfortunately. 

Edited by Anna Vahtera
Added WiringOP tries
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines