11.01.2017, 13:47
(This post was last modified: 11.01.2017, 13:51 by Erwin van der Zwart.)
Hi,
Here is a full sample:
You must enable remote services and check the objects for export and use this LUA command to have HTTP communication for older FW use:
See for all possible syntax this URL: http://www.openrb.com/docs/remote.htm
For new (and BETA) FW use:
See for all possible syntax this URL: http://www.openrb.com/docs/remote-new.htm
I strongly recommend to change the default remote password..
BR,
Erwin
Here is a full sample:
You must enable remote services and check the objects for export and use this LUA command to have HTTP communication for older FW use:
Code:
require('socket.http')
socket.http.TIMEOUT = 5
-- Read from object
local reply = socket.http.request('http://remote:remote@192.168.0.10/cgi-bin/scada-remote/request.cgi?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:remoter@192.168.0.10/cgi-bin/scada-remote/request.cgi?m=json&r=grp&fn=write&alias=0/0/8&value=' .. value .. '')
See for all possible syntax this URL: http://www.openrb.com/docs/remote.htm
For new (and BETA) FW use:
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 .. '')
See for all possible syntax this URL: http://www.openrb.com/docs/remote-new.htm
I strongly recommend to change the default remote password..
BR,
Erwin