Unable to discover Sonos devices

Hello,

I have the situation that OH will not discover my Sonos devices. I don’t know when this exactly happend, but I have this issue for a long time (OH3+ and currently on OH4.0.2). First I’ve had OH running on CentOS, just apt installed. Then I moved to Ubuntu and docker. I know with docker you need to run in host network mode in order to receive UPnP packets. In both situations my Sonos devices are not discovered.

When I use the gssdp-discover tool, it does discover them:

# gssdp-discover -i enp0s25 --timeout=3
Using network interface enp0s25
Scanning for all resources
Showing "available" messages
<REMOVED OTHER DEVICES>
resource available
  USN:      uuid:RINCON_000E58BA2DD801400_MS::urn:schemas-upnp-org:service:ConnectionManager:1
  Location: http://192.168.2.29:1400/xml/device_description.xml
resource available
  USN:      uuid:RINCON_000E58BA2DD801400_MR::urn:schemas-upnp-org:service:ConnectionManager:1
  Location: http://192.168.2.29:1400/xml/device_description.xml
resource available
  USN:      uuid:RINCON_5CAAFDB9F99A01400_MS::urn:schemas-upnp-org:service:ConnectionManager:1
  Location: http://192.168.2.35:1400/xml/device_description.xml
resource available
  USN:      uuid:RINCON_5CAAFDB9F99A01400_MR::urn:schemas-upnp-org:service:ConnectionManager:1
  Location: http://192.168.2.35:1400/xml/device_description.xml
resource available
  USN:      uuid:RINCON_5CAAFDB9FA5801400_MS::urn:schemas-upnp-org:service:ConnectionManager:1
  Location: http://192.168.2.32:1400/xml/device_description.xml
resource available
  USN:      uuid:RINCON_5CAAFDB9FA5801400_MR::urn:schemas-upnp-org:service:ConnectionManager:1
  Location: http://192.168.2.32:1400/xml/device_description.xml
resource available
  USN:      uuid:RINCON_347E5CFF0A1401400_MR::urn:schemas-upnp-org:service:ConnectionManager:1
  Location: http://192.168.2.49:1400/xml/device_description.xml
resource available
  USN:      uuid:RINCON_347E5CFF0A1401400_MS::urn:schemas-upnp-org:service:ConnectionManager:1
  Location: http://192.168.2.49:1400/xml/device_description.xml
resource available
  USN:      uuid:RINCON_347E5C31DD4201400_MR::urn:schemas-upnp-org:service:ConnectionManager:1
  Location: http://192.168.2.53:1400/xml/device_description.xml
resource available
  USN:      uuid:RINCON_347E5C31DD4201400_MS::urn:schemas-upnp-org:service:ConnectionManager:1
  Location: http://192.168.2.53:1400/xml/device_description.xml
resource available
  USN:      uuid:9acd039c-03a2-708a-e60e-fa8e8cc8aad7::urn:dial-multiscreen-org:device:dial:1
  Location: http://192.168.2.40:8008/ssdp/device-desc.xml
resource available
  USN:      uuid:RINCON_000E58BA2DD801400::urn:schemas-tencent-com:service:QPlay:1
  Location: http://192.168.2.29:1400/xml/device_description.xml
resource available
  USN:      uuid:RINCON_5CAAFDB9FA5801400::urn:schemas-tencent-com:service:QPlay:1
  Location: http://192.168.2.32:1400/xml/device_description.xml
resource available
  USN:      uuid:RINCON_5CAAFDB9F99A01400::urn:schemas-tencent-com:service:QPlay:1
  Location: http://192.168.2.35:1400/xml/device_description.xml
resource available
  USN:      uuid:RINCON_347E5CFF0A1401400::urn:schemas-tencent-com:service:QPlay:1
  Location: http://192.168.2.49:1400/xml/device_description.xml
resource available
  USN:      uuid:RINCON_347E5C31DD4201400::urn:schemas-tencent-com:service:QPlay:1
  Location: http://192.168.2.53:1400/xml/device_description.xml
resource available
  USN:      uuid:RINCON_000E58BA2DD801400::urn:schemas-upnp-org:service:ZoneGroupTopology:1
  Location: http://192.168.2.29:1400/xml/device_description.xml
<REMOVED OTHER DEVICES>

My Sonos devices are full Wifi connected, no LAN on any device and therefore no SonosNET. My Wifi is build out of multiple Aruba IAP (professional) running in mesh mode. Multicast/broadcast filtering is disabled. All AirGroup (UPnP) services are allowed. I have no issues with the Sonos app, it see’s all devices.

What Ive tried:

  • Clean OH install via apt (firewall disabled)
  • Clean OH install on docker with host network set
  • Disabled any options on Aruba IAP / switches that might cause some kind of traffic filtering
  • Enabled debug logging on binding and upnp
  • Played with entries in runtime.cfg
    org.jupnp:threadPoolSize=25
    org.jupnp:asyncThreadPoolSize=25
    org.jupnp:retryAfterSeconds=300
    org.jupnp:retryIterations=8
    org.jupnp:timeoutSeconds=15

I have an assumption the full wifi mode of Sonos does something with those devices not broadcasting some UPnP service ID’s. Does the Sonos binding search for specific service ID’s?

This is a trace/debug dump while pressing the SCAN option on the Sonos binding. 192.168.2.35 is a Sonos speaker.

2023-08-31 11:03:21.569 [DEBUG] [.jupnp.transport.impl.DatagramIOImpl] - UDP datagram received from: 192.168.2.35:1900 on: /192.168.2.2:0
2023-08-31 11:03:21.569 [TRACE] [org.jupnp.model.message.UpnpHeaders ] - Adding parsed header: (UDAServiceTypeHeader) 'urn:schemas-upnp-org:service:ConnectionManager:1'
2023-08-31 11:03:21.569 [TRACE] [upnp.transport.spi.DatagramProcessor] - ===================================== DATAGRAM BEGIN ============================================
2023-08-31 11:03:21.569 [TRACE] [upnp.model.message.header.UpnpHeader] - Trying to parse 'SERVER' with class: ServerHeader
2023-08-31 11:03:21.569 [TRACE] [upnp.transport.spi.DatagramProcessor] - HTTP/1.1 200 OK
CACHE-CONTROL: max-age = 1800
LOCATION: http://192.168.2.35:1400/xml/device_description.xml
ST: urn:schemas-upnp-org:service:ConnectionManager:1
SERVER: Linux UPnP/1.0 Sonos/74.0-43312 (ZPS22)
USN: uuid:RINCON_5CAAFDB9F99A01400_MS::urn:schemas-upnp-org:service:ConnectionManager:1
X-RINCON-HOUSEHOLD: Sonos_Be2tcmlxcJcwbV2mpt8DErIoH3
X-RINCON-BOOTSEQ: 129
BOOTID.UPNP.ORG: 129
X-RINCON-WIFIMODE: 1
X-RINCON-VARIANT: 1
HOUSEHOLD.SMARTSPEAKER.AUDIO: Sonos_Be2tcmlxcJcwbV2mpt8DErIoH3.JKzcFhSU6D5l4b-6q0_1
LOCATION.SMARTSPEAKER.AUDIO: lc_6798dd1cd3c1424a9326f7a7c277b0f8
SECURELOCATION.UPNP.ORG: https://192.168.2.3
2023-08-31 11:03:21.569 [TRACE] [org.jupnp.model.message.UpnpHeaders ] - Adding parsed header: (ServerHeader) 'Linux/4.4.180+ UPnP/1.0 Portable SDK for UPnP devices/1.12.1'
2023-08-31 11:03:21.569 [TRACE] [upnp.transport.spi.DatagramProcessor] - -===================================== DATAGRAM END =============================================
2023-08-31 11:03:21.570 [TRACE] [upnp.model.message.header.UpnpHeader] - Trying to parse 'USN' with class: USNRootDeviceHeader
2023-08-31 11:03:21.570 [TRACE] [org.jupnp.protocol.ProtocolFactory  ] - Creating protocol for incoming asynchronous: (IncomingDatagramMessage) 200 OK
2023-08-31 11:03:21.570 [TRACE] [upnp.model.message.header.UpnpHeader] - Invalid header value for tested type: USNRootDeviceHeader - Invalid root device USN header value, must start with 'uuid:' and end with '::upnp:rootdevice' but is 'uuid:001132c4-0474-0011-7404-7404c4321100::urn:schemas-upnp-org:service:ConnectionManager:1'
2023-08-31 11:03:21.570 [TRACE] [upnp.model.message.header.UpnpHeader] - Trying to parse 'USN' with class: DeviceUSNHeader
2023-08-31 11:03:21.570 [TRACE] [org.jupnp.model.message.UpnpHeaders ] - Parsing all HTTP headers for known UPnP headers: 10
2023-08-31 11:03:21.570 [TRACE] [upnp.model.message.header.UpnpHeader] - Trying to parse 'EXT' with class: EXTHeader
2023-08-31 11:03:21.570 [DEBUG] [org.jupnp.transport.Router          ] - Received asynchronous message: (IncomingDatagramMessage) 200 OK
2023-08-31 11:03:21.570 [TRACE] [upnp.model.message.header.UpnpHeader] - Invalid header value for tested type: DeviceUSNHeader - Invalid device USN header value, Can't parse device type string (namespace/type/version): urn:schemas-upnp-org:service:ConnectionManager:1
2023-08-31 11:03:21.570 [TRACE] [upnp.model.message.header.UpnpHeader] - Trying to parse 'USN' with class: ServiceUSNHeader
2023-08-31 11:03:21.570 [TRACE] [org.jupnp.model.message.UpnpHeaders ] - Adding parsed header: (EXTHeader) ''
2023-08-31 11:03:21.571 [TRACE] [org.jupnp.model.message.UpnpHeaders ] - Adding parsed header: (ServiceUSNHeader) 'uuid:001132c4-0474-0011-7404-7404c4321100::urn:schemas-upnp-org:service:ConnectionManager:1'
2023-08-31 11:03:21.571 [TRACE] [upnp.model.message.header.UpnpHeader] - Trying to parse 'ST' with class: STAllHeader
2023-08-31 11:03:21.571 [TRACE] [org.jupnp.model.message.UpnpHeaders ] - Ignoring non-UPNP HTTP header: Opt
2023-08-31 11:03:21.571 [TRACE] [org.jupnp.model.message.UpnpHeaders ] - Ignoring non-UPNP HTTP header: 01-nls
2023-08-31 11:03:21.571 [TRACE] [org.jupnp.model.message.UpnpHeaders ] - Ignoring non-UPNP HTTP header: X-user-agent
2023-08-31 11:03:21.571 [TRACE] [upnp.model.message.header.UpnpHeader] - Invalid header value for tested type: STAllHeader - Invalid ST header value (not ALL): upnp:acn-com:device:UTCTrigger:1
2023-08-31 11:03:21.571 [TRACE] [org.jupnp.model.message.UpnpHeaders ] - Parsing all HTTP headers for known UPnP headers: 13
2023-08-31 11:03:21.571 [DEBUG] [.jupnp.transport.impl.DatagramIOImpl] - UDP datagram received from: 192.168.2.35:1900 on: /192.168.2.2:0
2023-08-31 11:03:21.571 [TRACE] [upnp.transport.spi.DatagramProcessor] - ===================================== DATAGRAM BEGIN ============================================
2023-08-31 11:03:21.571 [TRACE] [upnp.model.message.header.UpnpHeader] - Trying to parse 'ST' with class: STAllHeader
2023-08-31 11:03:21.572 [TRACE] [upnp.transport.spi.DatagramProcessor] - HTTP/1.1 200 OK
CACHE-CONTROL: max-age = 1800
LOCATION: http://192.168.2.35:1400/xml/device_description.xml
ST: urn:schemas-upnp-org:service:ConnectionManager:1
SERVER: Linux UPnP/1.0 Sonos/74.0-43312 (ZPS22)
USN: uuid:RINCON_5CAAFDB9F99A01400_MR::urn:schemas-upnp-org:service:ConnectionManager:1
X-RINCON-HOUSEHOLD: Sonos_Be2tcmlxcJcwbV2mpt8DErIoH3
X-RINCON-BOOTSEQ: 129
BOOTID.UPNP.ORG: 129
X-RINCON-WIFIMODE: 1
X-RINCON-VARIANT: 1
HOUSEHOLD.SMARTSPEAKER.AUDIO: Sonos_Be2tcmlxcJcwbV2mpt8DErIoH3.JKzcFhSU6D5l4b-6q0_1
LOCATION.SMARTSPEAKER.AUDIO: lc_6798dd1cd3c1424a9326f7a7c277b0f8
SECURELOCATION.UPNP.ORG: https://192.168.2.3
2023-08-31 11:03:21.572 [TRACE] [upnp.model.message.header.UpnpHeader] - Invalid header value for tested type: STAllHeader - Invalid ST header value (not ALL): urn:schemas-upnp-org:service:ConnectionManager:1
2023-08-31 11:03:21.572 [TRACE] [upnp.transport.spi.DatagramProcessor] - -===================================== DATAGRAM END =============================================

Any help is very welcome. Thanks in advance!

Bastiaan

Wow, I have found the solution/workaround!

I had to disable the AirGroup feature of the Azure IAP access points completely. This is a filtering mechanism to avoid the Wifi being flooded with broadcast/UPnP packets. I added all kinds of exceptions to this configuration. I even captured the blocking ones and added them all to the AirGoup. Als a last resort I disabled the airgroup, and tada now they popup in OH.

airgroup
  disable

I do still would like to know if the binding is searching for a specific UPnP service ID so I can add this to the allow list and try to enable AirGroup again.

No specific service ID. Filtering is based on the presence of Somos in the manufactirer firld

Based on the TRACE, do you see the required information there? Do you mis something?

Apparently you found the solution and it does not depend neither on OH nor on Sonos.
So that’s all! No?

Yes issue is resolved by disabling UPnP filtering (AirGroup) on the Wifi network, Im just curious which exactly the filtering blocked as I have added all known Sonos UPnP service ID’s to the exclusing of this filtering.

But if thats not traceable, lets leave it.