becvert / cordova-plugin-zeroconf

Cordova ZeroConf Plugin
MIT License
81 stars 57 forks source link

Android - doesn't work with python3-zeroconf #26

Closed SrMouraSilva closed 7 years ago

SrMouraSilva commented 7 years ago

Python zeroconf is a Pure Python Multicast DNS Service Discovery Library (Bonjour/Avahi compatible) https://pypi.python.org/pypi/zeroconf

cordova-plugin-zeroconf can't discover (watch) a Python zeroconf service, but the reverse works.

Sorry for the description of the error, I do not know what the cause of it would be. If you can quote how can I help ...

becvert commented 7 years ago

Can you show how you call wsserver.watch? And how you register your service in Python? Thanks

SrMouraSilva commented 7 years ago

Watch: https://github.com/PedalPi/Apk/blob/1fedfdd2223a7c18bd48dba0b9303e8f7cce4962/src/pages/configurations/configurations.ts#L43

Python service https://github.com/PedalPi/WebService/blob/b63bfc916948a2fb11f822751beb1e7c90677c94/zeroconf/server.py#L24

Observation:

becvert commented 7 years ago

Are you saying all is fine with this other python library, i.e. pybonjour3?

Looks to me that Python side you're registering your service on a loopback address socket.inet_aton("127.0.0.1")? Could you try on another interface and one that supports multicast instead?

SrMouraSilva commented 7 years ago

Are you saying all is fine with this other python library, i.e. pybonjour3?

Yes

Looks to me that Python side you're registering your service on a loopback address socket.inet_aton("127.0.0.1")?

This really does not make much sense. I followed the example and did not mind.

Could you try on another interface and one that supports multicast instead?

I tested in a PC with cable and in a notebook with wi-fi.

I will try again with an not IP loopback

Thanks

becvert commented 7 years ago

Let us know the result of you last try and then close this issue please as the problem is not with this plugin.

SrMouraSilva commented 7 years ago

Hello, I'm sorry for the delay in replying.

I did some more tests and found that the problem was possibly in the configuration. The host in python-zeroconf must be the IP of the machine on the network where the other devices will be connected. So the other devices will be able to locate the machine.