-bash: /sys/class/gpio/export: Permission denied

Hello, i am new at linux… I use bbb with debian and usb remote desktop
I try this command on terminal:
/sys/class/gpio/export

I always receive: -bash: /sys/class/gpio/export: Permission denied

I also have change the permisson on the gpio folder per GUI… but without success??

ThankYou

https://www.kernel.org/doc/Documentation/gpio/sysfs.txt

Regards,
John

Have you tried the following command
:> sudo echo NN > /sys/class/gpio/export
where NN is the gpio device that you want to work with.
If root, you don't need sudo.

Chad

Hello, i am new at linux… I use bbb with debian and usb remote desktop
I try this command on terminal:
/sys/class/gpio/export

I always receive: -bash: /sys/class/gpio/export: Permission denied

I also have change the permisson on the gpio folder per GUI… but without success??

ThankYou

First of all /sys/class/gpio/export is not a command. /sys/class/gpio/export is a path to a pseudo file. Additionally, this file very likely has write permissions only, so attempting to read from this “file” may always fail regardless of the users permissions.

As stated by another person already, you echo(write) a valid value into this file, and then the gpio system drivers enables a related gpio pin for you. In order to reverse this process, you would echo(write) this same value into the unexport pseudo file.

HI,

I had the same problem and I’ve solve it by giving full permissions to read, write and execute
cd /sys/class/gpio
chmod 777 export

But probably you just need to give write permission to the file

1 Like