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
Working on a Raspberry Pi 2 on Raspian Stretch, I end up with a weird error. Errno::EACCES: Permission denied @ rb_sysopen - /sys/class/gpio/gpio16/direction
My setup worked couple of time the day before but not anymore. I dig many whatever.overflow to find some help.
My understanding so far. When you write to the export file, a small directory of file is created automatically. I don't know the process that does it, but it happen when you send echo "16" > export
The gpio16 directory is created with a bunch of file. One of them is the direction file. From what I understand the process (again I don't know which one) create it as root/root and launch a chown to make it root/gpio. Instant after the PiPiper::BCM2835 file write the direction file and this conflict with the direction file being root/root.
A was able to solve this by inserting a sleep(0.1) on line 61 of the file lib/pi_piper/bcm2835.rb
Not the most elegant, but get the job done.
As a much better solution I see 3 ways,
This sleep
A catch of the Errno::EACCES error with a retry
Modify the setting of the process creating the direction to set the proper user/group right away
A also recompile the .SO file to the latest version and this help on some other permission issues
I'm just the application guy and most likely people used to low level programming are much better at solving this than me.
The text was updated successfully, but these errors were encountered:
Working on a Raspberry Pi 2 on Raspian Stretch, I end up with a weird error.
Errno::EACCES: Permission denied @ rb_sysopen - /sys/class/gpio/gpio16/direction
My setup worked couple of time the day before but not anymore. I dig many whatever.overflow to find some help.
My understanding so far. When you write to the export file, a small directory of file is created automatically. I don't know the process that does it, but it happen when you send
echo "16" > export
The gpio16 directory is created with a bunch of file. One of them is the direction file. From what I understand the process (again I don't know which one) create it as root/root and launch a chown to make it root/gpio. Instant after the PiPiper::BCM2835 file write the direction file and this conflict with the direction file being root/root.
A was able to solve this by inserting a
sleep(0.1)
on line 61 of the file lib/pi_piper/bcm2835.rbNot the most elegant, but get the job done.
As a much better solution I see 3 ways,
A also recompile the .SO file to the latest version and this help on some other permission issues
I'm just the application guy and most likely people used to low level programming are much better at solving this than me.
The text was updated successfully, but these errors were encountered: