You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm running Linux 5.15.16 and I get a Permission denied: '/sys/class/gpio/export' error when instantiating GPIOPin.
I think the FMODE should not be w+ but simply w:
root@sam:~# stat /sys/class/gpio/export
File: /sys/class/gpio/export
Size: 4096 Blocks: 0 IO Block: 4096 regular file
Device: 11h/17d Inode: 2618 Links: 1
Access: (0200/--w-------) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2022-01-18 11:35:45.430000000 +0000
Modify: 2022-01-18 11:35:45.430000000 +0000
Change: 2022-01-18 11:35:45.430000000 +0000
root@sam:~#
root@sam:~#
root@sam:~# python3
Python 3.10.2 (main, Jan 13 2022, 19:06:22) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import gpio
>>> gpio.GPIOPin(10)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.10/site-packages/gpio/__init__.py", line 49, in __init__
with open(GPIO_EXPORT, FMODE) as f:
PermissionError: [Errno 13] Permission denied: '/sys/class/gpio/export'
>>>
>>>
>>>
>>>
>>> print(gpio.FMODE)
w+
>>>
>>>
>>> print(gpio.GPIO_EXPORT)
/sys/class/gpio/export
>>>
>>>
>>>
>>>
>>> with open(gpio.GPIO_EXPORT, "w+") as f:
... print("OK")
...
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
PermissionError: [Errno 13] Permission denied: '/sys/class/gpio/export'
>>>
>>>
>>>
>>> with open(gpio.GPIO_EXPORT, "w") as f:
... print("OK")
...
OK
>>>
The text was updated successfully, but these errors were encountered:
Hi,
I'm running Linux 5.15.16 and I get a
Permission denied: '/sys/class/gpio/export'
error when instantiatingGPIOPin
.I think the FMODE should not be
w+
but simplyw
:The text was updated successfully, but these errors were encountered: