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
#8
Please help me !
I use the code above to turn the TV on and off but it does not work?
My television is sony bravia 79' X900B.
Does anyone know how to turn it off via HTTP?
----------------
require('socket')
ip = '192.168.1.16'
-- power-on =1, off=0
on = '*SCPOWR0000000000000001\n'
off= '*SCPOWR0000000000000000\n' --SCIRCC0000000000000001
sock=socket.tcp()
sockConfusedettimeout(1)
a=sock:connect(ip,20060)
if giatri==1 then
b=sockConfusedend(on)
alert('send OK')
else
b=sockConfusedend(off)
alert('send OK')
end
sock:close()
end
------------------------------------------
function check_tv()
require('socket')
sock=socket.tcp()
sockConfusedettimeout(2)
ip = '192.168.1.16'
cmd = '*SEPOWR################\n'
a=sock:connect(ip,52323)
if a==1 then
b=sockConfusedend(cmd)
if b==24 then
c=sock:receive()
if c=="*SAPOWR0000000000000001" then
alert("tivi đã bật")
return 1
else
alert("tivi đã tắt")
return 0
end
else
alert("Send failed: ")
end
else
alert("connect failed")
end
sock:close()
end
--------------------

Am I wrong?
Sad....
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: