Sony Simple IP Protocol - Printable Version +- Logic Machine Forum (https://forum.logicmachine.net) +-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1) +--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8) +--- Thread: Sony Simple IP Protocol (/showthread.php?tid=228) |
Sony Simple IP Protocol - josep - 24.02.2016 Hello, we are trying to communicate a Sony TV via TCP and we have a document made by sony that explains the protocol we should use. My question is how we can do to make this control via lua scripts, thank you very much. RE: Sony Simple IP Protocol - admin - 24.02.2016 TCP function reference: http://w3.impa.br/~diego/software/luasocket/tcp.html Basic example: Code: require('socket') RE: Sony Simple IP Protocol - josep - 24.02.2016 Thank you very much. It works fine. Now I try to read TV status via Resident Script but doesn't work, I tryied to use the Denon TCP status Scrip from examples but doesn't work. In Alert page appears Connection Ok and Connection Timeout alternately. Thanks RE: Sony Simple IP Protocol - admin - 25.02.2016 You have to send enquiry command, then you can parse the response to get status info. Code: require('socket') RE: Sony Simple IP Protocol - josep - 25.02.2016 (25.02.2016, 09:37)admin Wrote: You have to send enquiry command, then you can parse the response to get status info. Hi, I'm trying this but doesn't work. Appears a error like that: "attempt to call method 'revieve' ( anil value)" I have two more questions, first. It's possible to extract volume value from TCP response of TV and convert this value to a KNX 1 byte value? and the second question, if the tv awnser automactilly the status when you send 'power on', for example, it's possible to read this value without force the status query, and can I read the responses separately by \n? Thank you very much. RE: Sony Simple IP Protocol - phongvucba - 22.05.2017 Its not work with firewall 4/2017 of sony tv bravia. Can you help me? RE: Sony Simple IP Protocol - buuuudzik - 08.06.2017 It works but only when TV is on(not in standby mode). After switching off TV script receive nothing only timeout or connection refused. In documentation there is such info: "TCP connections are kept among requests but they are disconnected by server if no command is sent from client in 30 seconds." So I tried sending every 20 seconds ask for power status. But it is not enough. How can I keep the connection? And also could someone prepare a sample for establishing TCP connection which can receive some info from TV only on event? RE: Sony Simple IP Protocol - phongvucba - 14.07.2017 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() sockettimeout(1) a=sock:connect(ip,20060) if giatri==1 then b=sockend(on) alert('send OK') else b=sockend(off) alert('send OK') end sock:close() end ------------------------------------------ function check_tv() require('socket') sock=socket.tcp() sockettimeout(2) ip = '192.168.1.16' cmd = '*SEPOWR################\n' a=sock:connect(ip,52323) if a==1 then b=sockend(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? .... RE: Sony Simple IP Protocol - gjniewenhuijse - 17.07.2017 Above doesn't work for me, so i used this: Code: -- tv standby and the library Code: --http://www.openremote.org/display/forums/Sony+TV+HTTP+control RE: Sony Simple IP Protocol - DarthPaul - 13.07.2018 Code: require('socket') 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! |