KHerron / SonyAPILib

Sony Smart Device C# API Library for remote control
GNU Lesser General Public License v3.0
55 stars 19 forks source link

Can't find TV #15

Closed AmigaZoid closed 7 years ago

AmigaZoid commented 7 years ago

I have a Bravia XBR-55X930D that I can't seem to find on my Network. I've had similar problems with the network and have tried turning off firewalls, DMZ etc. with no luck. Apps can see the TV though.

When I run SonyAPILib, it doesn't find any devices. I'm new to Json but was wondering if there is a way with the API to send the request to a particular IP?

Any suggestions welcome for my problem.

AmigaZoid commented 7 years ago

I'm not sure what happened this morning but I loaded the app into visual studio 2015 instead of 2017 and was planning on stepping through the code. I noticed that it actually found something so ran it normally. Discovered 25 items today and was able to build an XML for Bravia XBR-55X930D. I did do a restart on my TV yesterday which had recently completed a software update. Wish I had time today to move forward on this. Quite exciting to have something working. My plan is to use an existing Premise server that controls Kodi, and Zwave in my home to control the TV with voice commands.

AmigaZoid commented 7 years ago

The port found was 46014

AmigaZoid commented 7 years ago

Save button on app? No code

private void SaveBut_Click(object sender, EventArgs e) {

    }
KHerron commented 7 years ago

Can you please specify which app you are using. These are only example apps. Many still need additional coding to be fully functional.

AmigaZoid commented 7 years ago

Sorry, this was the DLNA Control panel. I'm about to try the console example. I'm guessing since I went from 0 detected devices to 25 that the problem is with my gateway. I've noticed some errors. I'll let you know what I find out with this model if you like.

KHerron commented 7 years ago

The DLNA Control Panel and the Event Examples are the last 2 I built, and yes there may be missing code, as I was not really trying to create a functional application, but an API library that anyone could use to create their own application.

Any Input you can provide will be appreciated

KHerron commented 7 years ago

The code to put in the save button is very simple, if you want to hard code it. Meaning there is no Save File box.

private void SaveBut_Click(object sender, EventArgs e)
{
        string path="C:\MyDevices";  // Set this to the path you want it to save the file to.
        mySonyLib.Locator.DeviceSave(path, curDev);  //curDev is the currently selected device.
}

It's a little more work, but you can also make a Save File box appear, so you can select the save location that way. Look up "C# How to use the Save File dialog"

AmigaZoid commented 7 years ago

You can add this model to the list! I'll explain how it worked for me. So I ran the console app the first time, TV was found with 2 different ports. 9 - http://192.168.1.182:42704/sony/webapi/ssdp/dd.xml and 1 with port 8008 which failed. My TV was identified as model 3 so I entered the Pin. On the TV it said success but in the console app it told me console failed. When I tried it again, I noticed about 5 or 6 media servers in the list from my TV. I selected the port above again and when it asked for a pin, my TV did not display one. I simply hit enter and it said success. It gave me a list of commands. It was simply Num1, volumeup, etc.

Now that my PC is registered, can I simply send raw commands to control the tv?