gpio icon indicating copy to clipboard operation
gpio copied to clipboard

PermissionError

Open mthd98 opened this issue 7 years ago • 6 comments

hi vitiyal i have problem can you help me to fix it iam using nvidia jetson tx2 and i'm new user for Ubuntu

PermissionError(388, 'Permission denied')

/home/nvidia/.local/lib/python3.5/site-packages/gpio.py(75)wrapped() -> with open(pjoin(gpio_root, 'export'), 'w') as f:

how i can fix it

mthd98 avatar Aug 27 '18 21:08 mthd98

You may need to configure your privileges. Try running your script with "sudo", i.e. "sudo python myscript.py" and see if that works.

vitiral avatar Aug 27 '18 22:08 vitiral

Running python in sudo should fix this. Also make sure you aren't using using any commands, like gpio.output(), before doing gpio.setup. This will also return a permission error. I recently wrote a little tutorial for this library running on Jetson TX2 over on the nvidia devtalk site: https://devtalk.nvidia.com/default/topic/1030443/using-gpio-on-nvidia-jetson-tx2/?offset=4#5330619

jreindel avatar Apr 17 '19 21:04 jreindel

hi everyone

https://github.com/vitiral/gpio/blob/fd8e954321abf2746057f7a4085ba47a5a552e60/gpio/init.py#L19

i found that when fmode is w+ will throw a error even run with sudo

PermissionError: [Errno 13] Permission denied: '/sys/class/gpio/export'

but change it to w can resolve this problem

rhjdvsgsgks avatar Dec 01 '21 17:12 rhjdvsgsgks

Curious. I wonder if this is true in all cases, or if we should add a way to customise FMODE.

Gadgetoid avatar Dec 01 '21 20:12 Gadgetoid

hi everyone

https://github.com/vitiral/gpio/blob/fd8e954321abf2746057f7a4085ba47a5a552e60/gpio/init.py#L19

i found that when fmode is w+ will throw a error even run with sudo

PermissionError: [Errno 13] Permission denied: '/sys/class/gpio/export'

but change it to w can resolve this problem

same for me, running version 1.0.0. Maybe add a way for controlling F mode per pin?

some of them only need to be output only.

thanks

VyCOSystems avatar Feb 15 '23 07:02 VyCOSystems

sounds like a reasonable feature/setting to add when creating pins

vitiral avatar Feb 15 '23 13:02 vitiral