0
votes

I am attempting to run wiringpi to control the hardware PWM on GPIO 18 on the pi. If I use wiringPiSetupGpio() as below and I run as root everything works. Using wiringPiSetupSys() as documentation suggests does not work, even when ran as root.

import wiringpi
wiringpi.wiringPiSetupGpio() #must use with root access
#wiringpi.wiringPiSetupSys() #can use without root, does not work

wiringpi.pinMode(18,2)
wiringpi.pwmWrite(18,500) # dim led

In order to use the non root method I have exported pin 18 as out and verified it with gpio exports. Can I not use hardware pwm without root or am I missing a fundamental step?

1
something to do with user permissions?Noelkd
@Noelkd I think so. It's a common issue on all Raspberry Pis because the GPIO device is pretty locked down per defaultjDo

1 Answers

0
votes

Found the issue in the docs

This function is not able to control the Pi’s on-board PWM when in Sys mode.