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.

How to share values between LM in diferent buildings (secure way)
#1
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
Reply
#2
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
Reply
#3
(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...
Reply
#4
You can use HTTPS for remote services.
Reply
#5
(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..
Reply
#6
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.
Reply
#7
(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.
Reply
#8
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,
Reply
#9
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)
Reply
#10
(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,
Reply
#11
(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,
Reply
#12
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,
Reply
#13
log what the http request result/error is:
Code:
res, code, hdrs, stat = http.request({ ... })
log(res, code, hdrs, stat)
Reply
#14
(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,
Reply
#15
Do you have Export set for this object? Alternatively you can disable "Allow only exported objects" in Remote services settings.
Reply
#16
(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 Smile
Best Regards,
Reply
#17
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?
Reply
#18
You need to decode the received value using JSON.
Reply


Forum Jump: