Jump to content
View in the app

A better way to browse. Learn more.

Universal Devices Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Network Module Rules

Featured Replies

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

ok, Still at it, Michel.
 
I have done some WireShark work. I have attached 2 screen captures: WS1 and WS2
WS1.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?
 
Thanx
Mike

post-2403-0-10933600-1429499722_thumb.png

post-2403-0-59822100-1429499731_thumb.png

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
 
 
i researched that this
ACCESS-CONTROL-ALLOW-ORIGIN: *
no need for an origin value

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

I will try to generate that error from the Bravia to the ISY and send. Thanx

Hi Pazium,

 

No! We don't need the error; we need a working payload.

 

With kind regards,

Michel

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

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

Hi Pazium,

 

Can you run Wireshark on your Windows and run PlayMemories?

 

With kind regards,

Michel 

Yes

 

Mike

(Pazium, Ottermator)

Did anyone figure this out yet? I'm trying to do the same thing.

 

 

Sent from my iPhone using Tapatalk

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

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.

Would you send me your code too, please?

Thanx

Mike

pazium@gmail.com

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

Thanx

Where is  the manual registration page on the TV?

I have a 

Sony KDL48W600B

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

ok. I selcted manual and then Other Methods

i see the SSID and the WPA key. Are you referring to the WPA Key?

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.

  • 3 weeks later...

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.

  • 1 month later...

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

Guest
This topic is now closed to further replies.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.