Closed anton-johansson closed 6 years ago
Could it be the one second timeout?
SSDPClient.discover(1000, "urn:schemas-upnp-org:device:ZonePlayer:1");
Your problem is related with how SSDP works. Extend the timeout is not a good solution (all users doesn't need to wait 1s and for some people 1s is not enough).
I think it could be better to purpose an optional scanDuration
parameter.
Yeah, sounds like a good idea. I can try it out, unless you're already working on it? :)
If you want implement it, go ! :)
I messed around with some timeouts and I still experienced the issue with 10 seconds timeout, but not as often. Not sure if keep extending the timeout is a good solution.
It's perhaps a network issue on your side.
Yeah, could be. I was at my office, where there's quite a big network. I'll submit a PR tomorrow that allows passing in the scan duration. However, I might not use it myself, so you can decide whether or not you want the functionality.
I decided that I will manually add Sonos devices when configuring my system. I will use the discovery as a help, only. For example:
> sonos:discover
"Kitchen" at 192.168.1.1
"Playbar in living room" at 192.168.1.2
> sonos:add --name kitchen 192.168.1.1
It's a solution, I wait you PR with attention :)
Merged PR.
I'm running the following code:
I get different results every time I run it. Four examples:
As you can see, I'm not always getting all devices. Do you know what the reason of this could be?