-
Notifications
You must be signed in to change notification settings - Fork 13.3k
mDNS not working with WiFi.mode(WIFI_AP_STA) on current git #8308
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
Comments
Seems to be a logical error when IP isSet() is false for the STA interface. But, logs do show that it finds the AP netif, and attempts to send the data Arduino/libraries/ESP8266mDNS/src/LEAmDNS_Transfer.cpp Lines 124 to 149 in 9d024d1
Adding
@@ -128,6 +128,10 @@ bool MDNSResponder::_sendMDNSMessage_Multicast(MDNSResponder::stcMDNSSendParamet
IPAddress fromIPAddress;
//fromIPAddress = _getResponseMulticastInterface();
fromIPAddress = pNetIf->ip_addr;
+ if (!fromIPAddress.isSet()) {
+ continue;
+ }
+
m_pUDPContext->setMulticastInterface(fromIPAddress);
(obviously, diff is not a fix! just exploring the code) |
@hreintke and/or me updated this part of this code (to make it interface-agnostic). @hreintke What do you think ? |
@mcspr @d-a-v
Can you provide your logs so I can (perhaps) check what is happening.
Do you say here :
|
Adding UDP debug logs as well, there's an endless stream of -4 (ERR_RTE) from the underlying udp sender
Modifying the example above and adding a
|
All this seems consistent (cannot route from invalid address), except that the source address should not be unset when the interface is up. We are speaking of the STA interface ( The reason why the flag |
Only queries going on
Unless the loop is blocked via isSet() check or STA is connected so the bResult finally returns true, it never gets to these A record and the http service responses.
We do change opmode though, so we do expect both up and link-up? The gist of the issue seems to be with the initial probe result never succeeding from the mdns lib pov, so it never wants to do anything else until it does. And it does seem reasonable to help it out and filter the invalid netif instead of failing everything, will update with a PR |
There are two interface "up" flags:
So it is strange that the IP address above is unset. Reproducing this bug should allow to dig into lwip2's code and track this bug down (having in mind that lwip2 logic is quite sensitive for general stability). |
@d-a-v
I'll check this. Not sending a request should trigger a timeout and keep mdns working. |
@d-a-v Have some trouble with my dev environment. PR will come what later. |
I have bumped into this exact issue. The clients cannot associate with the SoftAP interface as long as ESP8266 isn't connected to an access point. The issue isn't there when the ESP8266 connects to an access point. In that case the SoftAP works as intended. |
Submitted a PR to solve the infinite sending of host probes. To be decided/handled : |
Also noticed in https://savannah.nongnu.org/bugs/?37068 and the associated https://git.savannah.nongnu.org/cgit/lwip.git/commit/?id=4e520cdd3009cf2e04c50c173737b379ff7d72a2, it seems UP is totally ok state to be in during DHCP initialization. State callback needs to happen on IP change instead, not the interface status? If I understood correctly, only way to have a cb is to use |
Basic Infos
Platform
Problem Description
mDNS not working with WiFi.mode(WIFI_AP_STA) on current git, but working on v2.4.7
MCVE Sketch
The text was updated successfully, but these errors were encountered: