Posts: 62
Threads: 14
Joined: Mar 2017
Reputation:
0
Hello:
I need to share values between group address from different logicMachine located in different buildings. Whats the best way or the best protocol, (the best secure) to get it??.
best regards
Posts: 4645
Threads: 24
Joined: Aug 2017
Reputation:
207
If they are located on same network you can use KNX IP secure. If they are not then you can use MQTT but you need broker somewhere. You can even use our cloud. If you add all LMs to the same cloud network then objects added to cloud will exchange data. Objects added to mosaic are the one exported to cloud or you can tag objects with tag 'lmcloud'
------------------------------
Ctrl+F5
Posts: 62
Threads: 14
Joined: Mar 2017
Reputation:
0
(15.03.2022, 16:42)Daniel Wrote: If they are located on same network you can use KNX IP secure. If they are not then you can use MQTT but you need broker somewhere. You can even use our cloud. If you add all LMs to the same cloud network then objects added to cloud will exchange data. Objects added to mosaic are the one exported to cloud or you can tag objects with tag 'lmcloud'
Thank you Daniel:
They are not on the same network, maybe cloud solution is a good idea thank a lot...
I'll expose what I want for any other comments, all ideas are welcome.
I have one logicMachine like "Master" and others maybe 20 like "Slaves", reporting its status, ones an hour. Now the LM "slaves" comunicate it status using remote services:
http://remote:remote@192.168.0.10/scada-...value=true
but I want to know if there is a better (secure way) to do that because I dont want to send user:password by url ..... thinking always in security. Is there a way to send that password encripted? or may be i am demanding so much, and all of this is not fully necessary.
Sorry I ask this from my ignorance on the subject.
best regard..., and thank all...
Posts: 7762
Threads: 42
Joined: Jun 2015
Reputation:
447
You can use HTTPS for remote services.
Posts: 62
Threads: 14
Joined: Mar 2017
Reputation:
0
(17.03.2022, 10:14)admin Wrote: You can use HTTPS for remote services.
Hello admin:
How could I use HTTPS for remote services?, I am trying :
https://remote:remote@192.168.0.10/scada-...value=true;
but it doesnt work, and also I dont want to send user and password in the url, any example in the forum?. Sorry my ignorance about those subjects..
bestregards, Thank..
Posts: 7762
Threads: 42
Joined: Jun 2015
Reputation:
447
If you are trying via browser you might see a security notification that a self-signed certificate is used. You have to accept it and it will work. No extra configuration is needed from LM, just change http to https in your script and it should work. There's no other way to pass credentials but to set them in the URL. But if you are using HTTPS it will be encrypted.
Posts: 62
Threads: 14
Joined: Mar 2017
Reputation:
0
(18.03.2022, 14:50)admin Wrote: If you are trying via browser you might see a security notification that a self-signed certificate is used. You have to accept it and it will work. No extra configuration is needed from LM, just change http to https in your script and it should work. There's no other way to pass credentials but to set them in the URL. But if you are using HTTPS it will be encrypted.
Ill test it,
best regards, Thank you, very much.
Posts: 321
Threads: 72
Joined: Jan 2021
Reputation:
0
30.06.2022, 14:14
(This post was last modified: 30.06.2022, 14:17 by khalil.)
Hello admin
I try the remote service via the browser and its work.
but how to use it in the script?
I use this SCript
Code: require('ssl.https')
ssl.https.TIMEOUT = 5
-- Read from object
local reply = ssl.https.request('https://remote:remote@*.*.*.*/scada-remote?m=json&r=grp&fn=getvalue&alias=62/7/30')
log(reply)
Where should I but the username and password and what is the format?
Admin username password is something like "P@s0ord"
Best Regards,
Posts: 7762
Threads: 42
Joined: Jun 2015
Reputation:
447
Like this:
Code: http = require('socket.http')
mime = require('mime')
result = http.request({
url = 'https://*.*.*.*/scada-remote?m=json&r=grp&fn=getvalue&alias=62/7/30',
headers = {
Authorization = 'Basic ' .. mime.b64('remote:P@s0ord')
}
})
log(result)
Posts: 321
Threads: 72
Joined: Jan 2021
Reputation:
0
(01.07.2022, 05:58)admin Wrote: Like this:
Code: http = require('socket.http')
mime = require('mime')
result = http.request({
url = 'https://*.*.*.*/scada-remote?m=json&r=grp&fn=getvalue&alias=62/7/30',
headers = {
Authorization = 'Basic ' .. mime.b64('remote:P@s0ord')
}
})
log(result)
Thank you admin
Work perfect
Best Regards,
Posts: 321
Threads: 72
Joined: Jan 2021
Reputation:
0
(01.07.2022, 05:58)admin Wrote: Like this:
Code: http = require('socket.http')
mime = require('mime')
result = http.request({
url = 'https://*.*.*.*/scada-remote?m=json&r=grp&fn=getvalue&alias=62/7/30',
headers = {
Authorization = 'Basic ' .. mime.b64('remote:P@s0ord')
}
})
log(result)
Hello Admin
How to write Boolean value to object?
Best Regards,
Posts: 321
Threads: 72
Joined: Jan 2021
Reputation:
0
Code: http = require('socket.http')
mime = require('mime')
cmdbool = event.getvalue()
cmdstr = tostring(cmdbool)
result1 = http.request({
url = 'https://**.**.**.**/scada-remote?m=json&r=grp&fn=write&alias=11/0/3&value=' .. cmdstr,
headers = {
Authorization = 'Basic ' .. mime.b64('remote:*******')
}
})
I tried This code but it didn't work, any idea?
Best Regards,
Posts: 7762
Threads: 42
Joined: Jun 2015
Reputation:
447
log what the http request result/error is:
Code: res, code, hdrs, stat = http.request({ ... })
log(res, code, hdrs, stat)
Posts: 321
Threads: 72
Joined: Jan 2021
Reputation:
0
(22.09.2022, 12:54)admin Wrote: log what the http request result/error is:
Code: res, code, hdrs, stat = http.request({ ... })
log(res, code, hdrs, stat)
This is what I got
Code: * arg: 1
* string: Object not found
* arg: 2
* number: 200
* arg: 3
* table:
["date"]
* string: Thu, 22 Sep 2022 13:04:27 GMT
["transfer-encoding"]
* string: chunked
["content-type"]
* string: text/plain
["connection"]
* string: close
* arg: 4
* string: HTTP/1.1 200 OK
Best Regards,
Posts: 7762
Threads: 42
Joined: Jun 2015
Reputation:
447
Do you have Export set for this object? Alternatively you can disable "Allow only exported objects" in Remote services settings.
Posts: 321
Threads: 72
Joined: Jan 2021
Reputation:
0
(22.09.2022, 13:07)admin Wrote: Do you have Export set for this object? Alternatively you can disable "Allow only exported objects" in Remote services settings.
Oops forget that
Best Regards,
Posts: 24
Threads: 2
Joined: Mar 2021
Reputation:
0
12.10.2023, 14:20
(This post was last modified: 12.10.2023, 14:20 by Re-G.)
Hi.
I don't get it. I put this code:
Code: http = require('socket.http')
mime = require('mime')
result = http.request({
url = 'https://XXX.YYY.VVV.ZZZ/scada-remote?m=json&r=grp&fn=getvalue&alias=32/7/1',
headers = {
Authorization = 'Basic ' .. mime.b64('remote:Password')
}
})
grp.write('0/0/16', result)
log(result)
address 32/7/1 is 1-bit - true/false
address 0/0/16 is 1-bit - true/false
in log i have:
* string: false
but address 0/0/16 is true
if i use function toboolean is still true on 0/0/16
what im doing wrong?
Posts: 7762
Threads: 42
Joined: Jun 2015
Reputation:
447
You need to decode the received value using JSON.
|