Have gpio plugin handle exporting of gpio.
Make the gpio plug in handle the exporting and permissions involved with outputting from gpio. OLAD currently has to be restarted once gpio is exported and has is permissions fixed.
Hi @robotkid450 ,
I don't think its likely. If you take a look here: https://wiki.openlighting.org/index.php/OLA_Device_Specific_Configuration#General_Purpose_I.2FO
You have to run these commands as root; in OLA we do our best to stop you running it as root: https://github.com/OpenLightingProject/ola/blob/9fbd4e4782223135bdf4b75098c0dbf1e3cb65ed/olad/Olad.cpp#L99
Essentially because if we do, bad things can happen to your machine which can be our fault. If we're not root, you can only generally break olad.
I don't think the commands will work as non-root, unless you've done something quite global already, so there's probably not much point in doing so.
I guess the compromise we could do would be to ship a script that reads the relevant olad config file, and does the leg work for you, so you just configure it in OLA and then run the script, rather than needing to tweak all the 23's in that example to the GPIO pins you're using.
As discussed in #1188, pigpiod ( http://abyz.me.uk/rpi/pigpio/pigpiod.html ) may also be of use for this as a workaround for the root issue.
OLAD currently has to be restarted once gpio is exported and has is permissions fixed.
if you are referring to raspberry, then just create a initscript that runs before ola on boot.
@peternewman
in OLA we do our best to stop you running it as root:
And I think that's a good thing
Just to put in a tidbit of information, maybe using the GPIO character device could be good? No more creating / destroying files to export / unexport GPIO pins, and automatic cleanup of reserved pins in case olad crashes. Upstream wants to deprecate the sysfs interface, anyway - see https://www.kernel.org/doc/Documentation/ABI/obsolete/sysfs-gpio . There's a nice C++ library available for this, too - https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/ . Permissions can also be managed much easier, in a sense it's like spidev - but for simple GPIO. It's pretty quick too, you can manage around 400kbit/s while bitbanging SPI on a Rapsberry Pi.
Do you have any reference for the bitbanging SPI using the libgpiod library?