pychromecast icon indicating copy to clipboard operation
pychromecast copied to clipboard

discover_chromecasts doesn't work on machines with multiple network interfaces

Open Baughn opened this issue 10 years ago • 9 comments

Specifically, it only sends the multicast message over the primary interface. Any chromecasts connected to secondary interfaces won't be discovered.

It needs to iterate over all interfaces.

Baughn avatar Jan 01 '15 20:01 Baughn

The problem is within my uPnP implementation.

The Cast platform started using zeroconf next to uPnP. I wouldn't be surprised if uPnP would eventually be deprecated. The plan for PyChromecast is to use python-zeroconf.

Migrating would also fix this bug as they just added preliminary support for multiple network interfaces.

balloob avatar Jan 04 '15 07:01 balloob

I just upgraded PyChromecast to use python-zeroconf. The latest version of python-zeroconf on Pypi does not have support for multiple devices yet so this bug is not fixed yet.

balloob avatar Jan 04 '15 07:01 balloob

I have the same issue. I ended up switching my cable to the other port and changing my network configuration to work around the issue for now.

pcnate avatar Jun 14 '15 01:06 pcnate

Can confirm this is still an issue :(

j-mie avatar Jul 28 '15 19:07 j-mie

This is an issue for me as well, no chromecasts will be discovered (running latest master).

skorokithakis avatar Oct 15 '15 14:10 skorokithakis

I have the same issue. Therefore, i can't use chromecasts as media_player on HA.

rearchitec avatar Jan 08 '18 12:01 rearchitec

@fryyk0220 You can still add them manually. See host: on https://home-assistant.io/components/media_player.cast/

OttoWinter avatar Jan 09 '18 20:01 OttoWinter

@OttoWinter Adding this setting to my config resolved the issue, Thank you for your advice.

rearchitec avatar Jan 10 '18 13:01 rearchitec

I'm having the same issue using Home Assistant within Docker. Docker is running on the host network but can see all networks. After installing tcpdump I see the following when trying to discover Cast devices.

17:41:39.252896 IP 172.17.0.1.5353 > 224.0.0.251.5353: 0 PTR (QM)? _googlecast._tcp.local. (40) 17:41:40.254188 IP 172.17.0.1.5353 > 224.0.0.251.5353: 0 PTR (QM)? _googlecast._tcp.local. (40) 17:41:42.253728 IP 172.17.0.1.5353 > 224.0.0.251.5353: 0 PTR (QM)? _googlecast._tcp.local. (40)

My home network is on a 192.168.0.0/24 range but Zeroconf is using the IP from the default Docker bridge network. Pychromecast works correctly from a device with a single nic and the Home Assistant container is able to ping all Chromecast devices. I see it should be possible to manually set the interface within Zeroconf but I haven't been able to get it to work successfully. I'm not sure I'm adding the code correctly. If this were to work the IP could possibly be set via an environment variable?

JumpMaster avatar Nov 01 '19 17:11 JumpMaster