-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
mDNS safe mode - find #6186
Comments
What exact code are you running? The prints don't match the code. (udp vs tcp). I'm able to run a modified version ok:
My version: import wifi
import mdns
print(" Connecting", end="\r")
wifi.radio.connect("ssid", "password")
print(wifi.radio.ipv4_address)
print("Starting mDNS server...")
server = mdns.Server(wifi.radio)
service_types = ("_http", "_upnp" )
protocols = ("_tcp", "_udp")
for service_type in service_types:
print(service_type, end=" ")
for protocol in protocols:
print(protocol)
remote_service_tuple = server.find(service_type=service_type, protocol=protocol, timeout=5)
for remote_service in remote_service_tuple:
print(remote_service.hostname, remote_service.instance_name, remote_service.service_type, remote_service.protocol, remote_service.port) |
That's the right code (well, I changed it to print the IP address when connected). If I run that code above as-is, it works, but, for example, _http _udp, or _upnp _tcp, crashes. |
I wonder if it is an S2 vs S3 thing. I tested on S3s. I also tested with a later version off main. |
I've replicated this on an S2. |
S3 is quirky too, but I think PR fix will fix S3 also. Thanks! I often put a |
Makes sense. I'm surprised the S3 doesn't crash... |
CircuitPython version
Code/REPL
Behavior
The example code probably works in many environments, but Safe Mode occurs when substituting many other service types and protocols. Hypothesis is there are no results for that combination.
Description
Pattern seems to be Safe Mode when trying to
find
a service type and protocol that do not exist on the network.Additional information
No response
The text was updated successfully, but these errors were encountered: