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.

Sony Simple IP Protocol
#10
Code:
require('socket')

-- bravia IP
ip = '192.168.1.23'

-- IR power off command, must be 24 chars long
cmd = '*SCIRCC0000000000000000\n'
-- power-on
-- cmd = '*SCPOWR0000000000000001\n'

sock = socket.tcp()
sock:settimeout(3)

res, err = sock:connect(ip, 20060)
if res then
 res, err = sock:send(cmd)

 if res then
   alert('send OK')
 else
   alert('send failed: ' .. tostring(err))
 end
else
 alert('connect failed: ' .. tostring(err))
end

sock:close()

This Code had an error regarding my Bravia, to turn off.
cmd = '*SCIRCC0000000000000000\n' 
do not work at all, i had to replace IRCC with POWR 
cmd = '*SCPOWR0000000000000000\n' 
That did make it work!
Reply


Messages In This Thread
Sony Simple IP Protocol - by josep - 24.02.2016, 09:23
RE: Sony Simple IP Protocol - by admin - 24.02.2016, 11:45
RE: Sony Simple IP Protocol - by DarthPaul - 13.07.2018, 07:04
RE: Sony Simple IP Protocol - by josep - 24.02.2016, 14:39
RE: Sony Simple IP Protocol - by admin - 25.02.2016, 09:37
RE: Sony Simple IP Protocol - by josep - 25.02.2016, 19:53
RE: Sony Simple IP Protocol - by phongvucba - 22.05.2017, 15:46
RE: Sony Simple IP Protocol - by buuuudzik - 08.06.2017, 16:24
RE: Sony Simple IP Protocol - by phongvucba - 14.07.2017, 10:51

Forum Jump: