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.

Exchange data between two LM5
#1
Hi guys, 

I have a KNX  weather station in Building A and I want to send that data to Building B 
Is it possible two send data between two lm5 that are connected on the same network in "Zerotier"?
If yes, How could I do that?
Reply
#2
If you only need to send data one way then you can connect both LMs to the same ZeroTier network and use remote services (HTTP requests) to send data periodically. Use IP addresses assigned by ZeroTier for communication not LM internal IP. Remote services docs: https://openrb.com/docs/remote-new.htm
Reply
#3
(05.08.2022, 09:43)admin Wrote: If you only need to send data one way then you can connect both LMs to the same ZeroTier network and use remote services (HTTP requests) to send data periodically. Use IP addresses assigned by ZeroTier for communication not LM internal IP. Remote services docs: https://openrb.com/docs/remote-new.htm

Hi again, 
yes it's just one way, in fact, I will have to send 20 objects from one LM to the other 

Could you please give me one example?

lm1 IP address is 192.168.191.79
lm2 IP address is 192.168.191.181
I want to send the object 10/0/2 2byte float from LM1 to LM2, Should I create an object in lm2 and write a script in that object  to read that value from lm1?
Reply
#4
First you have to enable remote services and export objects.
You can ether read value or write to other LM.

Code:
require('socket.http')
socket.http.TIMEOUT = 5

-- Read from object
local reply = socket.http.request('http://remote:remote@192.168.0.10/scada-remote?m=json&r=grp&fn=getvalue&alias=0/0/8')
grp.write('0/0/7', reply)

-- Write to object
value = grp.getvalue('0/0/7')
local reply = socket.http.request('http://remote:remote@192.168.0.10/scada-remote?m=json&r=grp&fn=write&alias=0/0/8&value=' .. value .. '')
------------------------------
Ctrl+F5
Reply
#5
(05.08.2022, 11:10)Daniel Wrote: First you have to enable remote services and export objects.
You can ether read value or write to other LM.

Code:
require('socket.http')
socket.http.TIMEOUT = 5

-- Read from object
local reply = socket.http.request('http://remote:remote@192.168.0.10/scada-remote?m=json&r=grp&fn=getvalue&alias=0/0/8')
grp.write('0/0/7', reply)

-- Write to object
value = grp.getvalue('0/0/7')
local reply = socket.http.request('http://remote:remote@192.168.0.10/scada-remote?m=json&r=grp&fn=write&alias=0/0/8&value=' .. value .. '')
Thanks a LOT, guys. it worked via resident a script in the second lm,
Is it possible to write the value only when it changes not via resident every 60s?
Reply
#6
Use grp.checkwrite('0/0/7', reply)
------------------------------
Ctrl+F5
Reply


Forum Jump: