I wrote a blog post on this a couple weeks ago as I needed to do the same for a software project I had of my own . . . and figured I'd share. Doing the same for the onboard USR LEDs is a bit problematic specifically when one tries to *echo timer > trigger.* *on_delay* and *off_delay* have eluded my so far when attempting to create a udev rule for them. However, I have not completely given up yet.
http://www.embeddedhobbyist.com/2016/05/beaglebone-black-gpio-permissions/ On Thu, Jun 2, 2016 at 11:24 PM, Raul Piper <[email protected]> wrote: > > you can write to gpios by first chmod'ing 666 to the folders and then to > individual attributes. > > On Wednesday, July 1, 2015 at 8:32:48 PM UTC+5:30, Brendan Merna wrote: >> >> >> I'm trying to manipulate my GPIOs using C code and running into >> "Permission Denied" when running my code and opening the file >> /sys/class/gpio/export. I'm using nano editor, compiling on the Beaglebone >> with gcc, and I'm under root user. >> >> I would like to do this, so I can set directions and values for the GPIOs >> with my code. I've heard this might be a problem with user and kernel space >> conflicting. I know there are library calls in python and other languages >> to do this that work. Does anyone know what this problem might be and our >> their alternate calls I can do in C? >> >> I tried to just include the necessary parts of the code. >> Code: >> #include<fcntl.h> >> static const char *GPIO_PATH = "/sys/class/gpio/export"; >> int main(){ >> int file; >> if ((file = open(GPIO_PATH, O_RDWR))<0){ >> perror("GPIO: Can't open the device."); >> return -1; >> } >> return 0; >> } >> > -- > For more options, visit http://beagleboard.org/discuss > --- > You received this message because you are subscribed to the Google Groups > "BeagleBoard" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/beagleboard/fe241815-54f6-4905-a871-e65746420ae4%40googlegroups.com > <https://groups.google.com/d/msgid/beagleboard/fe241815-54f6-4905-a871-e65746420ae4%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- For more options, visit http://beagleboard.org/discuss --- You received this message because you are subscribed to the Google Groups "BeagleBoard" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/CALHSORo%3Danwb54d-v%3DTfH6pT7Bdt7mQCBJQLuQKjk93FNTq7Mw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
