Michel Kohanim Posted April 19, 2015 Posted April 19, 2015 Hi Pazium, Unfortunately not having a complete payload of what the TV expects, we'll be playing roulette. Is there a way to get that? Do you need to provide userid/password (not device id/info)? With kind regards, Michel
Pazium Posted April 20, 2015 Posted April 20, 2015 ok, Still at it, Michel. I have done some WireShark work. I have attached 2 screen captures: WS1 and WS2WS1.png is the message the Bravia sends back just before the 500 error.I also include the 500 error capture from WireShark, WS 2. What does the Bravia want in WS1? ThanxMike
Pazium Posted April 20, 2015 Posted April 20, 2015 no, it doesnt expect a user id and password the successful response from the working Bravia is this HTTP/1.1 200 OK Content-Type: text/xml;charset="utf-8" Content-Length: 375 Connection: keep-alive Server: Linux/2.6 UPnP/1.0 DMR/1.7 Ext: ACCESS-CONTROL-ALLOW-ORIGIN: * Date: Mon, 20 Apr 2015 14:46:17 GMT <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/X i researched that this ACCESS-CONTROL-ALLOW-ORIGIN: * no need for an origin value
Pazium Posted April 20, 2015 Posted April 20, 2015 just before the 500 error, bravia wants GetSortCapabilities in a soap action it like at the xml at the top of this discussion: https://code.google.com/p/ps3mediaserver/issues/detail?id=447
Michel Kohanim Posted April 21, 2015 Posted April 21, 2015 Hi Pazium, Thank you. But, what we need is a payload "that works" and does not return any errors. Once we have that payload, then we can input into ISY and see whether or not we get that error. Do you have anything that can make the correct call and get Bravia to respond correctly? With kind regards, Michel
Pazium Posted April 21, 2015 Posted April 21, 2015 I will try to generate that error from the Bravia to the ISY and send. Thanx
Michel Kohanim Posted April 22, 2015 Posted April 22, 2015 Hi Pazium, No! We don't need the error; we need a working payload. With kind regards, Michel
Pazium Posted April 24, 2015 Posted April 24, 2015 OK, This link seems to discuss how to make the payload work for the latest Bravias. They now require a PIN https://blog.yrden.de/2014/11/14/remote-control-bravia-tvs-with-authentication.html
Michel Kohanim Posted April 27, 2015 Posted April 27, 2015 Hi Pazium, Did you run the shell commands? Since we do not have Bravia, there's not much we can do on this end. With kind regards, Michel
Pazium Posted April 27, 2015 Posted April 27, 2015 accessCiontrol doesn't exist in this Bravia I ran wireshark after running commands and the Bravia didn't know what it was. I don't recall this model asking for a PIN like TiVo does though, TV Sideview didn't ask for one. My Sony Experia didn't need one and neither PlayMemores for Windows or my Surface Pro 3 I need it to recognize/register the ISY in the same way, I think. I'll plunge back in tonight Thanx for checking in I am also Ottermator somewhere else and when in this forum. You'll see my previous questions and efforts
Michel Kohanim Posted April 27, 2015 Posted April 27, 2015 Hi Pazium, Can you run Wireshark on your Windows and run PlayMemories? With kind regards, Michel
Michel Kohanim Posted May 5, 2015 Posted May 5, 2015 Hi Mike, Can you send me the output? With kind regards, Michel
MWoods329 Posted May 9, 2015 Posted May 9, 2015 Did anyone figure this out yet? I'm trying to do the same thing. Sent from my iPhone using Tapatalk
Michel Kohanim Posted May 10, 2015 Posted May 10, 2015 Hi MWoods329, We are still waiting. If you can send a wireshark capture of how this is done from your computer, it'll make things much easier. With kind regards, Michel
MWoods329 Posted May 11, 2015 Posted May 11, 2015 I'll send it to you. Check out this API: https://github.com/KHerron/SonyAPILib/blob/master/README.md My model (KDL-48W600b) requires a script to be run which "registers" the new virtual remote with the TV. Oddly, I copied and pasted the script from the API for registration into a network resource on the ISY - and the ISY registered as OK. I did the same for my PC, which also registered as OK. But, when I ran the commands from my PC, it worked fine - same commands on the ISY register a response of 500.
Ottermator Posted May 11, 2015 Posted May 11, 2015 Would you send me your code too, please? Thanx Mike pazium@gmail.com
MWoods329 Posted May 11, 2015 Posted May 11, 2015 Here is the script I ran to register my ISY to the TV. Its literally a copy/paste from the API I mentioned. Just be sure to manually replace the "your.ISY.ip", "your.TVs.ip", and "YourAuthenticationCode". The authentication code comes from the manual registration page in settings on the TV itself. public bool sendAuth(string YourAuthenticationCode) { bool reg = false; string your.tvs.IP = this.Server_Name; string jsontosend = "{\"id\":13,\"method\":\"actRegister\",\"version\":\"1.0\",\"params\":[{\"clientid\":\"" + your.tvs.IP + ":34c43339-af3d-40e7-b1b2-743331375368c\",\"nickname\":\"" + your.tvs.IP + "\"},[{\"clientid\":\"" + your.tvs.IP + ":34c43339-af3d-40e7-b1b2-743331375368c\",\"value\":\"yes\",\"nickname\":\"" + your.tvs.IP + "\",\"function\":\"WOL\"}]]}"; try { var httpWebRequest2 = (HttpWebRequest)WebRequest.Create(@"http://" + your.ISY.IP + @"/sony/accessControl"); httpWebRequest2.ContentType = "application/json"; httpWebRequest2.Method = "POST"; httpWebRequest2.AllowAutoRedirect = true; httpWebRequest2.CookieContainer = allcookies; httpWebRequest2.Timeout = 500; using (var streamWriter = new StreamWriter(httpWebRequest2.GetRequestStream())) { streamWriter.Write(jsontosend); } string authInfo = "" + ":" + YourAuthenticationCode; authInfo = Convert.ToBase64String(Encoding.Default.GetBytes(authInfo)); httpWebRequest2.Headers["Authorization"] = "Basic " + authInfo; var httpResponse = (HttpWebResponse)httpWebRequest2.GetResponse(); using (var streamReader = new StreamReader(httpResponse.GetResponseStream())) { var responseText = streamReader.ReadToEnd(); _Log.writetolog("Registration response: " + responseText, false); this.Registered = true; reg = true; } string answerCookie = JsonConvert.SerializeObject(httpWebRequest2.CookieContainer.GetCookies(new Uri("http://" + your.ISY.IP + "/sony/appControl"))); System.IO.StreamWriter file = new System.IO.StreamWriter("cookie.json"); file.WriteLine(answerCookie); file.Close(); this.Cookie = answerCookie; } catch { _Log.writetolog("Registration process Timed Out", false); this.Registered = false; } return reg; } #endregion
Ottermator Posted May 11, 2015 Posted May 11, 2015 Thanx Where is the manual registration page on the TV? I have a Sony KDL48W600B
MWoods329 Posted May 11, 2015 Posted May 11, 2015 It's in network settings. I think the header is WiFi Direct. The description will say "to connect devices on your network to the TV" or something like that. Instead of doing what it asks you to do when you get in there, look for the option of manual registration. That's where you get the manual registration authentication code. You have to leave your TV on that page with the code up while you register the device. Sent from my iPhone using Tapatalk
Ottermator Posted May 12, 2015 Posted May 12, 2015 ok. I selcted manual and then Other Methods i see the SSID and the WPA key. Are you referring to the WPA Key?
Ottermator Posted May 12, 2015 Posted May 12, 2015 I get a failure and an N/A response with POSTing this POST / HTTP/1.1 Host: 169.254.70.83:80 User-Agent: Mozilla/4.0 Connection: Close Content-Type: application/x-www-form-urlencoded Content-Length: 2593 public bool sendAuth(string YourAuthenticationCode) { bool reg = false; string 169.254.70.83 = this.Server_Name; string jsontosend = "{\"id\":13,\"method\":\"actRegister\",\"version\":\"1.0\",\"params\":[{\"clientid\":\"" + 169.254.70.83 + ":34c43339-af3d-40e7-b1b2-743331375368c\",\"nickname\":\"" + 169.254.70.83 + "\"},[{\"clientid\":\"" + 169.254.70.83 + ":34c43339-af3d-40e7-b1b2-743331375368c\",\"value\":\"yes\",\"nickname\":\"" + 169.254.70.83 + "\",\"function\":\"WOL\"}]]}"; try { var httpWebRequest2 = (HttpWebRequest)WebRequest.Create(@"http://" + 192.168.1.13 + @"/sony/accessControl"); httpWebRequest2.ContentType = "application/json"; httpWebRequest2.Method = "POST"; httpWebRequest2.AllowAutoRedirect = true; httpWebRequest2.CookieContainer = allcookies; httpWebRequest2.Timeout = 500; using (var streamWriter = new StreamWriter(httpWebRequest2.GetRequestStream())) { streamWriter.Write(jsontosend); } string authInfo = "" + ":" + 3752Rvwj; authInfo = Convert.ToBase64String(Encoding.Default.GetBytes(authInfo)); httpWebRequest2.Headers["Authorization"] = "Basic " + authInfo; var httpResponse = (HttpWebResponse)httpWebRequest2.GetResponse(); using (var streamReader = new StreamReader(httpResponse.GetResponseStream())) { var responseText = streamReader.ReadToEnd(); _Log.writetolog("Registration response: " + responseText, false); this.Registered = true; reg = true; } string answerCookie = JsonConvert.SerializeObject(httpWebRequest2.CookieContainer.GetCookies(new Uri("http://" + 192.168.1.13 + "/sony/appControl"))); System.IO.StreamWriter file = new System.IO.StreamWriter("cookie.json"); file.WriteLine(answerCookie); file.Close(); this.Cookie = answerCookie; } catch { _Log.writetolog("Registration process Timed Out", false); this.Registered = false; } return reg; } #endregion How does it look? I appreciate your time.
MWoods329 Posted May 30, 2015 Posted May 30, 2015 No, registration occurs in a different section of the settings. Look up in the user guide how to register a mobile device. That will give you a four digit PIN. That's the registration PIN.
MWoods329 Posted July 4, 2015 Posted July 4, 2015 Just an update - I'm still not able to get usable packets monitoring my network traffic. Additionally, Sony updated their firmware and now includes an option in the settings for developers to send commands over network - but no documentation on it. I found it much easier to just use the new IFTTT channel (Maker) to build network resources that send commands to my Harmony Ultimate Hub. That gets the job done. Sent from my iPhone using Tapatalk
Recommended Posts