25.10.2018, 12:36
(25.10.2018, 10:02)admin Wrote: Do you mean cloud access or remote http services?
It can be just coincidence but since I turned remote requests off my LM is still on with no interruption. Unfortunately the issue is hardly reproducible because it happens once or twice a day.
Remote HTTP access (object set as "export", Remote service Enabled)
I use this service for data exchange between our attendance system and KNX.
The attendance system simply sends update request when doors are opened/closed.
The request looks like this: http://LM_name/scada-remote?m=json&r=grp...1;&value=1
Another interesting part is sometimes response from LM to remote request is extremely slow. I had to set timeout for reply to 20s.
Code written in C# I use in the interface between ACS and LM is simple and is below. It uses synchronous GetResponse .NET 4.0 functionality.
Code:
public HttpStatusCode HttpGetSync(string urlParams)
{
string uri;
HttpStatusCode statusCode = HttpStatusCode.BadRequest;
if (!(restapi.url.Length > 0)) return statusCode;
if (!(urlParams.Length > 0)) return statusCode;
uri = restapi.url + urlParams;
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);
if (netCredential != null)
{
request.Credentials = netCredential;
request.PreAuthenticate = true;
}
request.Method = "GET";
if (restapi.timeout > 0)
{
request.Timeout = restapi.timeout;
request.ServicePoint.ConnectionLeaseTimeout = restapi.timeout;
request.ServicePoint.MaxIdleTime = restapi.timeout;
}
request.ContentType = "text/html";
request.CachePolicy = reqCachePolicy;
request.Proxy = null;
request.KeepAlive = false;
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse()) {
statusCode=response.StatusCode;
response.Close();
} ;
request.Abort();
GC.Collect();
return statusCode;
}
LM5Lp, firmware: 2018.08.22 and 2021.12.15, FlashSYS v2, ARMv7 Processor rev 5 (v7l), kernel 4.4.151 and 4.4.259