This is driving me crazy.
I do this:
cameron@raspberrypi ~ $ gpio export 18 out
Then here's the output of sudo ls -lL /sys/class/gpio/gpio18:
-rwxrwx--- 1 root gpio 4096 Mar 8 10:50 active_low
-rwxrwx--- 1 root gpio 4096 Mar 8 10:52 direction
-rwxrwx--- 1 cameron cameron 4096 Mar 8 10:50 edge
drwxrwx--- 2 root gpio 0 Mar 8 10:50 power
drwxrwx--- 2 root gpio 0 Mar 8 10:50 subsystem
-rwxrwx--- 1 root gpio 4096 Mar 8 10:50 uevent
-rwxrwx--- 1 cameron cameron 4096 Mar 8 10:50 value
So looks like I should now have access to value, great. However:
cameron@raspberrypi~ $ echo 1 > /sys/class/gpio/gpio18/value
-bash: /sys/class/gpio/gpio18/value: Permission denied
What gives? I thought this was the correct way to set up a GPIO pin for a non-root user to access it.
sudo
, asgpio
sets ownership to the user that runs it. What doesgpio readall
show?