KHerron / SonyAPILib

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

Try to use with a UBP-X800 #17

Closed diyjeff closed 7 years ago

diyjeff commented 7 years ago

I hope this is a good place to post this. I have a home automation system that controls many things, including a Sony Blu-ray player that uses ircc commands. I was trying out your library to see if I could use it and tried your ConsoleExample. It finds several "devices" at the correct IP address, however not always the same list. What happens is if I select a device, as far as I can tell, I cannot find anything on the UHD player as to how to register the device. It does have an item to view registered controllers. As an aside, many of the ircc commands that work on the older blu-ray player also work on the new one. If you have any suggestions on debugging this I will provide any feedback on my results. I am running your ConsoleExample under VS2015. I do get responses back from the following (using a web browser): http://192.168.1.13:64321/bdp-cx-ms.xml http://192.168.1.13:50201/dial.xml http://192.168.1.13:50202/appslist http://192.168.1.13:50001/Ircc.xml http://192.168.1.13:52323/dmr.xml http://192.168.1.13:50002/actionList http://192.168.1.13:50002/getSystemInformation

http://192.168.1.13:50002/actionList returns HTTP/1.1 200 OK Connection: close Cache-Control: no-cache Pragma: no-cache Transfer-Encoding: chunked Content-Type: text/xml Date: Wed, 14 Jun 2017 18:32:56 GMT Server: Linux/3.10 Sony-BDP/2.0

2C9 <?xml version="1.0" encoding="UTF-8"?>

Thanks

KHerron commented 7 years ago

Sometimes the same device will support many different device types that respond to the Discovery Broadcast. I believe the correct one you should try in the console applications is this one: http://192.168.1.13:52323/dmr.xml. There should also be a log created here: C:\Program Data\Sony.

This device may be like a Gen 1 TV, and you do not have to put it in to registration mode. Just make sure the device is on, and the TV is set to the input of the player, so if it does display any information, you will see it here. You may need to hit enter on the player's remote.

diyjeff commented 7 years ago

Selected the "dmr" device, after "Hit any key to continue" hit enter, got "Enter PIN Code", no messages on TV, got Registration returned: False

There was an error

UBP-X800: Retrieving Remote Command List ERROR Retrieving Command List

UBP-X800: Retrieving Command Value for: VolumeUp

and got an exception on var results = this.Commands.FirstOrDefault(o => o.name.ToLower() == CmdName.ToLower()); since there were no commands.

Any other thoughts?   Log file attached and the player and TV were on. Thanks, Jeff

On Wednesday, June 14, 2017 5:32 PM, Kirk <notifications@github.com> wrote:

Sometimes the same device will support many different device types that respond to the Discovery Broadcast. I believe the correct one you should try in the console applications is this one: http://192.168.1.13:52323/dmr.xml. There should also be a log created here: C:\Program Data\Sony.This device may be like a Gen 1 TV, and you do not have to put it in to registration mode. Just make sure the device is on, and the TV is set to the input of the player, so if it does display any information, you will see it here. You may need to hit enter on the player's remote.— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

6/14/2017 7:35:45 PM - Clearing Log file: SonyAPILib_LOG.txt 6/14/2017 7:35:45 PM - UPnP is Discovering devices.... 6/14/2017 7:36:20 PM - Devices Discovered: 21 6/14/2017 7:37:10 PM - Retrieving Device Description Document from URI: 6/14/2017 7:37:10 PM - http://192.168.1.13:52323/dmr.xml 6/14/2017 7:37:10 PM - Building Device from Document: http://192.168.1.13:52323/dmr.xml 6/14/2017 7:37:10 PM - Document Found 6/14/2017 7:37:10 PM - Retrieving Controlling devices Mac Address. (this computer) 6/14/2017 7:37:10 PM - Mac Address retrieved: 001FC69BC0D6 6/14/2017 7:37:10 PM - Re-Parsing Mac Address. (Replace : with -) 6/14/2017 7:37:10 PM - Mac Address has been re-Parsed: 00-1F-C6-9B-C0-D6 6/14/2017 7:37:10 PM - RenderingControl:1 Service discovered on this device 6/14/2017 7:37:10 PM - ConnectionManager:1 Service discovered on this device 6/14/2017 7:37:10 PM - AVTransport:1 Service discovered on this device 6/14/2017 7:37:10 PM - Device has a registration Mode of: 3 6/14/2017 7:37:10 PM - Retrieving the Mac Address from: UBP-X800 at IP: 192.168.1.13 6/14/2017 7:37:11 PM - There was an Error while Building the Device 6/14/2017 7:37:11 PM - The device may not be powered on, or the Path was incorrect. 6/14/2017 7:37:11 PM - Checking Status of Device UBP-X800 6/14/2017 7:37:12 PM - Check Status Failed: System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 192.168.1.13:80 at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception) --- End of inner exception stack trace --- at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context) at System.Net.HttpWebRequest.GetRequestStream() at SonyAPILib.APILibrary.IRCC1.GetStatus(SonyDevice Parent) in C:\VBProgs\SonyAPILib-master\SonyAPILib\SonyAPILib\sonyAPILib.cs:line 3999 6/14/2017 7:37:20 PM - Controlling Mac address: 00-1F-C6-9B-C0-D6 6/14/2017 7:37:20 PM - Register Mode 3 Sony Sevice 6/14/2017 7:37:20 PM - Creating JSON Web Request 6/14/2017 7:37:20 PM - Sending Generation 3 JSON Registration 6/14/2017 7:37:20 PM - device not reachable 6/14/2017 7:37:20 PM - Registration was NOT successful for device at: 192.168.1.13 6/14/2017 7:41:17 PM - Registration process Timed Out 6/14/2017 7:41:17 PM - Can Not Retrieve Command List, No Registration 6/14/2017 7:41:17 PM - Retrieving Command String for Command: VolumeUp

diyjeff commented 7 years ago

When I issue http://192.168.1.13:52323/dmr.xml from a browser I get the results in the attached pdf.Don't know if it helps. Jeff

On Wednesday, June 14, 2017 5:32 PM, Kirk <notifications@github.com> wrote:

Sometimes the same device will support many different device types that respond to the Discovery Broadcast. I believe the correct one you should try in the console applications is this one: http://192.168.1.13:52323/dmr.xml. There should also be a log created here: C:\Program Data\Sony.This device may be like a Gen 1 TV, and you do not have to put it in to registration mode. Just make sure the device is on, and the TV is set to the input of the player, so if it does display any information, you will see it here. You may need to hit enter on the player's remote.— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

KHerron commented 7 years ago

Did not get the PDF file. But I really need to see the contents of this XML file, so I can determine the proper registration requirements. Can you send it to k.herron65@gmail.com?

Thanks

diyjeff commented 7 years ago

XML file emailed.

KHerron commented 7 years ago

Determined that this issue was caused by a new generation that still uses HTTP to send commands and authenticate. Also uses an ActionList. Also the IRCC services is detailed in a separate file. Device Mac address is required for WOL command.

All Solved with 5.4 release. Closing Issue