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

BREAKING: mDNS: use STA as default interface #7042

Merged
merged 5 commits into from
Feb 5, 2020

Conversation

d-a-v
Copy link
Collaborator

@d-a-v d-a-v commented Jan 28, 2020

Edit by @devyte:
The old behavior is as follows:
-In STA mode, MDNS works on the STA interface
-In AP mode, MDNS works on the AP interface
-In AP+STA mode, MDNS works on the AP interface and not on the STA interface

This sounds reasonable, but it causes all sorts of confusion (and opened issues and comments) when switching WiFi mode on the fly. In particular, when in STA mode, the responder works when accessing from another device on the network, but when switching to AP+STA mode, the ESP suddenly disappears, because MDNS switches to the AP interface.
Obviously, in order to achieve the old behavior, there is a lot of complexity inside MDNS to handle the mode changes.

After several and repeated internal discussions, it has been decided to simplify this to WYSIWYG. The standard MDNS instance works on the STA interface, period. If the STA interface is up, it responds. If the STA interface is down, MDNS is shut down. If the user wants AP mode, or responses on the AP interface in AP+STA mode, then a separate secondary MDNS instance needs to be declared and tied to the AP interface. That secondary instance also needs to have its ::update() method called in the loop.

The same will be true in the future with other interfaces, such as the lwip-integrated Ethernet.

This PR ties the standard MDNS to the STA interface, and leaves the AP interface without a MDNS responder by default.

Edit by d-a-v:
fixes #6975

@devyte devyte changed the title mDNS: use STA as default interface BREAKING: mDNS: use STA as default interface Feb 1, 2020
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

Successfully merging this pull request may close these issues.

OTA port not seen (2.6.3)
3 participants