|running Lua Remote Application - Permission denied [message #1062903]
||Tue, 11 June 2013 06:34
| Marc Zesty
Registered: June 2013
i try to run a script via Remote, but I get following Error Message:
sh: 1: cannot create /sys/class/gpio/export: Permission denied
> os.execute("echo GPIO4 > /sys/class/gpio/export")
> os.execute("echo out > /sys/class/gpio/gpio4/direction")
> os.execute("echo 1 > /sys/class/gpio/gpio4/value")
> os.execute("echo 0 > /sys/class/gpio/gpio4/value")
works fine in ssh Terminal when I start the interpreter with "sudo lua"
How to run a remote script as superuser to access GPIO?
Sorry, of course you should know ... I'm using a Raspberry Pi
|Re: running Lua Remote Application - Permission denied [message #1062904 is a reply to message #1062903]
||Tue, 11 June 2013 06:46
| Benjamin Cabé
Registered: July 2009
Location: Toulouse, France
As you noticed you should be a superuser indeed for manipulating the GPIO. Therefore, instead of connecting to your remote system using pi/raspberry as I am pretty sure you are doing, you should rather create a root user and then configure your remote system in Eclipse to use this login.
Enabling the root user is pretty simple, see http://www.instructables.com/id/Control-Stuff-with-your-Raspberry-Pi-GPIO/step2/Root-account/
Also, maybe doing something as the following should work, maybe?
> os.execute("sudo echo GPIO4 > /sys/class/gpio/export")
On a side note, have you looked at Mihini? We are working on providing a nice GPIO API in it (see this branch) but that still requires super-privileges.
[Updated on: Tue, 11 June 2013 06:46]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.02856 seconds