thibauts / node-upnp-mediarenderer-client

An UPnP/DLNA MediaRenderer client
MIT License
126 stars 30 forks source link

fix: Samsung responds EUPNP on PrepareForConnection #36

Open gdamjan opened 2 years ago

gdamjan commented 2 years ago

a Samsung Q60 Series (50) tv responds with HTTP error 500 on the ConnectionManager:PrepareForConnection call and upnp-device-client returns the error:

Local restrictions (704) {
  code: 'EUPNP',
  statusCode: 500,
  errorCode: '704'
}

if we ignore it, similar to ENOACTION, it starts to play

gdamjan commented 2 years ago

full dump of the PrepareForConnection error

POST /upnp/control/ConnectionManager1 HTTP/1.1
Content-Type: text/xml; charset="utf-8"
Content-Length: 462
Connection: close
SOAPACTION: "urn:schemas-upnp-org:service:ConnectionManager:1#PrepareForConnection"
Host: 10.10.37.154:9197

<?xml version='1.0' encoding='utf-8'?>
<s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><u:PrepareForConnection xmlns:u="urn:schemas-upnp-org:service:ConnectionManager:1"><RemoteProtocolInfo>http-get:*:video/quicktime:*</RemoteProtocolInfo><PeerConnectionManager /><PeerConnectionID>-1</PeerConnectionID><Direction>Input</Direction></u:PrepareForConnection></s:Body></s:Envelope>

HTTP/1.1 500 Internal Server Error
EXT: 
CONNECTION: close
CONTENT-TYPE: text/xml; charset="utf-8"
SERVER:UPnP/1.0, Samsung AllShare Server/1.0
DATE: Mon, 03 Jan 2022 22:42:58 GMT
USER-AGENT: Samsung User-Agent DLNADOC/1.50
Content-Length: 440

<?xml version="1.0" encoding="utf-8"?><s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><s:Fault><faultcode>s:Client</faultcode><faultstring>UPnPError</faultstring><detail><UPnPError xmlns="urn:schemas-upnp-org:control-1-0"><errorCode>704</errorCode><errorDescription>Local restrictions</errorDescription></UPnPError></detail></s:Fault></s:Body></s:Envelope>

dump of the /dmr

GET /dmr HTTP/1.1
Host: 10.10.37.154:9197
Connection: close

HTTP/1.1 200 OK
Content-Type: text/xml; charset="utf-8"
Content-Length: 3276
Connection: close
User-Agent: DLNADOC/1.50 SEC_HHP_[TV] Samsung Q60 Series (50)
Server: SHP, UPnP/1.0, Samsung UPnP SDK/1.0

<?xml version="1.0"?>
<root xmlns="urn:schemas-upnp-org:device-1-0" xmlns:pnpx="http://schemas.microsoft.com/windows/pnpx/2005/11" xmlns:df="http://schemas.microsoft.com/windows/2008/09/devicefoundation" xmlns:sec="http://www.sec.co.kr/dlna">
  <specVersion>
    <major>1</major>
    <minor>0</minor>
  </specVersion>
  <device>
    <deviceType>urn:schemas-upnp-org:device:MediaRenderer:1</deviceType>
    <pnpx:X_compatibleId>MS_DigitalMediaDeviceClass_DMR_V001</pnpx:X_compatibleId>
    <df:X_deviceCategory>Display.TV.LCD Multimedia.DMR</df:X_deviceCategory>
    <dlna:X_DLNADOC xmlns:dlna="urn:schemas-dlna-org:device-1-0">DMR-1.50</dlna:X_DLNADOC>
    <friendlyName>[TV] Samsung Q60 Series (50)</friendlyName>
    <manufacturer>Samsung Electronics</manufacturer>
    <manufacturerURL>http://www.samsung.com/sec</manufacturerURL>
    <modelDescription>Samsung TV DMR</modelDescription>
    <modelName>QE50Q60TAUXXH</modelName>
    <modelNumber>AllShare1.0</modelNumber>
    <modelURL>http://www.samsung.com/sec</modelURL>
    <serialNumber>0F1W3HFN800851W</serialNumber>
    <UDN>uuid:5ef15cc9-4fda-455d-9154-d349d5d40177</UDN>
    <iconList>
      <icon>
        <mimetype>image/jpeg</mimetype>
        <width>48</width>
        <height>48</height>
        <depth>24</depth>
        <url>/icon_SML.jpg</url>
      </icon>
      <icon>
        <mimetype>image/jpeg</mimetype>
        <width>120</width>
        <height>120</height>
        <depth>24</depth>
        <url>/icon_LRG.jpg</url>
      </icon>
      <icon>
        <mimetype>image/png</mimetype>
        <width>48</width>
        <height>48</height>
        <depth>24</depth>
        <url>/icon_SML.png</url>
      </icon>
      <icon>
        <mimetype>image/png</mimetype>
        <width>120</width>
        <height>120</height>
        <depth>24</depth>
        <url>/icon_LRG.png</url>
      </icon>
    </iconList>
    <serviceList>
      <service>
        <serviceType>urn:schemas-upnp-org:service:RenderingControl:1</serviceType>
        <serviceId>urn:upnp-org:serviceId:RenderingControl</serviceId>
        <controlURL>/upnp/control/RenderingControl1</controlURL>
        <eventSubURL>/upnp/event/RenderingControl1</eventSubURL>
        <SCPDURL>/RenderingControl_1.xml</SCPDURL>
      </service>
      <service>
        <serviceType>urn:schemas-upnp-org:service:ConnectionManager:1</serviceType>
        <serviceId>urn:upnp-org:serviceId:ConnectionManager</serviceId>
        <controlURL>/upnp/control/ConnectionManager1</controlURL>
        <eventSubURL>/upnp/event/ConnectionManager1</eventSubURL>
        <SCPDURL>/ConnectionManager_1.xml</SCPDURL>
      </service>
      <service>
        <serviceType>urn:schemas-upnp-org:service:AVTransport:1</serviceType>
        <serviceId>urn:upnp-org:serviceId:AVTransport</serviceId>
        <controlURL>/upnp/control/AVTransport1</controlURL>
        <eventSubURL>/upnp/event/AVTransport1</eventSubURL>
        <SCPDURL>/AVTransport_1.xml</SCPDURL>
      </service>
    </serviceList>
    <sec:ProductCap>Tizen,Y2020,WebURIPlayable,NavigateInPause,ScreenMirroringP2PMAC=5e:c1:d7:f3:0a:8c,UHD_SCREEN,SerialNumber=0F1W3HFN800851W,vdProductType=TV,OCF=1</sec:ProductCap>
    <pnpx:X_hardwareId>VEN_0105&amp;DEV_VD0001</pnpx:X_hardwareId>
  </device>
</root>