ol-iver / denonavr

Automation Library for Denon AVR receivers.
MIT License
174 stars 66 forks source link

Subscribe to states instead of polling #117

Closed starkillerOG closed 4 years ago

starkillerOG commented 4 years ago

Currently we use locall polling every some seconds to the XML status endpoints: http://192.168.1.xxx/goform/formMainZone_MainZoneXmlStatus.xml However I noticed that the Marantz Remote App actally receives status updates (such as volume changes) instantly. Therefore there apperently is some way to subscribe to states/properties using something like a webhook or something, would be awesom if we could figure out how to receive those state updates.

We could then stop polling all the time and receive instant state changes!

I sent an e-mail to Marantz to ask how this works and if they have any documentation.

Is there someone who knows how this works or how to figure this out? @scarface-4711 do you have any idea?

starkillerOG commented 4 years ago

Moreover the Marantz Remote App manages to know that I am playing from Spotify while all the status xml files just display NETWORK as source but I can not figure out from the xml files if i am playing spotify or some other network source....

Therefore there must be some other way to get status information that we are not yet aware of...

JPHutchins commented 4 years ago

Success! I am receiving realtime NOTIFY from the receiver after sending a SUBSCRIBE from my desktop computer via postman. If you read at end you will see I am not sure if this is the endpoint that worked, so read more if it doesn't work. And maybe your port is different. Obviously I set that callback port to 80 for convenience.

Edit: I think it is the RenderingControl endpoint - but maybe you have do all of them IDK

SUBSCRIBE http://*receiverIP*:60006/upnp/event/renderer_dvc/RenderingControl with headers: HOST receiverIP:60006 CALLBACK \http://*yourIP*:80/\ NT upnp:event TIMEOUT Second-180

Below is workflow notes: Bear with me, I am just keeping notes as I tinker:

I see SSDP coming from the receiver:

NOTIFY * HTTP/1.1 HOST: 239.255.255.250:1900 CACHE-CONTROL: max-age=180 LOCATION: http://192.168.0.119:60006/upnp/desc/aios_device/aios_device.xml VERSIONS.UPNP.HEOS.COM: 10,-275207632,-521045671,363364703,1840750642,105553199,-316033077,1711326982,-170053632,363364703,395144743 NETWORKID.UPNP.HEOS.COM: 0418d6f19fae BOOTID.UPNP.ORG: 965061649 IPCACHE.URL.UPNP.HEOS.COM: /ajax/upnp/get_device_info NT: urn:schemas-upnp-org:device:MediaServer:1 NTS: ssdp:alive SERVER: LINUX UPnP/1.0 Denon-Heos/147202 USN: uuid:497d9c87-75d2-2db1-99cf-38fad9f45a2a::urn:schemas-upnp-org:device:MediaServer:1

So I GET http://192.168.0.119:60006/upnp/desc/aios_device/aios_device.xml and receive:

<?xml version="1.0" encoding="utf-8"?>
<root xmlns="urn:schemas-upnp-org:device-1-0"
 xmlns:DMH="http://www.dmglobal.com"
 xmlns:qq="http://www.tencent.com"
 xmlns:avega_media_server="urn:schemas-avegasystems-com:media-server:metadata-1-0:DIDL-Lite"
>
    <specVersion>
        <major>1</major>
        <minor>0</minor>
    </specVersion>
    <device>
        <deviceType>urn:schemas-denon-com:device:AiosDevice:1</deviceType>
        <friendlyName>TV Speakers</friendlyName>
        <manufacturer>Denon</manufacturer>
        <manufacturerURL>http://www.denon.com</manufacturerURL>
        <modelName>Denon AVR-X1500H</modelName>
        <modelNumber>Aios 4.025</modelNumber>
        <serialNumber>AYW27181117704</serialNumber>
        <UDN>uuid:c5f13838-c15e-1453-0080-0005cdd1f6ea</UDN>
        <DMH:X_Audyssey>00000002</DMH:X_Audyssey>
        <DMH:X_AudysseyPort>1256</DMH:X_AudysseyPort>
        <DMH:X_WebAPIPort>8080</DMH:X_WebAPIPort>
        <deviceList>
            <device>
                <deviceType>urn:schemas-upnp-org:device:MediaRenderer:1</deviceType>
                <friendlyName>TV Speakers</friendlyName>
                <manufacturer>Denon</manufacturer>
                <manufacturerURL>http://www.denon.com</manufacturerURL>
                <modelName>Denon AVR-X1500H</modelName>
                <modelNumber>Aios 4.025</modelNumber>
                <UDN>uuid:aa583ee8-ebb5-196f-0080-0005cdd1f6ea</UDN>
                <qq:X_QPlay_SoftwareCapability>QPlay:1</qq:X_QPlay_SoftwareCapability>
                <serviceList>
                    <service>
                        <serviceType>urn:schemas-upnp-org:service:AVTransport:1</serviceType>
                        <serviceId>urn:upnp-org:serviceId:AVTransport</serviceId>
                        <SCPDURL>/upnp/scpd/renderer_dvc/AVTransport.xml</SCPDURL>
                        <controlURL>/upnp/control/renderer_dvc/AVTransport</controlURL>
                        <eventSubURL>/upnp/event/renderer_dvc/AVTransport</eventSubURL>
                    </service>
                    <service>
                        <serviceType>urn:schemas-upnp-org:service:ConnectionManager:1</serviceType>
                        <serviceId>urn:upnp-org:serviceId:ConnectionManager</serviceId>
                        <SCPDURL>/upnp/scpd/renderer_dvc/ConnectionManager.xml</SCPDURL>
                        <controlURL>/upnp/control/renderer_dvc/ConnectionManager</controlURL>
                        <eventSubURL>/upnp/event/renderer_dvc/ConnectionManager</eventSubURL>
                    </service>
                    <service>
                        <serviceType>urn:schemas-upnp-org:service:RenderingControl:1</serviceType>
                        <serviceId>urn:upnp-org:serviceId:RenderingControl</serviceId>
                        <SCPDURL>/upnp/scpd/renderer_dvc/RenderingControl.xml</SCPDURL>
                        <controlURL>/upnp/control/renderer_dvc/RenderingControl</controlURL>
                        <eventSubURL>/upnp/event/renderer_dvc/RenderingControl</eventSubURL>
                    </service>
                </serviceList>
            </device>
            <device>
                <deviceType>urn:schemas-denon-com:device:AiosServices:1</deviceType>
                <friendlyName>AiosServices</friendlyName>
                <manufacturer>Denon</manufacturer>
                <manufacturerURL>http://www.denon.com</manufacturerURL>
                <modelName>Denon AVR-X1500H</modelName>
                <modelNumber>Aios 4.025</modelNumber>
                <UDN>uuid:4722a897-1630-1532-0080-0005cdd1f6ea</UDN>
                <serviceList>
                    <service>
                        <serviceType>urn:schemas-denon-com:service:ErrorHandler:1</serviceType>
                        <serviceId>urn:denon-com:serviceId:ErrorHandler</serviceId>
                        <SCPDURL>/upnp/scpd/AiosServicesDvc/ErrorHandler.xml</SCPDURL>
                        <controlURL>/upnp/control/AiosServicesDvc/ErrorHandler</controlURL>
                        <eventSubURL>/upnp/event/AiosServicesDvc/ErrorHandler</eventSubURL>
                    </service>
                    <service>
                        <serviceType>urn:schemas-denon-com:service:ZoneControl:2</serviceType>
                        <serviceId>urn:denon-com:serviceId:ZoneControl</serviceId>
                        <SCPDURL>/upnp/scpd/AiosServicesDvc/ZoneControl.xml</SCPDURL>
                        <controlURL>/upnp/control/AiosServicesDvc/ZoneControl</controlURL>
                        <eventSubURL>/upnp/event/AiosServicesDvc/ZoneControl</eventSubURL>
                    </service>
                    <service>
                        <serviceType>urn:schemas-denon-com:service:GroupControl:1</serviceType>
                        <serviceId>urn:denon-com:serviceId:GroupControl</serviceId>
                        <SCPDURL>/upnp/scpd/AiosServicesDvc/GroupControl.xml</SCPDURL>
                        <controlURL>/upnp/control/AiosServicesDvc/GroupControl</controlURL>
                        <eventSubURL>/upnp/event/AiosServicesDvc/GroupControl</eventSubURL>
                    </service>
                </serviceList>
            </device>
            <device>
                <deviceType>urn:schemas-upnp-org:device:MediaServer:1</deviceType>
                <friendlyName>TV Speakers</friendlyName>
                <manufacturer>Denon</manufacturer>
                <manufacturerURL>http://www.denon.com</manufacturerURL>
                <modelDescription>Shares User defined folders and files to other Universal Plug and Play media devices.</modelDescription>
                <modelName>Denon AVR-X1500H</modelName>
                <modelNumber>Aios 4.025</modelNumber>
                <serialNumber>AYW27181117704</serialNumber>
                <UDN>uuid:497d9c87-75d2-2db1-99cf-38fad9f45a2a</UDN>
                <avega_media_server:X_VirtualServersSupported>True</avega_media_server:X_VirtualServersSupported>
                <serviceList>
                    <service>
                        <serviceType>urn:schemas-upnp-org:service:ContentDirectory:1</serviceType>
                        <serviceId>urn:upnp-org:serviceId:ContentDirectory</serviceId>
                        <SCPDURL>/upnp/scpd/ams_dvc/ContentDirectory.xml</SCPDURL>
                        <controlURL>/upnp/control/ams_dvc/ContentDirectory</controlURL>
                        <eventSubURL>/upnp/event/ams_dvc/ContentDirectory</eventSubURL>
                    </service>
                    <service>
                        <serviceType>urn:schemas-upnp-org:service:ConnectionManager:1</serviceType>
                        <serviceId>urn:upnp-org:serviceId:ConnectionManager</serviceId>
                        <SCPDURL>/upnp/scpd/ams_dvc/ConnectionManager.xml</SCPDURL>
                        <controlURL>/upnp/control/ams_dvc/ConnectionManager</controlURL>
                        <eventSubURL>/upnp/event/ams_dvc/ConnectionManager</eventSubURL>
                    </service>
                </serviceList>
            </device>
            <device>
                <deviceType>urn:schemas-denon-com:device:ACT-Denon:1</deviceType>
                <friendlyName>ACT-TV Speakers</friendlyName>
                <manufacturer>Denon</manufacturer>
                <manufacturerURL>http://www.denon.com</manufacturerURL>
                <modelName>Denon AVR-X1500H</modelName>
                <modelNumber>Aios 4.025</modelNumber>
                <serialNumber>AYW27181117704</serialNumber>
                <UDN>uuid:73282090-1dcc-9671-6f2a-bd7738127c5a</UDN>
                <DeviceID>AIOS:0001</DeviceID>
                <firmwareRevision>147202</firmwareRevision>
                <firmware_date>Thu 2019-09-12 02:43:50</firmware_date>
                <firmware_version>1.520.200</firmware_version>
                <lanMac>00:05:CD:D1:F6:E8</lanMac>
                <locale>en_NA</locale>
                <moduleRevision>4</moduleRevision>
                <moduleType>Aios 4.025</moduleType>
                <productRevision>1</productRevision>
                <releaseType>Production</releaseType>
                <wlanMac>00:05:CD:D1:F6:EA</wlanMac>
                <serviceList>
                    <service>
                        <serviceType>urn:schemas-denon-com:service:ACT:1</serviceType>
                        <serviceId>urn:denon-com:serviceId:ACT</serviceId>
                        <SCPDURL>/ACT/SCPD.xml</SCPDURL>
                        <controlURL>/ACT/control</controlURL>
                        <eventSubURL>/ACT/event</eventSubURL>
                    </service>
                </serviceList>
            </device>
        </deviceList>
    </device>
</root>

Interesting here we see WebAPI port and Audyssey port 1265, maybe investigate fun things?

So I GET http://192.168.0.119:60006/upnp/scpd/renderer_dvc/AVTransport.xml Big XML maybe come back later (will paste at bottom of post)

Note that HTTP SUBSCRIBE normally is error 400. Now if I SUBSCRIBE http://192.168.0.119:60006/upnp/event/renderer_dvc/AVTransport I get:

<html>

<body>
    <h1>412 Precondition Failed</h1>
</body>

</html>

that may indicate it understands SUBSCRIBE method.

OK, now I open the app on my phone and turn on the receiver, change volume up & down, note that app is receiving state, turn off receiver.

Phone: GET /upnp/desc/aios_device/aios_device.xml Receiver: OK, replies with lengthy XML mentioned above Phone: GET GET /upnp/scpd/renderer_dvc/AVTransport.xml Receiver: OK, replies with XML Phone: GET /upnp/scpd/renderer_dvc/ConnectionManager.xml Receiver: OK, replies with XML:

<?xml version="1.0" encoding="utf-8"?>
<scpd xmlns="urn:schemas-upnp-org:service-1-0">
    <specVersion>
        <major>1</major>
        <minor>0</minor>
    </specVersion>
    <actionList>
        <action>
            <name>ConnectionComplete</name>
            <argumentList>
                <argument>
                    <name>ConnectionID</name>
                    <direction>in</direction>
                    <relatedStateVariable>A_ARG_TYPE_ConnectionID</relatedStateVariable>
                </argument>
            </argumentList>
        </action>
        <action>
            <name>GetCurrentConnectionIDs</name>
            <argumentList>
                <argument>
                    <name>ConnectionIDs</name>
                    <direction>out</direction>
                    <relatedStateVariable>CurrentConnectionIDs</relatedStateVariable>
                </argument>
            </argumentList>
        </action>
        <action>
            <name>GetCurrentConnectionInfo</name>
            <argumentList>
                <argument>
                    <name>ConnectionID</name>
                    <direction>in</direction>
                    <relatedStateVariable>A_ARG_TYPE_ConnectionID</relatedStateVariable>
                </argument>
                <argument>
                    <name>RcsID</name>
                    <direction>out</direction>
                    <relatedStateVariable>A_ARG_TYPE_RcsID</relatedStateVariable>
                </argument>
                <argument>
                    <name>AVTransportID</name>
                    <direction>out</direction>
                    <relatedStateVariable>A_ARG_TYPE_AVTransportID</relatedStateVariable>
                </argument>
                <argument>
                    <name>ProtocolInfo</name>
                    <direction>out</direction>
                    <relatedStateVariable>A_ARG_TYPE_ProtocolInfo</relatedStateVariable>
                </argument>
                <argument>
                    <name>PeerConnectionManager</name>
                    <direction>out</direction>
                    <relatedStateVariable>A_ARG_TYPE_ConnectionManager</relatedStateVariable>
                </argument>
                <argument>
                    <name>PeerConnectionID</name>
                    <direction>out</direction>
                    <relatedStateVariable>A_ARG_TYPE_ConnectionID</relatedStateVariable>
                </argument>
                <argument>
                    <name>Direction</name>
                    <direction>out</direction>
                    <relatedStateVariable>A_ARG_TYPE_Direction</relatedStateVariable>
                </argument>
                <argument>
                    <name>Status</name>
                    <direction>out</direction>
                    <relatedStateVariable>A_ARG_TYPE_ConnectionStatus</relatedStateVariable>
                </argument>
            </argumentList>
        </action>
        <action>
            <name>GetCurrentState</name>
            <argumentList>
                <argument>
                    <name>CurrentState</name>
                    <direction>out</direction>
                    <relatedStateVariable>CurrentState</relatedStateVariable>
                </argument>
            </argumentList>
        </action>
        <action>
            <name>GetProtocolInfo</name>
            <argumentList>
                <argument>
                    <name>Source</name>
                    <direction>out</direction>
                    <relatedStateVariable>SourceProtocolInfo</relatedStateVariable>
                </argument>
                <argument>
                    <name>Sink</name>
                    <direction>out</direction>
                    <relatedStateVariable>SinkProtocolInfo</relatedStateVariable>
                </argument>
            </argumentList>
        </action>
        <action>
            <name>PrepareForConnection</name>
            <argumentList>
                <argument>
                    <name>RemoteProtocolInfo</name>
                    <direction>in</direction>
                    <relatedStateVariable>A_ARG_TYPE_ProtocolInfo</relatedStateVariable>
                </argument>
                <argument>
                    <name>PeerConnectionManager</name>
                    <direction>in</direction>
                    <relatedStateVariable>A_ARG_TYPE_ConnectionManager</relatedStateVariable>
                </argument>
                <argument>
                    <name>PeerConnectionID</name>
                    <direction>in</direction>
                    <relatedStateVariable>A_ARG_TYPE_ConnectionID</relatedStateVariable>
                </argument>
                <argument>
                    <name>Direction</name>
                    <direction>in</direction>
                    <relatedStateVariable>A_ARG_TYPE_Direction</relatedStateVariable>
                </argument>
                <argument>
                    <name>ConnectionID</name>
                    <direction>out</direction>
                    <relatedStateVariable>A_ARG_TYPE_ConnectionID</relatedStateVariable>
                </argument>
                <argument>
                    <name>AVTransportID</name>
                    <direction>out</direction>
                    <relatedStateVariable>A_ARG_TYPE_AVTransportID</relatedStateVariable>
                </argument>
                <argument>
                    <name>RcsID</name>
                    <direction>out</direction>
                    <relatedStateVariable>A_ARG_TYPE_RcsID</relatedStateVariable>
                </argument>
            </argumentList>
        </action>
    </actionList>
    <serviceStateTable>
        <stateVariable sendEvents="no">
            <name>A_ARG_TYPE_AVTransportID</name>
            <dataType>i4</dataType>
        </stateVariable>
        <stateVariable sendEvents="no">
            <name>A_ARG_TYPE_ConnectionID</name>
            <dataType>i4</dataType>
        </stateVariable>
        <stateVariable sendEvents="no">
            <name>A_ARG_TYPE_ConnectionManager</name>
            <dataType>string</dataType>
        </stateVariable>
        <stateVariable sendEvents="no">
            <name>A_ARG_TYPE_ConnectionStatus</name>
            <dataType>string</dataType>
            <defaultValue>Unknown</defaultValue>
            <allowedValueList>
                <allowedValue>OK</allowedValue>
                <allowedValue>ContentFormatMismatch</allowedValue>
                <allowedValue>InsufficientBandwidth</allowedValue>
                <allowedValue>UnreliableChannel</allowedValue>
                <allowedValue>Unknown</allowedValue>
            </allowedValueList>
        </stateVariable>
        <stateVariable sendEvents="no">
            <name>A_ARG_TYPE_Direction</name>
            <dataType>string</dataType>
            <defaultValue>Input</defaultValue>
            <allowedValueList>
                <allowedValue>Input</allowedValue>
                <allowedValue>Output</allowedValue>
            </allowedValueList>
        </stateVariable>
        <stateVariable sendEvents="no">
            <name>A_ARG_TYPE_ProtocolInfo</name>
            <dataType>string</dataType>
        </stateVariable>
        <stateVariable sendEvents="no">
            <name>A_ARG_TYPE_RcsID</name>
            <dataType>i4</dataType>
        </stateVariable>
        <stateVariable sendEvents="yes">
            <name>CurrentConnectionIDs</name>
            <dataType>string</dataType>
        </stateVariable>
        <stateVariable sendEvents="no">
            <name>CurrentState</name>
            <dataType>string</dataType>
        </stateVariable>
        <stateVariable sendEvents="yes">
            <name>SinkProtocolInfo</name>
            <dataType>string</dataType>
        </stateVariable>
        <stateVariable sendEvents="yes">
            <name>SourceProtocolInfo</name>
            <dataType>string</dataType>
        </stateVariable>
    </serviceStateTable>
</scpd>

Phone: Gee, thanks! GET /upnp/scpd/renderer_dvc/RenderingControl.xml Receiver: OK, long XML similar to above ... some more bullshit ... basically the phone is hitting all the service endpoints Phone: SUBSCRIBE /upnp/event/renderer_dvc/ConnectionManager Phone: SUBSCRIBE /upnp/event/renderer_dvc/AVTransport Receiver: OK Receiver: OK Phone: SUBSCRIBE /upnp/event/renderer_dvc/RenderingControl Receiver: OK Now we see receiver NOTIFY Receiver (to phone:49200): NOTIFY

<e:propertyset
    xmlns:e="urn:schemas-upnp-org:event-1-0">
    <e:property>
        <CurrentConnectionIDs>
            </CurrentConnectionIDs>
        </e:property>
    <e:property>
        <SinkProtocolInfo>
            </SinkProtocolInfo>
        </e:property>
    <e:property>
        <SourceProtocolInfo>
            </SourceProtocolInfo>
        </e:property>
    </e:propertyset>

After this the NOTIFYs look like this:

<e:propertyset
    xmlns:e="urn:schemas-upnp-org:event-1-0">
    <e:property>
        <LastChange>
             [truncated]&lt;Event xmlns=&quot;urn:schemas-upnp-org:metadata-1-0/AVT/&quot;&gt;&lt;InstanceID val=&quot;0&quot;&gt;&lt;AVTransportURI val=&quot;file:///etc/sapphire/settings/nppl.xml&quot;/&gt;&lt;CurrentMediaDuration val=&quot;00:00:0
            </LastChange>
        </e:property>
    </e:propertyset>

here are some volume changes:

    xmlns:e="urn:schemas-upnp-org:event-1-0">
    <e:property>
        <LastChange>
             [truncated]&lt;Event xmlns=&quot;urn:schemas-upnp-org:metadata-1-0/RCS/&quot;&gt;&lt;InstanceID val=&quot;0&quot;&gt;&lt;Volume channel=&quot;Zone1&quot; val=&quot;53&quot;/&gt;&lt;VolumeDB channel=&quot;Zone1&quot; val=&quot;53&quot;/&g
            </LastChange>
        </e:property>
    </e:propertyset>
<e:propertyset
    xmlns:e="urn:schemas-upnp-org:event-1-0">
    <e:property>
        <LastChange>
             [truncated]&lt;Event xmlns=&quot;urn:schemas-upnp-org:metadata-1-0/RCS/&quot;&gt;&lt;InstanceID val=&quot;0&quot;&gt;&lt;Volume channel=&quot;Zone1&quot; val=&quot;54&quot;/&gt;&lt;VolumeDB channel=&quot;Zone1&quot; val=&quot;54&quot;/&g
            </LastChange>
        </e:property>
    </e:propertyset>

Don't know about these

<e:propertyset
    xmlns:e="urn:schemas-upnp-org:event-1-0">
    <e:property>
        <LastChange>
            &lt;Event xmlns=&quot;urn:schemas-upnp-org:metadata-1-0/AVT/&quot;&gt;&lt;InstanceID val=&quot;0&quot;&gt;&lt;TransportState val=&quot;TRANSITIONING&quot;/&gt;&lt;/InstanceID&gt;&lt;/Event&gt;
            </LastChange>
        </e:property>
    </e:propertyset>
<e:propertyset
    xmlns:e="urn:schemas-upnp-org:event-1-0">
    <e:property>
        <LastChange>
            &lt;Event xmlns=&quot;urn:schemas-upnp-org:metadata-1-0/AVT/&quot;&gt;&lt;InstanceID val=&quot;0&quot;&gt;&lt;TransportState val=&quot;STOPPED&quot;/&gt;&lt;/InstanceID&gt;&lt;/Event&gt;
            </LastChange>
        </e:property>
    </e:propertyset>

If I use postman to imitate the SUBSCRIBE methods I get that error 412. Here is the full HTTP of the first SUBSCRIBE: Hypertext Transfer Protocol SUBSCRIBE /upnp/event/renderer_dvc/ConnectionManager HTTP/1.1\r\n [Expert Info (Chat/Sequence): SUBSCRIBE /upnp/event/renderer_dvc/ConnectionManager HTTP/1.1\r\n] Request Method: SUBSCRIBE Request URI: /upnp/event/renderer_dvc/ConnectionManager Request Version: HTTP/1.1 HOST: 192.168.0.119:60006\r\n CALLBACK: http://192.168.0.100:49200/\r\n NT: upnp:event\r\n TIMEOUT: Second-180\r\n \r\n [Full request URI: http://192.168.0.119:60006/upnp/event/renderer_dvc/ConnectionManager]

Included the HOST CALLBACK NT TIMEOUT headers in Postman and got a 200 OK

Changed callback to .81 (the VM running WireShark) Let's go turn on receiver and move teh knob. Some grumbling and profanity later. Upon setting the callback to .51 (my actual computer) port to 80 (don't want to deal with firewall) I am now receiving NOTIFY from the receiver to my desktop computer as I fiddle with it from my phone. Note that I subscribed to four of the endpoints so I don't know which was correct. They are listed in that initial xml, the service endpoints. I am tired now.

<e:propertyset
    xmlns:e="urn:schemas-upnp-org:event-1-0">
    <e:property>
        <LastChange>
             [truncated]&lt;Event xmlns=&quot;urn:schemas-upnp-org:metadata-1-0/RCS/&quot;&gt;&lt;InstanceID val=&quot;0&quot;&gt;&lt;Mute channel=&quot;Master&quot; val=&quot;0&quot;/&gt;&lt;Mute channel=&quot;Zone1&quot; val=&quot;0&quot;/&gt;&lt;M
            </LastChange>
        </e:property>
    </e:propertyset>
<e:propertyset
    xmlns:e="urn:schemas-upnp-org:event-1-0">
    <e:property>
        <LastChange>
             [truncated]&lt;Event xmlns=&quot;urn:schemas-upnp-org:metadata-1-0/RCS/&quot;&gt;&lt;InstanceID val=&quot;0&quot;&gt;&lt;Volume channel=&quot;Zone1&quot; val=&quot;52&quot;/&gt;&lt;VolumeDB channel=&quot;Zone1&quot; val=&quot;52&quot;/&g
            </LastChange>
        </e:property>
    </e:propertyset>

Here is wireshark filter: (ip.src==192.168.0.100 and ip.dst==192.168.0.119) or (ip.dst==192.168.0.100 and ip.src==192.168.0.119) and http

I changed my mind and don't think I need to paste the big XML.

starkillerOG commented 4 years ago

@JPHutchins Greath work, this sounds really promising!

I was not familiar with postman, but I downloaded and installed it and looks like a nice tool. When I GET http://192.168.1.IP:60006/upnp/desc/aios_device/aios_device.xml I get a Could not get any response message...

I am afraid my receiver uses a diffrent port or something. I have a SR5008 that does not support HEOS. I hope I can get this protecal working on my receiver.

How do you do:

SUBSCRIBE http://receiverIP:60006/upnp/event/renderer_dvc/RenderingControl
with headers:
HOST receiverIP:60006
CALLBACK <http://yourIP:80/>
NT upnp:event
TIMEOUT Second-180

I do not see any option in postman to use SUBSCRIBE instead of GET?

What can I check to see if this protecoll works on a SR5008?

starkillerOG commented 4 years ago

I just found the following new endpoints that work for my receiver SR5008: http://192.168.1.IP:8080/description.xml http://192.168.1.IP:8080/RenderingControl/desc.xml http://192.168.1.IP:8080/ConnectionManager/desc.xml http://192.168.1.IP:8080/AVTransport/desc.xml

http://192.168.1.IP/goform/spotifyConfig (gives an error that I supplied an invallid command) The remote app uses a lot of http://192.168.1.IP/goform/AppCommand.xml and I can now also capture the request that is sends and the responses that it gets.

Will see if I get something working

starkillerOG commented 4 years ago

Note that HTTP SUBSCRIBE normally is error 400. Now if I SUBSCRIBE http://192.168.0.119:60006/upnp/event/renderer_dvc/AVTransport I get:

@JPHutchins How do you perform a HTTP SUBSCRIBE? Do you do that with postman or with python? How does that work?

I am wondering if I could subscribe to the http://192.168.1.IP:8080/AVTransport/desc that I just found...

JPHutchins commented 4 years ago

I think that you need to use wireshark to sniff the SSDP that I got that port 60006 xml endpoint from. That xml should contain a summary of what services are available.

Sent from my iPhone

On Feb 10, 2020, at 12:19 PM, starkillerOG notifications@github.com wrote:

Note that HTTP SUBSCRIBE normally is error 400. Now if I SUBSCRIBE http://192.168.0.119:60006/upnp/event/renderer_dvc/AVTransport I get:

@JPHutchins How do you perform a HTTP SUBSCRIBE? Do you do that with postman or with python? How does that work?

I am wondering if I could subscribe to the http://192.168.1.IP:8080/AVTransport/desc that I just found...

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

JPHutchins commented 4 years ago

If you would like to try subscribe you need to type it in where you would normally select the method. If you ever get response, including that 412, then you found an endpoint.

Sent from my iPhone

On Feb 10, 2020, at 12:19 PM, starkillerOG notifications@github.com wrote:

Note that HTTP SUBSCRIBE normally is error 400. Now if I SUBSCRIBE http://192.168.0.119:60006/upnp/event/renderer_dvc/AVTransport I get:

@JPHutchins How do you perform a HTTP SUBSCRIBE? Do you do that with postman or with python? How does that work?

I am wondering if I could subscribe to the http://192.168.1.IP:8080/AVTransport/desc that I just found...

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

JPHutchins commented 4 years ago

Let’s look at https://github.com/flyte/upnpclient

Sent from my iPhone

On Feb 10, 2020, at 12:19 PM, starkillerOG notifications@github.com wrote:

Note that HTTP SUBSCRIBE normally is error 400. Now if I SUBSCRIBE http://192.168.0.119:60006/upnp/event/renderer_dvc/AVTransport I get:

@JPHutchins How do you perform a HTTP SUBSCRIBE? Do you do that with postman or with python? How does that work?

I am wondering if I could subscribe to the http://192.168.1.IP:8080/AVTransport/desc that I just found...

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

JPHutchins commented 4 years ago

@starkillerOG I'd like for you to try the upnpclient library since this already seems promising for implementation (though the existing ssdp could be expanded, I just like other people doing the work ;))

pip install upnpclient
python3

Now in python3 repl:

import upnpclient as upnp
devices = upnp.discover()
devices

This should print a list of discovered upnp on your network. Note the index number (mine is 1) and assign it to d:

d = devices[1]
d.services

This prints some capabilities, let's compare:

[
  <Service service_id='urn:upnp-org:serviceId:AVTransport'>, 
  <Service service_id='urn:upnp-org:serviceId:ConnectionManager'>, 
  <Service service_id='urn:upnp-org:serviceId:RenderingControl'>, 
  <Service service_id='urn:denon-com:serviceId:ErrorHandler'>, 
  <Service service_id='urn:denon-com:serviceId:ZoneControl'>, 
  <Service service_id='urn:denon-com:serviceId:GroupControl'>, 
  <Service service_id='urn:upnp-org:serviceId:ContentDirectory'>, 
  <Service service_id='urn:upnp-org:serviceId:ConnectionManager'>, 
  <Service service_id='urn:denon-com:serviceId:ACT'>
]

Now let's see if we can find your endpoint!

d.location

For me this displays:

'http://192.168.0.119:60006/upnp/desc/aios_device/aios_device.xml'

This is part of the upnp protocol, a description of available services. Apparently this is fairly standardized so I probably wasted some time using wireshark.

Gonna keep going here. Assign the RenderingControl service to s, (mine is at index 2):

s = d.services[2]

You can then initiate a subscribe. Here I am subscribing the computer I am working from so that I can see the NOTIFYs.

s.subscribe('http://192.168.0.51')

I look in wireshark with filter: ip.src== 192.168.0.119 and I see the NOTIFY from the denon as I change the volume

starkillerOG commented 4 years ago

When I run:

import upnpclient as upnp
devices = upnp.discover()

I get these errors regarding my SR5008:

Error 'xmlns:ms: ' urn:microsoft-com:wmc-1-0' is not a valid URI, line 4, column 40 (<string>, line 4)' for http://192.168.1.xxx:8080/description.xml
Error 'xmlns:ms: ' urn:microsoft-com:wmc-1-0' is not a valid URI, line 4, column 40 (<string>, line 4)' for http://192.168.1.xxx:8080/description.xml
Error 'xmlns:ms: ' urn:microsoft-com:wmc-1-0' is not a valid URI, line 4, column 40 (<string>, line 4)' for http://192.168.1.xxx:8080/description.xml
Error 'xmlns:ms: ' urn:microsoft-com:wmc-1-0' is not a valid URI, line 4, column 40 (<string>, line 4)' for http://192.168.1.xxx:8080/description.xml
Error 'xmlns:ms: ' urn:microsoft-com:wmc-1-0' is not a valid URI, line 4, column 40 (<string>, line 4)' for http://192.168.1.xxx:8080/description.xml
Error 'xmlns:ms: ' urn:microsoft-com:wmc-1-0' is not a valid URI, line 4, column 40 (<string>, line 4)' for http://192.168.1.xxx:8080/description.xml

If I then run devices, I do get a list summing up some devices I have on my network but the Marantz is not in there, probably because of those errors mentioned above....

If I look at http://192.168.1.xxx:8080/description.xml I get the following XML:

<?xml version="1.0"?>
<root
  xmlns="urn:schemas-upnp-org:device-1-0"
  xmlns:ms=" urn:microsoft-com:wmc-1-0"
  xmlns:smsc="www.smsc.com"
  xmlns:qq="http://www.tencent.com"
  xmlns:pnpx="http://schemas.microsoft.com/windows/pnpx/2005/11"
  xmlns:df="http://schemas.microsoft.com/windows/2008/09/devicefoundation">
    <specVersion>
        <major>1</major>
        <minor>0</minor>
    </specVersion>
    <device>
        <dlna:X_DLNADOC xmlns:dlna="urn:schemas-dlna-org:device-1-0">DMR-1.50</dlna:X_DLNADOC>
        <pnpx:X_compatibleId>MS_DigitalMediaDeviceClass_DMR_V001
                </pnpx:X_compatibleId>
        <pnpx:X_deviceCategory>MediaDevices
                </pnpx:X_deviceCategory>
        <pnpx:X_hardwareId>VEN_0126&amp;DEV_0022&amp;REV_01
                </pnpx:X_hardwareId>
        <df:X_deviceCategory>Multimedia.DMR
                </df:X_deviceCategory>
        <deviceType>urn:schemas-upnp-org:device:MediaRenderer:1</deviceType>
        <friendlyName>?</friendlyName>
        <manufacturer>Marantz</manufacturer>
        <manufacturerURL>http://www.marantz.com</manufacturerURL>
        <modelDescription>AV SURROUND RECEIVER</modelDescription>
        <modelName>*SR5008</modelName>
        <modelNumber>5008</modelNumber>
        <modelURL>http://www.marantz.com</modelURL>
        <serialNumber>?</serialNumber>
        <UDN>?</UDN>
        <UPC>?</UPC>
        <iconList>
            <icon>
                <mimetype>image/jpeg</mimetype>
                <width>48</width>
                <height>48</height>
                <depth>24</depth>
                <url>/BCO_device_sm_icon.jpg</url>
            </icon>
            <icon>
                <mimetype>image/jpeg</mimetype>
                <width>120</width>
                <height>120</height>
                <depth>24</depth>
                <url>/BCO_device_lrg_icon.jpg</url>
            </icon>
            <icon>
                <mimetype>image/png</mimetype>
                <width>48</width>
                <height>48</height>
                <depth>24</depth>
                <url>/BCO_device_sm_icon.png</url>
            </icon>
            <icon>
                <mimetype>image/png</mimetype>
                <width>120</width>
                <height>120</height>
                <depth>24</depth>
                <url>/BCO_device_lrg_icon.png</url>
            </icon>
        </iconList>
        <serviceList>
            <service>
                <serviceType>urn:schemas-upnp-org:service:RenderingControl:1</serviceType>
                <serviceId>urn:upnp-org:serviceId:RenderingControl</serviceId>
                <SCPDURL>/RenderingControl/desc.xml</SCPDURL>
                <controlURL>/RenderingControl/ctrl</controlURL>
                <eventSubURL>/RenderingControl/evt</eventSubURL>
            </service>
            <service>
                <serviceType>urn:schemas-upnp-org:service:ConnectionManager:1</serviceType>
                <serviceId>urn:upnp-org:serviceId:ConnectionManager</serviceId>
                <SCPDURL>/ConnectionManager/desc.xml</SCPDURL>
                <controlURL>/ConnectionManager/ctrl</controlURL>
                <eventSubURL>/ConnectionManager/evt</eventSubURL>
            </service>
            <service>
                <serviceType>urn:schemas-upnp-org:service:AVTransport:1</serviceType>
                <serviceId>urn:upnp-org:serviceId:AVTransport</serviceId>
                <SCPDURL>/AVTransport/desc.xml</SCPDURL>
                <controlURL>/AVTransport/ctrl</controlURL>
                <eventSubURL>/AVTransport/evt</eventSubURL>
            </service>
        </serviceList>
        <presentationURL>http://192.168.1.xxx</presentationURL>
    </device>
</root>

Note that I replaced IP with xxx and some unimportant info with ?

I am pretty sure the problem is the space " " in the urn in line 4: xmlns:ms=" urn:microsoft-com:wmc-1-0"

Will see if I can fix this by edeting upnpclient.

JPHutchins commented 4 years ago

Try the subscribe url from postman again like in my original post but use port 8080 instead of 60006.

Are you 100% sure that it is not in the devices list, it sure looks like it found it!

Sent from my iPhone

On Feb 10, 2020, at 11:31 PM, starkillerOG notifications@github.com wrote:

When I run:

import upnpclient as upnp devices = upnp.discover() I get these errors regarding my SR5008:

Error 'xmlns:ms: ' urn:microsoft-com:wmc-1-0' is not a valid URI, line 4, column 40 (, line 4)' for http://192.168.1.xxx:8080/description.xml Error 'xmlns:ms: ' urn:microsoft-com:wmc-1-0' is not a valid URI, line 4, column 40 (, line 4)' for http://192.168.1.xxx:8080/description.xml Error 'xmlns:ms: ' urn:microsoft-com:wmc-1-0' is not a valid URI, line 4, column 40 (, line 4)' for http://192.168.1.xxx:8080/description.xml Error 'xmlns:ms: ' urn:microsoft-com:wmc-1-0' is not a valid URI, line 4, column 40 (, line 4)' for http://192.168.1.xxx:8080/description.xml Error 'xmlns:ms: ' urn:microsoft-com:wmc-1-0' is not a valid URI, line 4, column 40 (, line 4)' for http://192.168.1.xxx:8080/description.xml Error 'xmlns:ms: ' urn:microsoft-com:wmc-1-0' is not a valid URI, line 4, column 40 (, line 4)' for http://192.168.1.xxx:8080/description.xml If I then run devices, I do get a list summing up some devices I have on my network but the Marantz is not in there, probably because of those errors mentioned above....

If I look at http://192.168.1.xxx:8080/description.xml I get the following XML:

<?xml version="1.0"?> <root xmlns="urn:schemas-upnp-org:device-1-0" xmlns:ms=" urn:microsoft-com:wmc-1-0" xmlns:smsc="www.smsc.com" xmlns:qq="http://www.tencent.com" xmlns:pnpx="http://schemas.microsoft.com/windows/pnpx/2005/11" xmlns:df="http://schemas.microsoft.com/windows/2008/09/devicefoundation">

1 0 DMR-1.50 MS_DigitalMediaDeviceClass_DMR_V001 MediaDevices VEN_0126&DEV_0022&REV_01 Multimedia.DMR urn:schemas-upnp-org:device:MediaRenderer:1 ? Marantz http://www.marantz.com AV SURROUND RECEIVER *SR5008 5008 http://www.marantz.com ? ? ? image/jpeg 48 48 24 /BCO_device_sm_icon.jpg image/jpeg 120 120 24 /BCO_device_lrg_icon.jpg image/png 48 48 24 /BCO_device_sm_icon.png image/png 120 120 24 /BCO_device_lrg_icon.png urn:schemas-upnp-org:service:RenderingControl:1 urn:upnp-org:serviceId:RenderingControl /RenderingControl/desc.xml /RenderingControl/ctrl /RenderingControl/evt urn:schemas-upnp-org:service:ConnectionManager:1 urn:upnp-org:serviceId:ConnectionManager /ConnectionManager/desc.xml /ConnectionManager/ctrl /ConnectionManager/evt urn:schemas-upnp-org:service:AVTransport:1 urn:upnp-org:serviceId:AVTransport /AVTransport/desc.xml /AVTransport/ctrl /AVTransport/evt http://192.168.1.xxx Note that I replaced IP with xxx and some unimportant info with ? I am pretty sure the problem is the space " " in the urn in line 4: xmlns:ms=" urn:microsoft-com:wmc-1-0" Will see if I can fix this by edeting upnpclient. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.
starkillerOG commented 4 years ago

@JPHutchins we are making progress, the orignal url that you used does not work for me, but the url specified in the http://192.168.1.xxx:8080/description.xml of my receiver do give responses:

I used postman

SUBSCRIBE: http://192.168.1.ReceiverIP:8080/AVTransport/evt with the headers:

HOST: 192.168.1.ReceiverIP:8080
CALLBACK: http://192.168.1.PC_IP:80/
NT: upnp:event
TIMEOUT: Second-180

I get response "412 Precondition Failed" so i would say that is progress

using the same headers I get:

http://192.168.1.ReceiverIP:8080/RenderingControl/evt --> 412 Precondition Failed
http://192.168.1.ReceiverIP:8080/ConnectionManager/evt --> 412 Precondition Failed
http://192.168.1.ReceiverIP:8080/AVTransport/evt --> 412 Precondition Failed

http://192.168.1.ReceiverIP:8080/ConnectionManager/ctrl --> 405 Method Not Allowed
starkillerOG commented 4 years ago

@JPHutchins yes I am sure the Marantz is not listed in devices after using

import upnpclient as upnp
devices = upnp.discover()
devices
JPHutchins commented 4 years ago

That is disappointing. Can you post the output of devices? According the XML yours should be an item in the list given a single question mark, so it would be easy to miss.

change CALLBACK: http://192.168.1.PC_IP:80/ to CALLBACK: <http://192.168.1.PC_IP:80/>

starkillerOG commented 4 years ago

@JPHutchins you are a greath help, thank you!!!

changed CALLBACK to <http://192.168.1.PC_IP:80/> and I got a 200 OK response!

I used postman

SUBSCRIBE: http://192.168.1.ReceiverIP:8080/AVTransport/evt with headers:

HOST: 192.168.1.ReceiverIP:8080
CALLBACK: <http://192.168.1.PC_IP:80>
NT: upnp:event

(I did not need the timeout)

All endpoints now respond with 200 OK:

http://192.168.1.ReceiverIP:8080/RenderingControl/evt --> 200 OK
http://192.168.1.ReceiverIP:8080/ConnectionManager/evt --> 200 OK
http://192.168.1.ReceiverIP:8080/AVTransport/evt --> 200 OK

On wirshark on my PC I see a synchoronize tcp SYN coming from the Marantz to the PC on the port I specify with CALLBACK, unfortanetly this SYN is never acknowledged or responded to so I see a few retransmissions of the SYN coming from the Marantz to the PC and then it quits.

I never see any notifications of vollume changes, but I guess that is because the connection of the callback cannot be established properly.

@JPHutchins How did you manage to establish that callback connection and receive the events?

starkillerOG commented 4 years ago

I managed to receive some Notify:) I used the following python script to receive the notification and open a port:

import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind(('192.168.1.PC_IP', 50000))
s.listen(1)
socksize = 1024
print("Now listening...\n")
conn, addr = s.accept()
print('New connection from %s:%d' % (addr[0], addr[1]))

while True:
    data = conn.recv(socksize)
    if data:
        print(data)
    elif data == 'killsrv':
        conn.close()
        sys.exit()

print("closing socket")
s.close()

I used the subscription in postman of my previous command and a random port number (like 50000), to endpoint: http://192.168.1.Receiver_IP:8080/RenderingControl/evt

I then received the following:

b'NOTIFY / HTTP/1.1\r\nHOST: 192.168.1.PC_IP:50014\r\nCONTENT-TYPE: text/xml;charset="utf-8"\r\nCONTENT-LENGTH: 502\r\nNT: upnp:event\r\nNTS: upnp:propchange\r\nSID: uuid:???\r\nSEQ: 0\r\n\r\n'
b'<e:propertyset xmlns:e="urn:schemas-upnp-org:event-1-0">\r\n  <e:property>\r\n    <LastChange>&lt;Event xmlns=&quot;urn:schemas-upnp-org:metadata-1-0/RCS/&quot;&gt;\r\n  &lt;InstanceID val=&quot;0&quot;&gt;\r\n    &lt;PresetNameList val=&quot;FactoryDefaults, InstallationDefaults&quot;/&gt;\r\n    &lt;Mute channel=&quot;Master&quot; val=&quot;0&quot;/&gt;\r\n    &lt;Volume channel=&quot;Master&quot; val=&quot;0&quot;/&gt;\r\n  &lt;/InstanceID&gt;\r\n&lt;/Event&gt;</LastChange>\r\n  </e:property>\r\n</e:propertyset>\r\n'

Unfortunately I do not receive any additional event/notifies when I change vollume or channel.... If I look at the http://192.168.1.Receiver_IP:8080/RenderingControl/desc.xml I see:

<?xml version="1.0"?>
<scpd
  xmlns="urn:schemas-upnp-org:service-1-0">
    <specVersion>
        <major>1</major>
        <minor>0</minor>
    </specVersion>
    <actionList>
        <action>
            <name>ListPresets</name>
            <argumentList>
                <argument>
                    <name>InstanceID</name>
                    <direction>in</direction>
                    <relatedStateVariable>A_ARG_TYPE_InstanceID</relatedStateVariable>
                </argument>
                <argument>
                    <name>CurrentPresetNameList</name>
                    <direction>out</direction>
                    <relatedStateVariable>PresetNameList</relatedStateVariable>
                </argument>
            </argumentList>
        </action>
        <action>
            <name>SelectPreset</name>
            <argumentList>
                <argument>
                    <name>InstanceID</name>
                    <direction>in</direction>
                    <relatedStateVariable>A_ARG_TYPE_InstanceID</relatedStateVariable>
                </argument>
                <argument>
                    <name>PresetName</name>
                    <direction>in</direction>
                    <relatedStateVariable>A_ARG_TYPE_PresetName</relatedStateVariable>
                </argument>
            </argumentList>
        </action>
        <action>
            <name>GetMute</name>
            <argumentList>
                <argument>
                    <name>InstanceID</name>
                    <direction>in</direction>
                    <relatedStateVariable>A_ARG_TYPE_InstanceID</relatedStateVariable>
                </argument>
                <argument>
                    <name>Channel</name>
                    <direction>in</direction>
                    <relatedStateVariable>A_ARG_TYPE_Channel</relatedStateVariable>
                </argument>
                <argument>
                    <name>CurrentMute</name>
                    <direction>out</direction>
                    <relatedStateVariable>Mute</relatedStateVariable>
                </argument>
            </argumentList>
        </action>
        <action>
            <name>SetMute</name>
            <argumentList>
                <argument>
                    <name>InstanceID</name>
                    <direction>in</direction>
                    <relatedStateVariable>A_ARG_TYPE_InstanceID</relatedStateVariable>
                </argument>
                <argument>
                    <name>Channel</name>
                    <direction>in</direction>
                    <relatedStateVariable>A_ARG_TYPE_Channel</relatedStateVariable>
                </argument>
                <argument>
                    <name>DesiredMute</name>
                    <direction>in</direction>
                    <relatedStateVariable>Mute</relatedStateVariable>
                </argument>
            </argumentList>
        </action>
        <action>
            <name>GetVolume</name>
            <argumentList>
                <argument>
                    <name>InstanceID</name>
                    <direction>in</direction>
                    <relatedStateVariable>A_ARG_TYPE_InstanceID</relatedStateVariable>
                </argument>
                <argument>
                    <name>Channel</name>
                    <direction>in</direction>
                    <relatedStateVariable>A_ARG_TYPE_Channel</relatedStateVariable>
                </argument>
                <argument>
                    <name>CurrentVolume</name>
                    <direction>out</direction>
                    <relatedStateVariable>Volume</relatedStateVariable>
                </argument>
            </argumentList>
        </action>
        <action>
            <name>SetVolume</name>
            <argumentList>
                <argument>
                    <name>InstanceID</name>
                    <direction>in</direction>
                    <relatedStateVariable>A_ARG_TYPE_InstanceID</relatedStateVariable>
                </argument>
                <argument>
                    <name>Channel</name>
                    <direction>in</direction>
                    <relatedStateVariable>A_ARG_TYPE_Channel</relatedStateVariable>
                </argument>
                <argument>
                    <name>DesiredVolume</name>
                    <direction>in</direction>
                    <relatedStateVariable>Volume</relatedStateVariable>
                </argument>
            </argumentList>
        </action>
    </actionList>
    <serviceStateTable>
        <stateVariable sendEvents="no">
            <name>PresetNameList</name>
            <dataType>string</dataType>
        </stateVariable>
        <stateVariable sendEvents="yes">
            <name>LastChange</name>
            <dataType>string</dataType>
        </stateVariable>
        <stateVariable sendEvents="no">
            <name>Mute</name>
            <dataType>boolean</dataType>
        </stateVariable>
        <stateVariable sendEvents="no">
            <name>Volume</name>
            <dataType>ui2</dataType>
            <allowedValueRange>
                <minimum>255</minimum>
                <maximum>0</maximum>
                <step>1</step>
            </allowedValueRange>
        </stateVariable>
        <stateVariable sendEvents="no">
            <name>A_ARG_TYPE_Channel</name>
            <dataType>string</dataType>
            <allowedValueList>
                <allowedValue>Master</allowedValue>
            </allowedValueList>
        </stateVariable>
        <stateVariable sendEvents="no">
            <name>A_ARG_TYPE_InstanceID</name>
            <dataType>ui4</dataType>
        </stateVariable>
        <stateVariable sendEvents="no">
            <name>A_ARG_TYPE_PresetName</name>
            <dataType>string</dataType>
            <allowedValueList>
                <allowedValue>FactoryDefaults</allowedValue>
            </allowedValueList>
        </stateVariable>
    </serviceStateTable>
</scpd>

I see the sendEvents="no" in a lot of places, is this also the case with you @JPHutchins? I think that is my current problem, not sure how to get those to "yes"...... Probably through the http://192.168.1.Receiver_IP:8080/RenderingControl/ctrl endpoint with some POST but do not have a qlue what to sent....

any ideas @JPHutchins?

starkillerOG commented 4 years ago

If I do my best to format the event that I received I get:

<e:propertyset xmlns:e="urn:schemas-upnp-org:event-1-0">
  <e:property>
    <LastChange>
      <Event xmlns='urn:schemas-upnp-org:metadata-1-0/RCS/'>
       <InstanceID val='0'>
           <PresetNameList val='FactoryDefaults, InstallationDefaults'>
           <Mute channel='Master' val='0'>
           <Volume channel='Master' val='0'>
        </InstanceID>
      </Event>
    </LastChange>
  </e:property>
</e:propertyset>

Litle bit strange it gives me a vollume value of 0 while I am playing music and the vollume is defenitly not 0!

JPHutchins commented 4 years ago

@starkillerOG To trigger the events I was moving the volume up and down. My XML for RenderingControl is very similar with a lot of sendEvents="no" so hopefully we don't have to get too fiddly.

I would keep that socket open and subscribe to all of the evt endpoints(RenderingControl, AVTransport, ConnectionManager) you have found changing the volume up and down after each subscription (remotely is OK - at least that's how I've done it) until you see greater frequency of NOTIFYs.

JPHutchins commented 4 years ago

@starkillerOG I would also encourage running WireShark with filter ip.src==receiverIP and take a look at the SSDP broadcast message. It should have a "Location" tag that points you to the upnp endpoint - maybe you have discovered an older implementation that is partially working or something?

Please paste the output of the SSDP here for documentation purposes.

starkillerOG commented 4 years ago

Here is the SSDP output from a packet capture:

M-SEARCH * HTTP/1.1
Content-Length: 0
ST: urn:schemas-upnp-org:device:MediaRenderer:1
MX: 3
MAN: "ssdp:discover"
HOST: 239.255.255.250:1900

HTTP/1.1 200 OK
CACHE-CONTROL: max-age=1800
EXT:
LOCATION: http://192.168.1.Receiver_IP:8080/description.xml
SERVER: KnOS/3.2 UPnP/1.0 DMP/3.5
ST: urn:schemas-upnp-org:device:MediaRenderer:1
USN: uuid:???::urn:schemas-upnp-org:device:MediaRenderer:1

(Note: I have replaced the Receiver_IP and USN:uuid).

starkillerOG commented 4 years ago

@JPHutchins What program/script did you use to capture the Notifies?

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.