Trying to work on this but I am still keep failing....
With the status script above(with 0 sec interval), I figured out new connection is open every 10 seconds.
I guess it is because of the timeout that I set inside lutron_connect script
What I have tried with modifying status script is as below but it creates an infite roop inside LM....
Appreciate a lot if you could help.
Thank you so much!
With the status script above(with 0 sec interval), I figured out new connection is open every 10 seconds.
I guess it is because of the timeout that I set inside lutron_connect script
Code:
function lutron_connect()
local tcp = assert(socket.tcp())
tcp:settimeout(10)
local res, err = tcp:connect('172.16.1.10', 23)
if res then
return tcp
else
tcp:close()
return nil, err
end
end
What I have tried with modifying status script is as below but it creates an infite roop inside LM....
Appreciate a lot if you could help.
Thank you so much!
Code:
if not tcp then
tcp, err = lutron_login()
if not tcp then
log('no connection to device', err)
end
end
while tcp do
res, err = lutron_receive(tcp)
if (res == nil) then
return
else
log(res)
end
if (err ~= nil) then
alert('Lutron error '..err)
end
end