Logic Machine Forum
Script is already running or disabled - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: Script is already running or disabled (/showthread.php?tid=1030)



Script is already running or disabled - Thomas - 06.10.2017

Hi
a week ago my scheduled script has stopped working. If I try to start it manually I get messagebox saying "Script is already running or disabled".

I don't believe the message but:
Script is not disabled.
Can I check if the script is already running?
Can I kill the running script?

The script is used for sending data to Weather Underground PWS site. It's extremely simple. I don't see any possibility of endless loop here.

Code:
require("user.ecl_weather")

lt_url_table = {
dateutc=os.date("!%F %T"),
action="updateraw",
ID="XXXXXX",
PASSWORD="xxxxx",
softwaretype="PWS Jung 2225WSU",
windspeedmph=grp.getvalue('7/2/25')*2.237, -- m/s to mph multiply by 2.237
humidity=grp.getvalue('7/2/2'),
tempf=celsius_to_fahrenheit(grp.getvalue('7/2/1')),
solarradiation=grp.getvalue('7/2/24'),
winddir=grp.getvalue('7/2/19'),
baromin=(grp.getvalue('7/2/12')*100)/3386.388667, -- 1 pascal = 0.000295299830714 inches of mercury inverted because of rounding issue 3386,388667
dewptf=celsius_to_fahrenheit(grp.getvalue('7/2/23'))
}
ls_url="https://weatherstation.wunderground.com/weatherstation/updateweatherstation.php?"..url_encode(lt_url_table)

https = require("ssl.https")
https.request (ls_url)



RE: Script is already running or disabled - admin - 09.10.2017

Go to System Config > Status > Running processes. Find line containing "lua /lib/genohm-scada/core/scripting-scheduled.lua" and kill it. The reason is probably SSL getting stuck somewhere.


RE: Script is already running or disabled - Thomas - 09.10.2017

Thank you.
Can I set timeout for ssl operations?
Can I set time limit for script execution?
It's potentially dangerous if a script can hangs in this way.


RE: Script is already running or disabled - mooselight - 17.02.2018

(09.10.2017, 12:34)Thomas Wrote: Thank you.
Can I set timeout for ssl operations?
Can I set time limit for script execution?
It's potentially dangerous if a script can hangs in this way.

Hi there !
I've exactly the same problem, my 2 scheduled scripts are hanging every week or so. For now, I manually reboot my LM, but I would like to find the cause of the hang.
My scripts are very simple .. just get some grp value on the bus and report them to emoncms via SSL.  
Here is the code of one of the scripts.
Is there any solution to make them more "resilient" to SSL problems ?
Thanks for any help

PS/ I did not have that problem a few month ago .. so maybe emoncms is getting to busy and slow to answer requests ?

Code:
-- load required modules
require("ssl.https")

local emoncms_url = 'https://emoncms.org/input/post?node=Q350&apikey=############################'

local Q350_airflow = grp.getvalue ('0/2/70')
local Q350_extract_T = grp.getvalue ('0/2/74')
local Q350_exhaust_T = grp.getvalue ('0/2/75')
local Q350_outdoor_T = grp.getvalue ('0/2/76')
local Q350_supply_T = grp.getvalue ('0/2/77')
local Q350_extract_H = grp.getvalue ('0/2/104')
local Q350_exhaust_H = grp.getvalue ('0/2/105')
local Q350_outdoor_H = grp.getvalue ('0/2/106')
local Q350_supply_H = grp.getvalue ('0/2/107')
local Q350_rendement = grp.getvalue ('2/1/1')

local json_data = '&fulljson={%22Q350_airflow%22:' .. Q350_airflow
json_data = json_data .. ',%22Q350_extract_T%22:' .. Q350_extract_T
json_data = json_data .. ',%22Q350_exhaust_T%22:'.. Q350_exhaust_T
json_data = json_data .. ',%22Q350_outdoor_T%22:' .. Q350_outdoor_T
json_data = json_data .. ',%22Q350_supply_T%22:' .. Q350_supply_T
json_data = json_data .. ',%22Q350_extract_H%22:' .. Q350_extract_H
json_data = json_data .. ',%22Q350_exhaust_H%22:' .. Q350_exhaust_H
json_data = json_data .. ',%22Q350_outdoor_H%22:' .. Q350_outdoor_H
json_data = json_data .. ',%22Q350_supply_H%22:' .. Q350_supply_H
json_data = json_data .. ',%22Q350_rendement%22:' .. Q350_rendement
json_data = json_data .. '}'

ssl.https.TIMEOUT = 5
data,err = ssl.https.request(emoncms_url,json_data)