Skip to content

Commit 7a2e935

Browse files
zacharydrewearlephilhower
authored andcommitted
Fix OTA in AP mode (esp8266#5894)
OTA is broken in AP mode because ESP8266mDNS is checking whether the station is connected before processing. Change the logic to WiFi.isConnected() OR WiFi.softAPgetStationNum()>0 fixes the issue.
1 parent e829221 commit 7a2e935

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

libraries/ESP8266mDNS/src/LEAmDNS_Control.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,10 @@ bool MDNSResponder::_process(bool p_bUserContext) {
7878
}
7979
}
8080
else {
81-
bResult = ((WiFi.isConnected()) && // Has connection?
82-
(_updateProbeStatus()) && // Probing
83-
(_checkServiceQueryCache())); // Service query cache check
81+
bResult = ((WiFi.isConnected() || // Either station is connected
82+
WiFi.softAPgetStationNum()>0) && // Or AP has stations connected
83+
(_updateProbeStatus()) && // Probing
84+
(_checkServiceQueryCache())); // Service query cache check
8485
}
8586
return bResult;
8687
}

0 commit comments

Comments
 (0)