You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importtimeimportosimporttracebackimportmicrocontrollerimportwifiimportsocketpoolimportmdnsPORT1=8086PORT2=8088time.sleep(3) # wait for serialprint(f'{os.uname()=}')
print(f'{microcontroller.cpu.reset_reason=}') # is device just coming off a reset?print(f'{os.getenv("CIRCUITPY_WEB_API_PASSWORD")=}') # check for web workflowmdns_server=mdns.Server(wifi.radio)
mdns_server.hostname="slots-code-py"try:
print(f"http://{mdns_server.hostname}.local.:{PORT1} starting...")
mdns_server.advertise_service(service_type="_fake", protocol="_udp", port=PORT1)
print(f"http://{mdns_server.hostname}.local.:{PORT2} starting...")
mdns_server.advertise_service(service_type="_blah", protocol="_tcp", port=PORT2)
exceptRuntimeErrorasex:
traceback.print_exception(ex, ex, ex.__traceback__)
print("Done.")
Behavior
Fresh reset in each case. Web workflow is not enabled.
os.uname()=(sysname='rp2040', nodename='rp2040', release='9.1.0', version='9.1.0-beta.0 on 2024-03-28', machine='Raspberry Pi Pico W with rp2040')
microcontroller.cpu.reset_reason=microcontroller.ResetReason.SOFTWARE
os.getenv("CIRCUITPY_WEB_API_PASSWORD")=None
http://slots-code-py.local.:8086 starting...
http://slots-code-py.local.:8088 starting...
Traceback (most recent call last):
File "code.py", line 32, in <module>
RuntimeError: Out of MDNS service slots
Done.
If web workflow is enabled, results are similar...
raspberrypi output (unsuccessful - fails on the first .advertise_service):
os.uname()=(sysname='rp2040', nodename='rp2040', release='9.1.0', version='9.1.0-beta.0 on 2024-03-28', machine='Raspberry Pi Pico W with rp2040')
microcontroller.cpu.reset_reason=microcontroller.ResetReason.SOFTWARE
os.getenv("CIRCUITPY_WEB_API_PASSWORD")=passw0rd
http://slots-code-py.local.:8086 starting...
Traceback (most recent call last):
File "code.py", line 20, in <module>
RuntimeError: Out of MDNS service slots
Done.
The text was updated successfully, but these errors were encountered:
CircuitPython version
Code/REPL
Behavior
Fresh reset in each case. Web workflow is not enabled.
espressif
allows (as expected) multiple unique service-protocol-port combinations.raspberrypi
does not.The only limitation noted in the docs is:
https://docs.circuitpython.org/en/latest/shared-bindings/mdns/index.html#mdns.Server.advertise_service
espressif
output (successful):raspberrypi
output (unsuccessful):If web workflow is enabled, results are similar...
espressif
output (successful):raspberrypi
output (unsuccessful - fails on the first.advertise_service
):The text was updated successfully, but these errors were encountered: