lua error returned: 32256

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.
Post Reply
mistreg94
Posts: 6
Joined: Saturday 13 December 2014 13:51
Target OS: Raspberry Pi
Domoticz version:
Contact:

lua error returned: 32256

Post by mistreg94 » Friday 16 January 2015 1:50

Hello everybody,

I can not use the command line " os.execute" in a lua script.
I get the following error:

Code: Select all

Error: Error executing script command (/home/pi/domoticz/scripts/lua/script_device_hyperion.lua). returned: 32256
I created a virtual hardware "Equipement Virtuel" :
Image

I add a new "Manual Light/Switch" on my hardware "Equipement Virtuel" :
Image

I attached the script (script:///home/pi/domoticz/scripts/lua/script_device_hyperion.lua) on my switch Hyperion :
Image

Here are the contents of my folder "lua" :
Image

Here is the code of my script "script_device_hyperion.lua" :

Code: Select all

commandArray = {}
if (devicechanged['Hyperion'] == 'Off') then
      commandArray['Lumière Salon']='On'
      os.execute ('/home/pi/domoticz/scripts/lua/script-ssh_reboot-hyperion.sh')
end
return commandArray
Here is the code of my script "script-ssh_reboot-hyperion.sh" :

Code: Select all

#!/bin/bash
ssh root:openelec@192.168.1.60 //storage/reboot_hyperion.sh
When I run the script "script-ssh_reboot-hyperion.sh" in a terminal, it works well :
Image

When I press my button "Hyperion," the light of my living room lights ("Lumière Salon").
But my script "script-ssh_reboot-hyperion.sh" is not executes and I get the following logs:
Image

Can you help me ???
Thank you.

misterg94
raspberry B+ / raspbian wheezy / domoticz V2.2151 / RFXtrx433E & Aeon Z-Stick S2
raspberry B+ / openelec with Hyperion / Lightberry

mistreg94
Posts: 6
Joined: Saturday 13 December 2014 13:51
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: lua error returned: 32256

Post by mistreg94 » Friday 16 January 2015 21:19

I found my problem!

Domoticz uses "root" to launch scripts.

I had only generated an ssh key for "pi".

Here are the actions that I realized :

Code: Select all

1/ I chose a new password for"root"
pi@domoticzpi $ sudo passwd root

2/ I log in "root" :
pi@domoticzpi $ sudo passwd root

3/ I generate a new ssh key :
root@domoticzpi: ssh-keygen -t rsa

4/ I export this new key on my other server
Further, in my code, the ' were not good :

Code: Select all

os.execute ('/home/pi/domoticz/scripts/lua/script-ssh_reboot-hyperion.sh')
raspberry B+ / raspbian wheezy / domoticz V2.2151 / RFXtrx433E & Aeon Z-Stick S2
raspberry B+ / openelec with Hyperion / Lightberry

mistreg94
Posts: 6
Joined: Saturday 13 December 2014 13:51
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: lua error returned: 32256

Post by mistreg94 » Friday 16 January 2015 21:28

I deleted "script-ssh_reboot-hyperion.sh" and I modified "script_device_hyperion.lua" like this :

Code: Select all

commandArray = {}
if (devicechanged['Hyperion'] == 'Off') then
      os.execute ('ssh root:openelec@192.168.1.60 //storage/reboot_hyperion.sh')
end
return commandArray
problem solved
raspberry B+ / raspbian wheezy / domoticz V2.2151 / RFXtrx433E & Aeon Z-Stick S2
raspberry B+ / openelec with Hyperion / Lightberry

ArturK
Posts: 16
Joined: Tuesday 16 June 2015 19:52
Target OS: Raspberry Pi
Domoticz version:
Contact:

lua error returned: 32256 - solution

Post by ArturK » Saturday 15 October 2016 14:29

My simple solution for error 32256 is to change permission rights to the script *.sh. You don't have rights, change it to 0777 (rwxrwxrwx) and that's all.
Raspberry Pi 2B, Logitech Harmony Hub, Z-Stick GEN 5.

siklosi
Posts: 34
Joined: Sunday 06 September 2015 10:50
Target OS: Raspberry Pi
Domoticz version:
Location: Belgrade
Contact:

Re: lua error returned: 32256

Post by siklosi » Saturday 15 October 2016 16:51

Also if you encounter error 512 then you need to add #!/usr/bin/lua at the beginning of script ;) (been there, done that :D)

ErikAtSpijk
Posts: 16
Joined: Sunday 11 March 2018 23:03
Target OS: Raspberry Pi
Domoticz version: 3.8153
Contact:

Re: lua error returned: 32256

Post by ErikAtSpijk » Sunday 02 December 2018 21:32

Thanks, had the excact same two problems

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest