frawau / aiozeroconf

An asyncio/pure python implementation of multicast DNS service discovery
GNU Lesser General Public License v2.1
24 stars 6 forks source link

Link local address #16

Closed Kane610 closed 2 years ago

Kane610 commented 5 years ago

Hi!

Another question. I have Axis cameras that use bonjour to be discovered, they report both link local address and a normal address, it seems like with this library you can't be sure which one you will get as it will show the one or the other between runs. How would I go about fixing this?

frawau commented 5 years ago

Could you run python3 -m aiozeroconf -s

A few times to show me what is happening?.

Also, could it be that it is the camera that advertises services like that?

Kane610 commented 5 years ago

It seemed to always be the same address running that command.

The cameras have an option to turn it off, but with tools like discovery for OSX it will show both addresses.

frawau commented 5 years ago

It could be related to the fact that ServiceInfo only has one IPv4 and one IPv6 associated with it. This PR in the original package seems to solve that issue. I will check if I can port it here.

Kane610 commented 5 years ago

Yes that would be great. What time line do you think this will happen in?

frawau commented 5 years ago

Hopefully this WE

Kane610 commented 5 years ago

Wow that's quick. That would bring support with first release using aiozeroconf. Perfect!

frawau commented 5 years ago

Hi, I spent some quality time with the library trying to solve your problem.

My tentative fix is in branch dev_ha. Could you try it please.

One thing I noticed is that there is a small issue if you start a listener before you publish a service. It will get you ServiceInfo as soon as it gets an A or AAAA record. There is no way to know that there should be more I guess.

Let me know.

Regards, François

frawau commented 5 years ago

Don't forget to read the commit message... Non backward compatible change

Kane610 commented 5 years ago

I will try it out tomorrow 👍🏻. Backwards compatibility isn't an issue yet since we just have it published to dev branch

Kane610 commented 5 years ago

Unfortunately there is an issue with the Asyncio UDP implementation in python for windows (https://github.com/home-assistant/home-assistant/issues/24115) so we can't use your version of Zeroconf until python 3.8. I will try this out as soon as I've gotten everything reverted and working with the sync zeroconf implementation

wiryonolau commented 2 years ago

Any update on advertising on multiple ip address ?

frawau commented 2 years ago

Sorry no. The OP drop the ball on this, so I did too. You can try the develop branch.

Kane610 commented 2 years ago

I followed up on the interest in revisiting changing to this library but the python-zeroconf has been rewritten to be async so there is no longer any need. So I'll close this issue now.