This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Script is already running or disabled
#1
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)
LM5Lp, firmware: 2018.08.22 and 2021.12.15, FlashSYS v2, ARMv7 Processor rev 5 (v7l), kernel 4.4.151 and 4.4.259
Reply
#2
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.
Reply
#3
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.
LM5Lp, firmware: 2018.08.22 and 2021.12.15, FlashSYS v2, ARMv7 Processor rev 5 (v7l), kernel 4.4.151 and 4.4.259
Reply
#4
(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)
Reply


Forum Jump: