Open rsg98 opened 7 years ago
Looks like softPWM requires one of the root WiringPi setup modes - which would go against trying to run homebridge as a non-root user.
We could look at using the built in hardware PWM on the Pi (but that only gives you two channels and kills the audio) - http://www.jumpnowtek.com/rpi/Using-the-Raspberry-Pi-Hardware-PWM-timers.html
...or using I2C to speak to a multi-channel hardware PWM board like the AdaFruit one (https://www.adafruit.com/product/815).
...or find a library other than WiringPi that offers a SoftPWM accessible to non-root
I think my preference would be one of the hardware PWM options, as we can then use the same sysfs interface to get non-root access (albeit, not via WiringPi)
For me two outputs are enough, but other users may need more. I also think its easier and safer to handle the request with the hardware PWM. I searched a bit on the web but I didn't find any library that supports softPWM, except wiringPi.
@mv1993 request - add a Brightness characteristic that's hooked into SoftPWM - enable dimming of LEDs