This is on a Raspberry Pi.
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's going on? If I chmod 777 everything, then it works, but I shouldn't have to do that when I own the file.
/sys
is a pseudo-filesystem and in fact an interface of communication with the kernel. Writing in a file in/sys
is like making a request to the kernel so that may require permissions which are not expressed by the file attributes. – lgeorget Mar 08 '14 at 11:24value
, isn't there another file you would have to modify, such asdirection
for example? – lgeorget Mar 08 '14 at 11:37