LUA Scripts not running Topic is solved

Please use template to report bugs and problems. Post here your questions when not sure where else to post
Only for bugs in the Domoticz application! other problems go in different subforums!
Forum rules
Before posting here, make sure you are on the latest Beta or Stable version.
If you have problems related to the web gui, clear your browser cache + appcache first.

Use the following template when posting here:

Version: xxxx
Platform: xxxx
Plugin/Hardware: xxxx
Description:
.....

If you are having problems with scripts/blockly, always post the script (in a spoiler or code tag) or screenshots of your blockly

If you are replying, please do not quote images/code from the first post
DarkAllMan
Posts: 48
Joined: Friday 23 December 2016 10:41
Target OS: Linux
Domoticz version:
Contact:

LUA Scripts not running

Post by DarkAllMan » Monday 10 July 2017 14:24

Since a couple of beta updates ago, it seems that script_device_pass2php.lua is no longer called.
I have added to the first line:

Code: Select all

print('this will end up in the domoticz log')
to see if its running, but nothing shows in the log.
When I revert to the stable release, they start showing up in the log.... when I update back to latest beta, messages stop showing up again.
Who can tell what's going on? Has anyone got the same issues?

jvandenbroek
Posts: 172
Joined: Wednesday 12 March 2014 17:37
Target OS: Raspberry Pi
Domoticz version: beta
Location: The Netherlands
Contact:

Re: LUA Scripts not running

Post by jvandenbroek » Monday 10 July 2017 15:34

Most likely related, see note here: https://www.domoticz.com/wiki/Events#By ... ion_folder..

DarkAllMan
Posts: 48
Joined: Friday 23 December 2016 10:41
Target OS: Linux
Domoticz version:
Contact:

Re: LUA Scripts not running

Post by DarkAllMan » Monday 10 July 2017 15:38

jvandenbroek wrote:Most likely related, see note here: https://www.domoticz.com/wiki/Events#By ... ion_folder..
Am I correct in understanding that if there is no device called pass2php, it will never be called?
Because now it only calls when that device changes?


Nevermind, when it does not find the device name, it calls the script on any device change...
Last edited by DarkAllMan on Monday 10 July 2017 15:40, edited 1 time in total.

jvandenbroek
Posts: 172
Joined: Wednesday 12 March 2014 17:37
Target OS: Raspberry Pi
Domoticz version: beta
Location: The Netherlands
Contact:

Re: LUA Scripts not running

Post by jvandenbroek » Monday 10 July 2017 15:40

DarkAllMan wrote:
jvandenbroek wrote:Most likely related, see note here: https://www.domoticz.com/wiki/Events#By ... ion_folder..
Am I correct in understanding that if there is no device called pass2php, it will never be called?
Because now it only calles when that device changes?
No the opposite, if that device doesn't exist, it should be called on ALL device updates. Make sure you don't have a hidden devices called 'pass2php' (case insensitive)

DarkAllMan
Posts: 48
Joined: Friday 23 December 2016 10:41
Target OS: Linux
Domoticz version:
Contact:

Re: LUA Scripts not running

Post by DarkAllMan » Monday 10 July 2017 15:41

jvandenbroek wrote:
DarkAllMan wrote:
jvandenbroek wrote:Most likely related, see note here: https://www.domoticz.com/wiki/Events#By ... ion_folder..
Am I correct in understanding that if there is no device called pass2php, it will never be called?
Because now it only calles when that device changes?
No the opposite, if that device doesn't exist, it should be called on ALL device updates. Make sure you don't have a hidden devices called 'pass2php' (case insensitive)
There is no (hidden) device called pass2php, but it seems its never called anymore.......
I will try to rename the script to a certain device and see if it runs on that device status change...

jvandenbroek
Posts: 172
Joined: Wednesday 12 March 2014 17:37
Target OS: Raspberry Pi
Domoticz version: beta
Location: The Netherlands
Contact:

Re: LUA Scripts not running

Post by jvandenbroek » Monday 10 July 2017 15:44

DarkAllMan wrote: There is no (hidden) device called pass2php, but it seems its never called anymore.......
I will try to rename the script to a certain device and see if it runs on that device status change...
Well that's not correct then, not sure why this doesn't seem to work for you, works fine here and for others as well since that update. And if you just name it something else? But this name should work just fine...

Edit: which platform are you on? Your forum info says Linux, but is that the case for this installation?

DarkAllMan
Posts: 48
Joined: Friday 23 December 2016 10:41
Target OS: Linux
Domoticz version:
Contact:

Re: LUA Scripts not running

Post by DarkAllMan » Monday 10 July 2017 15:49

jvandenbroek wrote:
DarkAllMan wrote: There is no (hidden) device called pass2php, but it seems its never called anymore.......
I will try to rename the script to a certain device and see if it runs on that device status change...
Well that's not correct then, not sure why this doesn't seem to work for you, works fine here and for others as well since that update. And if you just name it something else? But this name should work just fine...

Edit: which platform are you on? Your forum info says Linux, but is that the case for this installation?
Tried to rename to a certain device, but it was not triggered on this device status change.
Renamed to a random name, which does not exist, still nothing.

I'm on Ubuntu Server.

jvandenbroek
Posts: 172
Joined: Wednesday 12 March 2014 17:37
Target OS: Raspberry Pi
Domoticz version: beta
Location: The Netherlands
Contact:

Re: LUA Scripts not running

Post by jvandenbroek » Monday 10 July 2017 15:51

No Lua errors in log just after a device update?
Can you disable dzVents under settings, restart Domoticz and try again? And I assume you're currently on the latest beta (> v3.8073)?

DarkAllMan
Posts: 48
Joined: Friday 23 December 2016 10:41
Target OS: Linux
Domoticz version:
Contact:

Re: LUA Scripts not running

Post by DarkAllMan » Monday 10 July 2017 16:18

jvandenbroek wrote:No Lua errors in log just after a device update?
Can you disable dzVents under settings, restart Domoticz and try again? And I assume you're currently on the latest beta (> v3.8073)?
No LUA errors!
I'm on V3.8073, disabling dzEvents does not change behaviour.

jvandenbroek
Posts: 172
Joined: Wednesday 12 March 2014 17:37
Target OS: Raspberry Pi
Domoticz version: beta
Location: The Netherlands
Contact:

Re: LUA Scripts not running

Post by jvandenbroek » Monday 10 July 2017 16:34

Could you get the source as described here: https://www.domoticz.com/wiki/Installin ... spberry_PI
Before compiling (make -j 3) edit the file main/EventSystem.cpp, add this line 1260 (just above the line "bool bDeviceFileFound = false;):

Code: Select all

 _log.Log(LOG_STATUS,"EventSystem: Lua directory is %s", lua_Dir.c_str())
This way we know for sure the correct folder is read. Maybe the compiler falsely optimizes the lua_Dir string away, this way we now if that's the case.

DarkAllMan
Posts: 48
Joined: Friday 23 December 2016 10:41
Target OS: Linux
Domoticz version:
Contact:

Re: LUA Scripts not running

Post by DarkAllMan » Monday 10 July 2017 16:45

jvandenbroek wrote:Could you get the source as described here: https://www.domoticz.com/wiki/Installin ... spberry_PI
Before compiling (make -j 3) edit the file main/EventSystem.cpp, add this line 1260 (just above the line "bool bDeviceFileFound = false;):

Code: Select all

 _log.Log(LOG_STATUS,"EventSystem: Lua directory is %s", lua_Dir.c_str())
This way we know for sure the correct folder is read. Maybe the compiler falsely optimizes the lua_Dir string away, this way we now if that's the case.
I will try to continue tonight... although a quick look says, I'm gonna need some extra support...
I think my install was "the easy way"... And I have no clue, what you want me to do....

DarkAllMan
Posts: 48
Joined: Friday 23 December 2016 10:41
Target OS: Linux
Domoticz version:
Contact:

Re: LUA Scripts not running

Post by DarkAllMan » Monday 10 July 2017 20:09

jvandenbroek wrote:Could you get the source as described here: https://www.domoticz.com/wiki/Installin ... spberry_PI
Before compiling (make -j 3) edit the file main/EventSystem.cpp, add this line 1260 (just above the line "bool bDeviceFileFound = false;):

Code: Select all

 _log.Log(LOG_STATUS,"EventSystem: Lua directory is %s", lua_Dir.c_str())
This way we know for sure the correct folder is read. Maybe the compiler falsely optimizes the lua_Dir string away, this way we now if that's the case.
ok, can you please explain what you want me to do, without loosing my current config etc? I'm not sure how to proceed....

jvandenbroek
Posts: 172
Joined: Wednesday 12 March 2014 17:37
Target OS: Raspberry Pi
Domoticz version: beta
Location: The Netherlands
Contact:

Re: LUA Scripts not running

Post by jvandenbroek » Monday 10 July 2017 20:24

DarkAllMan wrote:
jvandenbroek wrote:Could you get the source as described here: https://www.domoticz.com/wiki/Installin ... spberry_PI
Before compiling (make -j 3) edit the file main/EventSystem.cpp, add this line 1260 (just above the line "bool bDeviceFileFound = false;):

Code: Select all

 _log.Log(LOG_STATUS,"EventSystem: Lua directory is %s", lua_Dir.c_str())
This way we know for sure the correct folder is read. Maybe the compiler falsely optimizes the lua_Dir string away, this way we now if that's the case.
ok, can you please explain what you want me to do, without loosing my current config etc? I'm not sure how to proceed....
If you follow the steps one by one and make sure you use another directory where you execute the "git clone" line, you should not worry about losing anything. All settings are in domoticz.db, so you could copy that one over to the new Domoticz directory after compiling.

I can help you if you could provide me ssh access (normal user should be fine, no root needed), just make sure to first install the packages with apt as described. If you don't mind me logging in, send me a DM with details.

Verstuurd vanaf mijn SM-N930F met Tapatalk

DarkAllMan
Posts: 48
Joined: Friday 23 December 2016 10:41
Target OS: Linux
Domoticz version:
Contact:

Re: LUA Scripts not running

Post by DarkAllMan » Monday 10 July 2017 21:55

It seems the LUA is now triggered when running from shell ./domoticz
But when running from system start, its not: systemctl start domoticz

Very strange!

User avatar
jvdz
Posts: 1295
Joined: Tuesday 30 December 2014 20:25
Target OS: Raspberry Pi
Domoticz version: Stable
Location: Westland/Netherlands
Contact:

Re: LUA Scripts not running

Post by jvdz » Tuesday 11 July 2017 9:26

Something with security rights to the files maybe?

Jos

DarkAllMan
Posts: 48
Joined: Friday 23 December 2016 10:41
Target OS: Linux
Domoticz version:
Contact:

Re: LUA Scripts not running

Post by DarkAllMan » Tuesday 11 July 2017 16:17

Permissions seem to be ok...
But I confirmed that LUA is running when calling domoticz from shell and not from systemd (systemctl)

mivo
Posts: 119
Joined: Friday 21 April 2017 8:58
Target OS: Raspberry Pi
Domoticz version: beta
Location: Czechia
Contact:

Re: LUA Scripts not running

Post by mivo » Tuesday 11 July 2017 16:40

Hi,

please review or post here startup script of domoticz (usually /etc/init.d/domoticz.sh).
My toys:
Raspberry Pi 3 + UPS PIco HV3.0 A Stack
Minibian (Raspbian Jessie) + Domoticz beta
RFLink 433 Gateway, 1wire DS18B20 temp sensors (GPIO)
RaZberry module + 2x Comet Z-Wave + Z-wave socket
---
Plugins: WeMo Switch, UPS PIco HV3.0A on GitHub

DarkAllMan
Posts: 48
Joined: Friday 23 December 2016 10:41
Target OS: Linux
Domoticz version:
Contact:

Re: LUA Scripts not running

Post by DarkAllMan » Tuesday 11 July 2017 16:50

mivo wrote:Hi,

please review or post here startup script of domoticz (usually /etc/init.d/domoticz.sh).
/etc/systemd/system/domoticz.service

Code: Select all

[Unit]
       Description=domoticz_service
       After=network.target
[Service]
       User=username
       Group=username
       ExecStart=/home/username/domoticz/domoticz -www 8080
       #WorkingDirectory=/home/domoticz
       #give the right to open priviliged ports
       #ExecStartPre=setcap 'cap_net_bind_service=+ep' /home/username/domoticz/domoticz
       Restart=on-failure
       RestartSec=1m
       KillMode=process
       #StandardOutput=null
[Install]
       WantedBy=multi-user.target
Last edited by DarkAllMan on Wednesday 12 July 2017 8:52, edited 1 time in total.

mivo
Posts: 119
Joined: Friday 21 April 2017 8:58
Target OS: Raspberry Pi
Domoticz version: beta
Location: Czechia
Contact:

Re: LUA Scripts not running

Post by mivo » Tuesday 11 July 2017 17:13

Just for sure - do you try to start Domoticz from shell by user id specified in Systemd unit file ?

Code: Select all

# su - randall
$ /home/username/domoticz/domoticz -www 8080
My toys:
Raspberry Pi 3 + UPS PIco HV3.0 A Stack
Minibian (Raspbian Jessie) + Domoticz beta
RFLink 433 Gateway, 1wire DS18B20 temp sensors (GPIO)
RaZberry module + 2x Comet Z-Wave + Z-wave socket
---
Plugins: WeMo Switch, UPS PIco HV3.0A on GitHub

DarkAllMan
Posts: 48
Joined: Friday 23 December 2016 10:41
Target OS: Linux
Domoticz version:
Contact:

Re: LUA Scripts not running

Post by DarkAllMan » Tuesday 11 July 2017 20:36

mivo wrote:Just for sure - do you try to start Domoticz from shell by user id specified in Systemd unit file ?

Code: Select all

# su - username
$ /home/username/domoticz/domoticz -www 8080
I login with the specified username that's in the code above.
I just go to ~/domoticz and run: ./domoticz
Then LUA is working.

When starting with systemctl start domoticz, LUA is not working.

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests