Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discovery Timeout Doesn't Work In All Cases #37

Open
coofercat opened this issue Apr 7, 2022 · 0 comments
Open

Discovery Timeout Doesn't Work In All Cases #37

coofercat opened this issue Apr 7, 2022 · 0 comments

Comments

@coofercat
Copy link

I have a handful of Sonos equipment, which under normal circumstances is discoverable almost immediately. However, every once in a while, a Sonos device will "crash", whereupon it disappears from the Sonos app. When this happens, the device is still pingable, but any HTTP requests to port 1400 (HTTP) or 1443 (HTTPS) just time out.

Further, upnpclient.discover() starts taking about 5 minutes to complete (even calling it with discover(1) will take the same amount of time). Some sleuthing shows that it is repeatedly trying to contact the dead Sonos device, with the wrong timeout:

2022-04-07 14:40:32,475 - ssdp - ERROR - Error 'HTTPConnectionPool(host='10.20.1.227', port=1400): Read timed out. (read timeout=10)' for <upnpclient.ssdp.Entry object at 0xb10fda00>
2022-04-07 14:40:42,489 - ssdp - ERROR - Error 'HTTPConnectionPool(host='10.20.1.227', port=1400): Read timed out. (read timeout=10)' for <upnpclient.ssdp.Entry object at 0xb10fda30>
2022-04-07 14:40:52,504 - ssdp - ERROR - Error 'HTTPConnectionPool(host='10.20.1.227', port=1400): Read timed out. (read timeout=10)' for <upnpclient.ssdp.Entry object at 0xb10fda60>
2022-04-07 14:41:02,524 - ssdp - ERROR - Error 'HTTPConnectionPool(host='10.20.1.227', port=1400): Read timed out. (read timeout=10)' for <upnpclient.ssdp.Entry object at 0xb10fda90>
2022-04-07 14:41:12,544 - ssdp - ERROR - Error 'HTTPConnectionPool(host='10.20.1.227', port=1400): Read timed out. (read timeout=10)' for <upnpclient.ssdp.Entry object at 0xb10fdac0>
2022-04-07 14:41:29,772 - ssdp - ERROR - Error 'HTTPConnectionPool(host='10.20.1.227', port=1400): Read timed out. (read timeout=10)' for <upnpclient.ssdp.Entry object at 0xb10fdaf0>
2022-04-07 14:41:39,787 - ssdp - ERROR - Error 'HTTPConnectionPool(host='10.20.1.227', port=1400): Read timed out. (read timeout=10)' for <upnpclient.ssdp.Entry object at 0xb10fdb20>
2022-04-07 14:41:49,839 - ssdp - ERROR - Error 'HTTPConnectionPool(host='10.20.1.227', port=1400): Read timed out. (read timeout=10)' for <upnpclient.ssdp.Entry object at 0xb10fdb50>
2022-04-07 14:41:59,859 - ssdp - ERROR - Error 'HTTPConnectionPool(host='10.20.1.227', port=1400): Read timed out. (read timeout=10)' for <upnpclient.ssdp.Entry object at 0xb10fdb80>
2022-04-07 14:42:09,878 - ssdp - ERROR - Error 'HTTPConnectionPool(host='10.20.1.227', port=1400): Read timed out. (read timeout=10)' for <upnpclient.ssdp.Entry object at 0xb10fdbb0>
2022-04-07 14:42:19,897 - ssdp - ERROR - Error 'HTTPConnectionPool(host='10.20.1.227', port=1400): Read timed out. (read timeout=10)' for <upnpclient.ssdp.Entry object at 0xb10fdbe0>
2022-04-07 14:42:29,917 - ssdp - ERROR - Error 'HTTPConnectionPool(host='10.20.1.227', port=1400): Read timed out. (read timeout=10)' for <upnpclient.ssdp.Entry object at 0xb10fdc10>
2022-04-07 14:42:39,937 - ssdp - ERROR - Error 'HTTPConnectionPool(host='10.20.1.227', port=1400): Read timed out. (read timeout=10)' for <upnpclient.ssdp.Entry object at 0xb10fdc40>
2022-04-07 14:42:49,951 - ssdp - ERROR - Error 'HTTPConnectionPool(host='10.20.1.227', port=1400): Read timed out. (read timeout=10)' for <upnpclient.ssdp.Entry object at 0xb10fdc70>
2022-04-07 14:42:59,965 - ssdp - ERROR - Error 'HTTPConnectionPool(host='10.20.1.227', port=1400): Read timed out. (read timeout=10)' for <upnpclient.ssdp.Entry object at 0xb10fdca0>
2022-04-07 14:43:09,971 - ssdp - ERROR - Error 'HTTPConnectionPool(host='10.20.1.227', port=1400): Read timed out. (read timeout=10)' for <upnpclient.ssdp.Entry object at 0xb10fdcd0>
2022-04-07 14:43:19,982 - ssdp - ERROR - Error 'HTTPConnectionPool(host='10.20.1.227', port=1400): Read timed out. (read timeout=10)' for <upnpclient.ssdp.Entry object at 0xb10fdd00>
2022-04-07 14:43:29,997 - ssdp - ERROR - Error 'HTTPConnectionPool(host='10.20.1.227', port=1400): Read timed out. (read timeout=10)' for <upnpclient.ssdp.Entry object at 0xb10fdd30>
2022-04-07 14:43:40,018 - ssdp - ERROR - Error 'HTTPConnectionPool(host='10.20.1.227', port=1400): Read timed out. (read timeout=10)' for <upnpclient.ssdp.Entry object at 0xb10fdd60>
2022-04-07 14:43:50,036 - ssdp - ERROR - Error 'HTTPConnectionPool(host='10.20.1.227', port=1400): Read timed out. (read timeout=10)' for <upnpclient.ssdp.Entry object at 0xb10fdd90>
2022-04-07 14:44:00,054 - ssdp - ERROR - Error 'HTTPConnectionPool(host='10.20.1.227', port=1400): Read timed out. (read timeout=10)' for <upnpclient.ssdp.Entry object at 0xb10fddc0>
2022-04-07 14:44:10,068 - ssdp - ERROR - Error 'HTTPConnectionPool(host='10.20.1.227', port=1400): Read timed out. (read timeout=10)' for <upnpclient.ssdp.Entry object at 0xb10fddf0>
2022-04-07 14:44:20,083 - ssdp - ERROR - Error 'HTTPConnectionPool(host='10.20.1.227', port=1400): Read timed out. (read timeout=10)' for <upnpclient.ssdp.Entry object at 0xb10fde20>
2022-04-07 14:44:30,097 - ssdp - ERROR - Error 'HTTPConnectionPool(host='10.20.1.227', port=1400): Read timed out. (read timeout=10)' for <upnpclient.ssdp.Entry object at 0xb10fde50>

After the above, it seems to give up and discovery completes with anything else that was found, but not the troublesome Sonos device. In short, it works correctly, but does not honour its timeout (note the about 4 minutes, where the default timeout is 5 seconds).

If I reboot the Sonos device, it re-appears in the Sonos app, and discover() starts working correctly again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant