← index #10957PR #16641
Related · medium · value 3.510
QUERY · ISSUE

RP2040: mDNS support in AP mode

openby ThinkTransitopened 2023-03-07updated 2023-03-07
enhancement

Implement mdns in AP mode on RP2 port to allow users to access micropython device by hostname.

CANDIDATE · PULL REQUEST

ports/rp2: Fix rp2 mdns responder issue.

closedby mseminatoreopened 2025-01-25updated 2025-03-31
port-rp2

Summary

As a number of users have reported via issues and discussions, the RP2 port of MicroPython has an incomplete mDNS implementation. The code in main.c calls mdns_resp_init() which opens the UDP socket for mDNS. However, no code in the cyw43 driver of the RP2 port makes the proper calls to mdns_resp_add_netif() and mdns_resp_remove_netif() to send the announce packets. The wiznet5k driver does make these calls and was used as a model for these changes.

This PR attempts to address this by very small changes to the extmod/network_cyw43.c driver file. As far as I can tell this driver is currently used only by the RP2 port.

Testing

This was tested by building the firmware and deploying to a PicoW, starting a WLAN connection and pinging PicoW.local from several devices on the local network. I also tested changing the hostname from the default.

Trade-offs and Alternatives

Alternatively, if this PR is not accepted we should disable the partial implementation by setting LWIP_MDNS_RESPONDER to 0 in lwipopts.h so that users can implement their own mDNS solutions without E_ADDRINUSE failures. A user should not have to build their own firmware to disable a partial/broken mDNS solution.

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied