Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Koneki » running Lua Remote Application - Permission denied
running Lua Remote Application - Permission denied [message #1062903] Tue, 11 June 2013 06:34 Go to next message
Marc Zesty is currently offline Marc Zesty
Messages: 3
Registered: June 2013
Junior Member
Hello Guys,

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"

Question:
How to run a remote script as superuser to access GPIO?

Sorry, of course you should know ... I'm using a Raspberry Pi

Kind Regards
Re: running Lua Remote Application - Permission denied [message #1062904 is a reply to message #1062903] Tue, 11 June 2013 06:46 Go to previous messageGo to next message
Benjamin Cabé is currently offline Benjamin Cabé
Messages: 151
Registered: July 2009
Location: Toulouse, France
Senior Member

Hello Marc,

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

Re: running Lua Remote Application - Permission denied [message #1062909 is a reply to message #1062904] Tue, 11 June 2013 07:11 Go to previous messageGo to next message
Marc Zesty is currently offline Marc Zesty
Messages: 3
Registered: June 2013
Junior Member
Hello Benjamin,

of course I looked at Mihini Wink.
But I found a statement at sierrawireless .. eclipsecon2013-m2m-tutorial .. slides .. (I'm not allowed to post a link)
-> Local communication protocols
-> Many more to come! (e.g. GPIO)

So I thought GPIO is a future thing.

In addition I need for local use on my RasPi I2C and Modbus-ethernet (SPI nice to have)

Thank you for taking the time ...

Re: running Lua Remote Application - Permission denied [message #1062916 is a reply to message #1062909] Tue, 11 June 2013 07:48 Go to previous messageGo to next message
Marc Zesty is currently offline Marc Zesty
Messages: 3
Registered: June 2013
Junior Member
Hello Benjamin,

the tutorial from the link you posted is working.
Now I can run my lua script remote with GPIO access.
Great

Thank you
Re: running Lua Remote Application - Permission denied [message #1063063 is a reply to message #1062916] Wed, 12 June 2013 00:45 Go to previous message
Benjamin Cabé is currently offline Benjamin Cabé
Messages: 151
Registered: July 2009
Location: Toulouse, France
Senior Member

Awesome! Smile
I would highly encourage you to give feedback to the Mihini people on the project mailing list https://dev.eclipse.org/mailman/listinfo/mihini-dev
I2C would be a nice addition and I believe there is a bug tracking that already in Mihini's bug tracker.
Regarding Modbus ethernet, this should be available already ; have you had problems with the API? See http://www.eclipse.org/mihini/api-documentation/modbustcp.html

Cheers!
Benjamin.
Previous Topic:Windows Koneki and Corona first steps setup
Next Topic:Does code assistance only work if you have the lua module associated with the documents
Goto Forum:
  


Current Time: Thu Jul 24 21:54:02 EDT 2014

Powered by FUDForum. Page generated in 0.03028 seconds