Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unreliable discovery on iOS #1196

Open
jpan127 opened this issue Jul 18, 2023 · 0 comments
Open

Unreliable discovery on iOS #1196

jpan127 opened this issue Jul 18, 2023 · 0 comments

Comments

@jpan127
Copy link

jpan127 commented Jul 18, 2023

Hi, I realize iOS is probably not officially supported and this is a long shot.

I'm using Pythonista on iOS to run a discovery script with zeroconf 0.71.0. The code is slightly modified from the README example (but the modifications are irrelevant). I have both a Windows and MacOS machine advertising separate services on a home network.

I'm observing results all over the place. At least 9/10 times my advertised services are not discovered (I added a 120 second timeout). I have observed a handful of times it is able to discover it. It's not obvious to me why it's sporadic.

Debugging

I enabled debug logging and in all runs (discoverable or not) there are these errors:

DEBUG:zeroconf:Error with socket 8 (('192.168.86.39', 5353))): [Errno 65] No route to host
Traceback (most recent call last):
  File "/var/containers/Bundle/Application/{UUID}/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/asyncio/selector_events.py", line 1054, in sendto
    self._sock.sendto(data, addr)
OSError: [Errno 65] No route to host

Testing the Windows + MacOS communicating with each other works flawlessly though.

I also tried using an iOS app, HE.NET Network Tools, which also does some service discovery with Bonjour, and it discovered my advertised services consistently.

Not sure how relevant this is but I printed out zeroconf.cache.names() after 120 seconds of discovery, and the results are surprisingly different almost every time. I have maybe 2 dozen discoverable services (apple devices, TVs, etc), and they aren't consistently discovered. However running the discovery script on a computer is perfectly consistent.

So it sounds like either there's some networking issue with Pythonista, or a discrepancy in implementation between zeroconf and iOS' bonjour. Would anyone have any ideas on how to debug further? Thanks!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant