May be not the right place, but ran again that on the RPi platform.
I want to have - say - an output on the RPi. I'm user pi. I'm in gpio group. I say 'echo 26 > /sys/class/gpio/export'. Works. I then say 'echo out > /sys/class/gpio/gpio26/direction'. Works, too. I can now set or clear that pin from bash. Okay.
I do 'echo 26 > /sys/class/gpio/unexport', then.
Now, I launch that script:
#!/bin/bash echo 26 > /sys/class/gpio/export echo out > /sys/class/gpio/gpio26/direction
This throws permission denied in line 3, accessing the direction file.
After unexporting the GPIO 26, I patch my script. It now looks like
#!/bin/bash echo 26 > /sys/class/gpio/export sleep 1 echo out > /sys/class/gpio/gpio26/direction
Any known reason?