Olimex Support Forum

OLinuXino Android / Linux boards and System On Modules => A64 => Topic started by: Nitish on August 21, 2021, 07:24:54 AM

Title: Permission Error 13 in python for gpio
Post by: Nitish on August 21, 2021, 07:24:54 AM
using pyA64 library for development but getting permission error on gpio.init() function.
don't understand how to solve this.
BTW i'm new to linux development.
please help!
thanks in advance.
Title: Re: Permission Error 13 in python for gpio
Post by: LubOlimex on August 23, 2021, 10:28:46 AM
Follow chapter 8.5 from this guide:

https://github.com/OLIMEX/OLINUXINO/blob/master/DOCUMENTS/OLIMAGE/Olimage-guide.pdf
Title: Re: Permission Error 13 in python for gpio
Post by: Nitish on August 23, 2021, 11:45:01 AM
I've already read it and it works with sysfs but when i write a python code with pyA64 library it gives permission error.
followed all directions to install python too but didn work for me.
error persist.
Title: Re: Permission Error 13 in python for gpio
Post by: LubOlimex on August 24, 2021, 08:20:55 AM
Did you export the GPIO you are testing with? Did you try with other GPIOs?
Title: Re: Permission Error 13 in python for gpio
Post by: Nitish on August 24, 2021, 09:49:59 AM
from pyA64.gpio import gpio
from pyA64.gpio import port
from pyA64.gpio import connector

#pin = port.PE15


pin = (5-1)*32+15

gpio.init()

gpio.setcfg(pin, gpio.OUTPUT)
gpio.output(pin, 1)



this is the code.
gpio143 already exported and its shows in list.

ERROR : gpio.init()
        PermissionError: [Error 13] Permission denied

Even other pins I've tried but same error occurs.

Do i need to do anything else for this error?
Title: Re: Permission Error 13 in python for gpio
Post by: JohnS on August 24, 2021, 05:38:46 PM
If that's Linux error 13 it's a lack of permission.

John
Title: Re: Permission Error 13 in python for gpio
Post by: Nitish on August 25, 2021, 07:31:38 AM
Thanks Guys for Help.
Finally, its working.
I changed permission of every file of pyA64 and it worked.
But there's one issue with it is, pin PB0 to PB4 isnt working with it.
Is there any solution to this?
Title: Re: Permission Error 13 in python for gpio
Post by: LubOlimex on August 25, 2021, 09:34:44 AM
The problem is in the pyA64 project. It is outdated, it was made for Armbian and probably is not updated for Olimage images.

Check this old thread for the same issue:

https://www.olimex.com/forum/index.php?topic=8046.0
Title: Re: Permission Error 13 in python for gpio
Post by: Nitish on August 26, 2021, 12:11:47 PM
Okay thnx.