Jey-Cee / ioBroker.upnp

Serves for communication and interaction with all upnp-capable devices.
MIT License
10 stars 8 forks source link

[Bug]: Adapter seems to create wrong url #104

Open Berchemer opened 2 years ago

Berchemer commented 2 years ago

Contact Details

No response

What happened?

As written in https://forum.iobroker.net/topic/51767/vorlage-upnp-media-player/10?_=1643386555921 the adapter seems to create a wrong url. Attached wanted Objekt AVTransport.

2022-01-28 - 17_18 - Objekte - upnp.0.1_OG-Salon-_Internetradio.MediaRenderer.AVTransport.txt

Adapter Version

1.0.20

JS-Controller Version

3.3.22

Node JS Version

v14.18.2

NPM Version

6.14.15

Operating System

Ubuntu

Relevant log output

No response

Anything else?

No response

Jey-Cee commented 2 years ago

Open the link and post it here: http://192.168.0.113:1400/xml/device_description.xml

Berchemer commented 2 years ago

The Output of http://192.168.0.73:1400/xml/device_description.xml which is the Symfonic/Sonos-Device

new 139.txt

Can't get an Output of http://192.168.0.81:8080/xml/device_description.xml which should be the Output of the Silvercrest-Device. Onlöy Output is:

XML-Verarbeitungsfehler: Kein Wurzel-Element gefunden
Adresse: http://192.168.0.81:8080/xml/device_description.xml
Zeile Nr. 1, Spalte 1:
Jey-Cee commented 2 years ago

If it is no sonos device the file name is not the same. You can search for it with the app "upnp tool" for Android.

Berchemer commented 2 years ago

Attached are all XML outputs created with the UPnP tool.

There are four different devices.

A Sonos-compatible device "Symfonisk" from IKEA - SYMFONISK_neu.zip

Three devices from Silvercrest that work in the manner of Fontier Silicon. Since I wanted to be sure that I hadn't overlooked any differences, I'm attaching the information for all three devices.

However, the expenditure should be uniform so far.

It is about: Internet Radio: Silvercrest_SIRD14C4 - Silvercrest_SIRD14C4.zip WiFi speaker: Silvercrest_SMRS18A1 - Silvercrest_SMRS18A1.zip WiFi speaker: Silvercrest_SMRS30A1 - Silvercrest_SMRS30A1.zip

I hope I could help 😁

Jey-Cee commented 2 years ago

The URL is wrong because the silvercrest devices deliver it wrong. You have to add "/" in the AVTransport Object at URL entries.

Leave this issue open, as reminder to add validation for the url.

Berchemer commented 2 years ago

The URL is wrong because the silvercrest devices deliver it wrong. You have to add "/" in the AVTransport Object at URL entries.

Leave this issue open, as reminder to add validation for the url.

You mean: { "type": "channel", "common": { "name": "AVTransport" }, "native": { "serviceType": "urn:schemas-upnp-org:service:AVTransport:1", "serviceID": "urn:upnp-org:serviceId:AVTransport", "controlURL": "/AVTransport/control", "eventSubURL": "/AVTransport/event", "SCPDURL": "/AVTransport/scpd.xml", "name": "AVTransport" }, "_id": "upnp.0.1__OG_-_Salon_-_Internetradio.MediaRenderer.AVTransport", "acl": { "object": 1636, "owner": "system.user.admin", "ownerGroup": "system.group.administrator" }, "from": "system.adapter.admin.0", "user": "system.user.admin", "ts": 1643546278100 }

In this case I get following warn-message: Unexpected answer from upnp service: {"statusCode":500,"body":"<s:Envelope\r\n xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\" s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\"><s:Body><s:Fault><faultcode>s:Client</faultcode><faultstring>UPnPError</faultstring><detail><UPnPError xmlns=\"urn:schemas-upnp-org:control-1-0\"><errorCode>501</errorCode><errorDescription>Invalid XML</errorDescription></UPnPError></detail></s:Fault></s:Body></s:Envelope>","headers":{"content-length":"397","ext":"","content-type":"text/xml; charset=\"utf-8\"","server":"POSIX, UPnP/1.0, Intel MicroStack/1.0.2777"},"request":{"uri":{"protocol":"http:","slashes":true,"auth":null,"host":"192.168.0.81:8080","port":"8080","hostname":"192.168.0.81","hash":null,"search":null,"query":null,"pathname":"/AVTransport/control","path":"/AVTransport/control","href":"http://192.168.0.81:8080/AVTransport/control"},"method":"POST","headers":{"Content-Type":"text/xml; charset=\"utf-8\"","SOAPAction":"\"urn:schemas-upnp-org:service:AVTransport:1#SetAVTransportURI\"","USER-AGENT":"UPnP/1.0, ioBroker.upnp","content-length":426}}} Sent message: {"uri":"http://192.168.0.81:8080/AVTransport/control","headers":{"Content-Type":"text/xml; charset=\"utf-8\"","SOAPAction":"\"urn:schemas-upnp-org:service:AVTransport:1#SetAVTransportURI\"","USER-AGENT":"UPnP/1.0, ioBroker.upnp"},"method":"POST","body":" \n <s:Envelope s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\">\n <s:Body><u:SetAVTransportURI xmlns:u=\"urn:schemas-upnp-org:service:AVTransport:1\"><InstanceID>0</InstanceID><CurrentURI>http://192.168.0.131:8082/vis.0/Sounds01/gong2.mp3</CurrentURI><CurrentURIMetaData></CurrentURIMetaData></u:SetAVTransportURI></s:Body>\n </s:Envelope>"}

😢

Or I didn't understand what you meant and you may write your suggestion in englisch AND german ;-)

Berchemer commented 2 years ago

Or maybe you just show the full-Objekt-ID, like "upnp.0.1_OG-Salon-_Internetradio.MediaRenderer.AVTransport.SetAVTransportURI" and maybe also the raw-Object-Data as an example for me :-)