Discovery Issues
Symptoms
Section titled “Symptoms”SonosSystem::new()returns an empty speaker list- Only some speakers are found
- Discovery works intermittently
How discovery works
Section titled “How discovery works”The SDK uses SSDP (Simple Service Discovery Protocol) to find Sonos devices:
- Sends an
M-SEARCHmulticast packet to239.255.255.250:1900 - Sonos devices respond with their location and capabilities
- The SDK deduplicates and returns discovered devices
This requires multicast UDP to work on your network.
Common issues
Section titled “Common issues”Speakers on a different subnet
Section titled “Speakers on a different subnet”Sonos devices and your machine must be on the same subnet. SSDP multicast doesn’t cross subnet boundaries unless your router is configured for it.
Check: Run sonos speakers (CLI) or print the discovery results. If you see zero devices, verify your machine’s IP is on the same subnet as the speakers (e.g., both on 192.168.1.x).
Wi-Fi isolation / AP isolation
Section titled “Wi-Fi isolation / AP isolation”Many routers have “AP isolation” or “client isolation” enabled, which prevents devices on Wi-Fi from seeing each other. This is common on:
- Guest networks
- Hotel/corporate Wi-Fi
- Mesh networks with isolation enabled
Fix: Disable AP isolation in your router settings, or connect via Ethernet.
Multicast disabled on the network
Section titled “Multicast disabled on the network”Some managed switches or enterprise networks block multicast traffic.
Check: Try discovering devices from a different machine on the same network. If it works there but not here, the issue is specific to your machine or network port.
macOS Wi-Fi power saving
Section titled “macOS Wi-Fi power saving”macOS may throttle multicast reception when on battery or when the display is off.
Fix: For development, keep the machine plugged in and awake. In production, consider running on a wired connection.
Discovery timeout
Section titled “Discovery timeout”The default timeout gives devices ~2 seconds to respond. On slow networks or with many devices, this may not be enough.
use std::time::Duration;use sonos_sdk::prelude::*;
// Increase discovery timeout to 5 secondslet sonos = SonosSystem::with_timeout(Duration::from_secs(5))?;Only some speakers found
Section titled “Only some speakers found”If you consistently find some but not all speakers:
- Different subnets: Some speakers may be on a different VLAN
- SonosNet vs. WiFi: Speakers on SonosNet (Sonos’s own mesh) bridge to Wi-Fi speakers, but discovery still requires being on the same subnet as at least one device
- Timeouts: Devices on poor Wi-Fi may respond slowly — increase the timeout
Verifying network connectivity
Section titled “Verifying network connectivity”Test that you can reach a Sonos device directly:
# Replace with your speaker's IP (find it in the Sonos app under Settings > About)curl -s http://192.168.1.100:1400/xml/device_description.xml | head -5If this returns XML, your machine can reach the device. If it times out, there’s a network routing issue between your machine and the speaker.
Still stuck?
Section titled “Still stuck?”- Verify your Sonos system is set up and working via the official Sonos app
- Try rebooting the nearest Sonos speaker (unplug for 10 seconds)
- Check that your router firmware is up to date (older firmware sometimes has multicast bugs)
- File an issue at github.com/tatimblin/sonos-sdk/issues