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.

OPPO control over IP
#1
Hi control is working but I am get respond with timeout. why?
Command function:

Code:
function tcp_oppo(data, ip, port)
 local sock = require('socket').tcp()
 sock:settimeout(3)

 local res, err = sock:connect(ip, port or 23)
 
 if res then
   res, err = sock:send('#' .. data .. '\r')

   if res then
     res, err = sock:receive('*a')
   else
     alert('send failed: ' .. tostring(err))  
   end
 else
   alert('connect failed: ' .. tostring(err))
 end

 sock:close()

 return res, err
end
Event:
Code:
ip = '192.168.11.105'

if (event.getvalue() == true) then
 res, err = tcp_oppo('POW', ip)
end
log (res, err)
Manual
Reply


Messages In This Thread
OPPO control over IP - by Thinklight - 04.12.2018, 13:21
RE: OPPO control over IP - by admin - 04.12.2018, 13:45
RE: OPPO control over IP - by Thinklight - 04.12.2018, 14:37
RE: OPPO control over IP - by admin - 04.12.2018, 14:45
RE: OPPO control over IP - by Thinklight - 04.12.2018, 15:02
RE: OPPO control over IP - by admin - 05.12.2018, 08:32
RE: OPPO control over IP - by Thinklight - 05.12.2018, 09:59
RE: OPPO control over IP - by admin - 05.12.2018, 10:16

Forum Jump: