i8beef / node-red-contrib-castv2

MIT License
22 stars 14 forks source link

MDNS solution for ARM-architecture #61

Closed egeu5 closed 3 years ago

egeu5 commented 3 years ago

Hello, i tried to use the wquist/mdns-bridge which is only availible for AMD architecture and not for ARM. Do you have any solution for the ARM plattform? I did not find another docker image with the same features. (And if i use the --net host-command for my whole Node Red container I cant access it under the default port.)

Could i guess the MDNS ports of the speakers in any other way or are the changing if all speakers have fixed IPs?

Greetings, Chris

i8beef commented 3 years ago

MDNS is only strictly NECESSARY for "Groups". If you are dealing with single speakers, you can just use the default port and the IP of the device (assuming a static mapped IP).

If you need to do GROUPS though, yes, you need to figure out an MDNS bridge, because Google changes up owning device / port of the group regularly between the nodes in the group, so the only way to keep track of where to connect to is by MDNS broadcasts from the device currently owning the "group".

Useful tech info:

MDNS as a protocol does not span subnets by design as it is multicast. A device broadcasting on 192.168.1.x will never be visible to 192.168.2.x devices, unless something that is a member of BOTH subnets hears the multicast broadcast, and retransmits onto the other subnet (an MDNS bridge / repeater: note SOME routers actually have a feature to do this at the network level).

Unfortunately Docker containers by default run on a virtual network on the server that is bridged to the host network, which constitutes a separate subnet, thus the need for an MDNS DOCKER container (sits on both the host network and the Docker network) to do the rebroadcast. Which is why --net=host, which bypasses that "Docker network" for the host's own network can get around this.

You don't have to use the one I use (there are several docker images around that do this, I kinda just chose the smallest one I could that did just the one thing I needed, but I don't have any good recommendations for which ones to use... heck you might have luck just asking the author of that one to add an ARM build to his container.

egeu5 commented 3 years ago

Thank you for you're detailed answear. I were to stupid to search for another mdns-docker-image...

Now I am using monstrenyatko/mdns-repeater wich is available for 386, amd64 and arm/v6 and is mainteained. You have to set the enviroment variable MDNS_REPEATER_INTERFACES to the interfaces, for me it's "eth0 docker0" and use the --net=host networksetting.

Working perfectly! Hopefully this will help somebody.