-
Notifications
You must be signed in to change notification settings - Fork 13.3k
WebUpdater Example mDNS Not Working #7184
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
The MDNS lib global object works only over the station interface. If you want MDNS on the ap interface you have to use a 2nd MDNS object bound to the ap interface. |
@devyte but the webupdater example code is still wrong then? If mDNS is working as intended then the example code is incorrect. |
@devyte to clarify - this issue is about the example code not working. I just wasn't sure if it was the example code that was written wrong, or if mDNS was behaving badly. So if MDNS is behaving correctly then the example code IS written wrong and should be changed. Can you please re-open the issue? |
For a moment you convinced me, but then I remembered in those examples in ap mode you don't need mdns, because you can access the http server with the ap side IP address. |
@devyte Ok! But just in case it's my bad explaining I'll try to clarify a bit more - if you run the example and try to access via domain from the STA side it does not resolve (when, as in the example, mode is set to There is no documentation or comment that I could find anywhere that explains that you can only use MDNS if If the example is working as intended then I propose to just remove the MDNS portion of the example entirely because that definitely doesn't work in the code as written. Maybe just print the STA IP to the console instead? |
p.s. I can do a PR if you agree |
That confusion is precisely why the MDNS handling was changed: the singleton will now always handle and respond on the sta side. If you want ap side handling, you need a 2nd MDNS object.
But your comments make me think that is not true. I think the MDNS change was post 2.6.3 release, so you would have to test with current master, aka latest git, to see the effect. You can install latest git with the readthedocs instructions, or try @d-a-v 's alpha channel snapshot generator, which is much easier to install but I believe is a bit harder to update. |
Shoot you are totally right. I hadn't installed the git version properly and it was still running on 2.6.3. Reinstalled everything and tried again and it is now behaving as expected (2.7.0-dev as of April 15, 2020). I found the earlier issue discussions as well (e.g. #6975, #7042) - not sure why I couldn't find them before when searching past issues. Sorry to waste your time and appreciate your work! |
Basic Infos
Platform
Settings in IDE
Problem Description
ESP8266HTTPUpdateServer
exampleWebUpdater
mDNS does not work. Everything else seems to work as expected. Tried on multiple boards both OTA and Serial uploads. Tried reinstalling board definitions. If I changeWifi.mode(WIFI_AP_STA)
toWifi.mode(WIFI_STA)
then it works! Likely mDNS library does not expect basic service to work in AP mode (which makes sense).I'm thinking it's just a legacy error in the example code, but it could be a problem with the mDNS library?
MCVE Sketch
This is the slightly modified example code:
The text was updated successfully, but these errors were encountered: