Page 1 of 1

Lua scripting kaku

Posted: Thursday 21 January 2016 21:28
by riegman
Hi,

I try to call a script for my kaku devices.

The log is written but the script won't run.

Can someone help me with this newbie question?

Thanks in advance.

Greetings,
Robin

Code: Select all

-- script name : script_device_kaku.lua

local sensor = 'Lamp1'

commandArray = {}

if (devicechanged[sensor] == 'On') then
os.execute ("sudo ~/wiringPi/examples/lights/kaku A 1 on")
print ('Aan!!!')
else
os.execute ("sudo ~/wiringPi/examples/lights/kaku A 1 off")
print ('Uit!!!!!!!')
end

return commandArray

Re: Lua scripting kaku

Posted: Thursday 21 January 2016 21:44
by SweetPants
I think your problem is the 'sudo'. It needs a password i think

Re: Lua scripting kaku

Posted: Thursday 21 January 2016 22:27
by riegman
Isn't that only needed when I use su?

Re: Lua scripting kaku

Posted: Friday 22 January 2016 7:24
by jannl
That depends on the sudo settings. When you issue the command commandline, does it work?

Re: Lua scripting kaku

Posted: Friday 22 January 2016 8:36
by riegman
When I run it on command line it works and no password is asked.