I’m trying to control a media switching device via telnet, and while I can do this via an app on PC or my iPad, I’m not able to get it to work via Vera. I can connect, and I get the initial connection response back, but the command I’m sending is not being acted upon.
Please could someone have a look and let me know what I might be missing.
Telnet commands, page 12 - http://www.cypeurope.com/_file/store100/p1667/2020062404813686.2015110915250608.EL-5500_PDF-Manual_v1.04.pdf
local CommandtoSend = 'S POWER 1\r' print("test:", CommandtoSend) luup.log("test:", CommandtoSend) -- Connect and Send Command local socket = require("socket") host = "192.168.102.128" -- CYP Presentation Device c = assert(socket.connect(host, 23)) c:settimeout(10) local sres, serr = c:send(CommandtoSend) print("Send:", sres, serr) luup.log("Send:", sres, serr) local data, rerr = c:receive(170) print("Receive:", data, rerr) luup.log("Receive:", data, rerr) c:close()
The output in the log.file or via Print under LuaTest, is the following…
> Print output > test: S POWER 1 > Send: 10 > Receive: ==================================== > Telnet command service > command '?' for help > command 'quit' for quit > ==================