23.04.2018, 09:56
Make sure that password is disabled on the projector and command port is set to 1024. Change 192.168.1.111 to projector's IP.
For command with a parameter try it either like IIS:HD1 or IISHD1 (documentation is not clear on this point).
For command with a parameter try it either like IIS:HD1 or IISHD1 (documentation is not clear on this point).
Code:
function tcpsend(data, ip, port)
local sock = require('socket').tcp()
sock:settimeout(3)
local res, err = sock:connect(ip, port or 1024)
if res then
res, err = sock:send('00' .. 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
-- send Power ON
res, err = tcpsend('PON', '192.168.1.111')
log(res, err)