1activegeek / docker-airconnect

AirConnect container for turning Chromecast into Airplay targets
221 stars 27 forks source link

The AirPlay device cannot be found on your network / Unable to connect #61

Closed lencioni closed 2 weeks ago

lencioni commented 2 weeks ago

First off, thanks for this great project, I'm really excited to get this up and running.

I ran into an issue that I didn't see discussed in much detail and I thought I would post some information here in case it helps out other folks.

I have added the following configuration to my docker compose file:

  airconnect:
    container_name: airconnect
    # https://hub.docker.com/r/1activegeek/airconnect/tags
    image: 1activegeek/airconnect:latest
    restart: unless-stopped
    network_mode: host
    environment:
      # Disable Sonos https://github.com/1activegeek/docker-airconnect?tab=readme-ov-file#running
      AIRUPNP_VAR: kill

It successfully discovers my Google Cast devices and makes them appear as AirPlay options. However, when I try to AirPlay to one of them, I end up with an error message. From Apple Music on my Mac:

The AirPlay device "Office Wifi+" cannot be found on your network.

image

And from Apple Music on my iPhone:

Unable to connect to "Office Wifi+".

I'm running docker on an Intel NUC running Ubuntu. I am successfully running Home Assistant using Docker on this machine, and it is also configured with network_mode: host.

I tried running Airconnect directly on my Mac, and it was able to work without any issue.

After some tinkering, I remembered that I am using ufw for a firewall on my Ubuntu installation. A bit of searching led me to this page, with these commands to run to open up some relevant ports:

sudo ufw allow 319:320/udp
sudo ufw allow 3689/tcp
sudo ufw allow 5353
sudo ufw allow 5000/tcp
sudo ufw allow 7000/tcp
sudo ufw allow 6000:6009/udp
sudo ufw allow 32768:60999/udp
sudo ufw allow 32768:60999/tcp

And now that I've done that, everything seems to be working for me!

1activegeek commented 2 weeks ago

Thanks for sharing - most scenarios its local networking that causes the most headache for all. Glad to see you found the solution for UFW situation. Will mark issue closed.