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.

Moderators: leecollings, remb0

Post Reply
mistreg94
Posts: 3
Joined: Saturday 13 December 2014 12:51
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

lua error returned: 32256

Post by mistreg94 »

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:[email protected] //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: 3
Joined: Saturday 13 December 2014 12:51
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: lua error returned: 32256

Post by mistreg94 »

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: 3
Joined: Saturday 13 December 2014 12:51
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: lua error returned: 32256

Post by mistreg94 »

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:[email protected] //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: 7
Joined: Tuesday 16 June 2015 19:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

lua error returned: 32256 - solution

Post by ArturK »

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.
ErikAtSpijk
Posts: 16
Joined: Sunday 11 March 2018 22:03
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10717
Contact:

Re: lua error returned: 32256

Post by ErikAtSpijk »

Thanks, had the excact same two problems
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest