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

mDNS not working #4790

Closed
meditant opened this issue Jun 6, 2018 · 50 comments · Fixed by #7786
Closed

mDNS not working #4790

meditant opened this issue Jun 6, 2018 · 50 comments · Fixed by #7786
Assignees
Labels
waiting for feedback Waiting on additional info. If it's not received, the issue may be closed.
Milestone

Comments

@meditant
Copy link

meditant commented Jun 6, 2018

Platform

  • Hardware: ESP8266
  • Core Version: [Esp8266/Arduino v2.4.1|Arduino IDE 1.8.5]
  • Development Env: [Arduino IDE|Platformio]
  • Operating System: [MacOS 10.13.4|iOS 11.4]

Settings in IDE

  • Module: [Wemos mini D1 Pro 16M]
  • Flash Size: [15MB/1MB]
  • Flash Frequency: [40Mhz]
  • CPU Frequency: [160MHz]
  • Upload Using: [SERIAL]
  • Upload Speed: [115200|other] (serial upload only)

Problem Description

Hello,

I try to use the mDNS library with Wemos mini D1 pro, and that's not working !!!

When I ping the ip it's work, when I ping other .local equipment it's working but when I try to ping or use in some different browser the esp hostname (uvpm.local) a got an error ???

I use mac os with high sierra, iPhones with some different network tools and "bonjour" mDNS scanner, I can see the ip and the open port but not the hostname.local

Esp8266/Arduino v2.4.1

I try to use the MDNS.begin before and after the serveurweb.begin();

Best regards,

MCVE Sketch

wifiManager.autoConnect("UVPM","mdp");

//if you get here you have connected to the WiFi
Serial.println("connected...yeey :)");

serveurWeb.begin();
printHTTPServerInfo();

if (!MDNS.begin("uvpm")) { // Start the mDNS responder for esp8266.local
Serial.println("Error setting up MDNS responder!");
}
Serial.println("mDNS responder started");

// Add service to MDNS-SD
MDNS.addService("http", "tcp", 80);

@RudyFiero
Copy link

RudyFiero commented Jun 6, 2018

mDNS works for me. And if you don't fill out the required information from the issue template nobody is going to take your failure seriously.

@meditant
Copy link
Author

meditant commented Jun 6, 2018

Hello,

I changed my post, sorry.

I have read many posts about mDNS and sometime it work and sometimes not !

The integration is simple and I don't see why it is not working, and I don't see if the problem comes from my computer why it works with other mDNS implementation ?

Best regards,

@meditant
Copy link
Author

meditant commented Jun 6, 2018

Hello,

I try another board ESP32 Wemos LOLIN with the same program, iMac and iPhone i just change to ESP32 include :

#include <WiFi.h>
#include <ESPmDNS.h>

It's work fine !

Strange no ?

@RudyFiero
Copy link

There are big differences in the implementation so I'm not surprised by this. When you revised the issue and stated that you are using MacOS I thought that might be part of the problem. The mDNS code is being looked at, a rewrite, but it is not a very high priority mainly due to the complexity and the amount of work involved. So I don't expect anything new for a while.

The only thing I can suggest is using a program like Wireshark and try and determine where things are failing. If I had an Apple computer I would try and look into this but I don't so I can't.

@meditant
Copy link
Author

meditant commented Jun 6, 2018

I download Wireshark and try to look why !

The ESP32 library works fine but after some time stop to work, the ESP32 it not freeze and the webserver work but only with ip address...

Thanks for all this informations !!!

@devyte
Copy link
Collaborator

devyte commented Jun 6, 2018

@RudyFiero is correct. In the esp32 framework, MDNS is a wrapper around the IDF implementation, which is completely different from ours. In fact, that implementation actually passes Apple's conformance tests, while our naive code does not.
Our MDNS is being rewritten based on the IDF code, but it will take a long time due to the complexity of the protocol logic and IDF code, and due to the extreme differences in architecture between IDF and NONOS SDK. Also, because I have to prioritize my time :p
For our current implementation, it's unlikely it will be fixed by any current developer. However, if you encounter a bug or crash, and propose a fix, I'll try to evaluate and merge it.
There's at least one known mem leak and one known bug related to compressed pointer atm. Looking at the proposed fixes is still on my todo list.

@devyte devyte added the waiting for feedback Waiting on additional info. If it's not received, the issue may be closed. label Jun 6, 2018
@devyte
Copy link
Collaborator

devyte commented Jun 6, 2018

Marking as Waiting for feedback, pending details about what's wrong and a fix.

@devyte devyte self-assigned this Jun 8, 2018
@ghost
Copy link

ghost commented Jul 11, 2018

Hello, I have the same problem of mDNS and sometimes it works and sometimes not. I'm using ESP8266 and the mDNS_WEB_Server example. I have bonjour installed, but I can not connect to it, I put the IDE with debug enable and the output is this:

When accessed by IP:
WS: ac
: ref 1
WS: av
: ref 2
: ur 2

New client
: rn 381
Request: /
Sending 200
: wr 113 113 0
: wrc 113 113 0
Done with client
: ur 1
close
WS: dis
of the
WS: ac
: ref 1
WS: av
: ref 2
: ur 2

New client
WS: ac

When I access for esp8266.local /:

: rcl
Abort
: rcl
Abort
Invalid request:
: ur 1
WS: dis
of the
: ref 1
WS: av
: ref 2
: ur 2
: ur 1
WS: dis
of the
: urn 52
Urch 52, 28
: urd 4, 28, 13

I hope this information helps you.

And if anyone already has news, thank you for saying so.

Cump Joel Mendes

@aravindara
Copy link

#include <WiFi.h>
#include <ESPmDNS.h>

i am using this and when i connect my pc and esp32 with the same network it is working in browser but in the android device i need to enter the ip address to access the esp32.What should i do to correct it.

@devyte
Copy link
Collaborator

devyte commented Dec 5, 2018

Closing in view of #5442 with a full rewrite of mdns.

@devyte devyte closed this as completed Dec 5, 2018
@karmakazi
Copy link

The example code I've found on the web for mDNS does not work for me. It's the same issue as the OP.

I dug through the library source code and the example code did work. Every time! There are quite a few differences in the code so I took each line from the working code and put it into the non working version. The line that is missing is the non working code is the following:

void loop() {
MDNS.update();
}

Hope this helps somebody.

If you want to check out the example code you can find it here on MacOS:
/Users//Library/Arduino15/packages/esp8266/hardware/esp8266/2.5.2/libraries/ESP8266mDNS/examples/mDNS_Web_Server/mDNS_Web_Server.ino

@rajnish1959
Copy link

I am no software guy by any means yet tried activating mdns on android by installing printer apps like LetsPrintDroid , Printershare and Printbot which use mdns and lo and behold - both chrome and firefox immediately started recognizing esp8266.local! It may be useful for many of us to simply install these apps so that browsers on android become useful on iot plateforms. May be some of the wise software guys find out which of the three did the trick.

@nikk16
Copy link

nikk16 commented Aug 12, 2020

I spent a week trying to find why my ESP8266 mDNS wasn't working.
When i ping it, the following happened-
ping esp8266 -Ping request could not find host esp8266. Please check the name and try again.
ping esp8266.local -Ping request could not find host esp8266.local. Please check the name and try again.
ping esp8266. -Ping Worked

via browser I wasn't able to access ' esp8266.local '

finally it worked when i used ' esp8266./ '

Also this worked in Chrome on Android and on Windows both with and without bonjour installed on Windows.

@d-a-v
Copy link
Collaborator

d-a-v commented Aug 12, 2020

Try adding setSleepMode(WIFI_NONE_SLEEP); in setup().

esp8266.local is resolved by a daemon on your PC. You need either "bonjour" (macOS), "mDNS services"(?windows) or "avahi-daemon"(linux) installed to be able to resolve the .local mDNS names published by the esp.

finally it worked when i used ' esp8266./ '

That one may have been resolved by your local DNS+DHCP server.

Also this worked in Chrome on Android and on Windows after uninstalling Bonjour too.

That is a further reason in favor of your router. esp8266.local should work with a proper mDNS environment on your computer. There are android apps, I use "service browser" for testing.

@nikk16
Copy link

nikk16 commented Aug 12, 2020

I will try to find the problem in Windows and report back if I find it. But for now, I can access my ESP via ' esp8266./ '.
I posted it in case someone else was having a similar problem, they would find this answer. Thanks for your quick reply.

I had bonjour installed, ' esp8266.local ' still didnt work.

' esp8266./ ' worked both with and without bonjour installed on Windows.
' esp8266./ ' worked in Chrome on Android whithout any other apps or settings changes.
' esp8266./ ' worked both on my router and on my mobile hotspot.

Basically, ' esp8266./ ' worked universally.

@apulai
Copy link

apulai commented Sep 28, 2020

Hello,
For me it started working when I have added to the main loop these lines:
// Allow MDNS processing
MDNS.update();
I think this is critical.

I do not know if this is critical, but I have this in my setup() function:
Use Wifi in STA mode (not AP mode):
WiFi.mode(WIFI_STA);
delay(100);

And I am also registering an http service on port 80:
if (MDNS.begin("myname")) {
MDNS.addService("http", "tcp", 80);
Serial.println("\nMDNS responder started");
}

@EricDuminil
Copy link

For what it's worth : simply starting MDNS in setup() and updating it in loop() wasn't enough for the sensor to answer pings at esp8266.local.
The ESP actually had to offer a service (e.g. HTTP on port 80) for it to answer at esp8266.local, even just for pings.

@d-a-v
Copy link
Collaborator

d-a-v commented Dec 1, 2020

@EricDuminil Can you retry with git head version or beta release version and open a new issue if you can reproduce it (with MCVE or a reference to a relevant existing example) ?

@EricDuminil
Copy link

@d-a-v Sorry, the problem is hard to reproduce, so I cannot give a MCVE. This issue espressif/arduino-esp32#4406 seems to be the closest to what I'm experiencing.

@d-a-v
Copy link
Collaborator

d-a-v commented Dec 5, 2020

Are you experiencing issues with mDNS on esp32 or esp8266?

@EricDuminil
Copy link

@d-a-v Sorry about that, I realize it wasn't clear at all. I'm experiencing these problems with an esp8266. The symptoms are exactly the same as in the linked issue, which was indeed described for an esp32.
It might help understanding the issue if it appears on different boards.

@d-a-v
Copy link
Collaborator

d-a-v commented Dec 6, 2020

We need to be able to reproduce. We still don't know what version of the core you are using nor if you experience such issue with the provided mDNS examples. mDNS has had such issues you describe but has been recently updated. You need to try with git master version of this esp8266 core, or with the beta release version installable on arduino ide.
If you still experience these problems, please open a new issue with details.

@EricDuminil
Copy link

@d-a-v As far as I can tell, the core version I use is 2.6.2 with PlatformIO, and 2.7.4 with Arduino IDE, both with the same behaviour.
Sorry, I didn't find the beta release version on arduino ide, either via Google or on GitHub. I also couldn't manage to compile the git master version with PlatformIO.
Do I need another source than https://arduino.esp8266.com/stable/package_esp8266com_index.json ?

@d-a-v
Copy link
Collaborator

d-a-v commented Dec 7, 2020

About PlatformIO here is an unofficial answer after a google search: platformio/platform-espressif8266#49 (comment)
About Arduino IDE, here is an unofficial answer from me.

edit Our official answer:
https://arduino-esp8266.readthedocs.io/en/latest/installing.html#using-git-version

@EricDuminil
Copy link

@d-a-v Thanks a lot. I used https://d-a-v.github.io/esp8266/Arduino/package_esp8266com_index.json in Arduino IDE and tried both git:'2.7.2-182-g8b662ed3' and git:'2.7.2-365-g96c62677'. The problem still persists.

Using the "mDNS_Web_Server.ino" example (the only modification was for SSID & password), the ESP8266 stops answering at http://esp8266.local after 2 minutes. The HTTP server still answers when using the local IP.

One ugly workaround is to force a restart:

MDNS.close();
MDNS.begin("esp8266");

every 30 seconds, but it seems to create a memory leak (~224 bytes at every restart).

@hreintke
Copy link
Contributor

hreintke commented Dec 8, 2020

@EricDuminil @d-a-v
Might be related to the way the example is handling the http requests in relation to browser optimization.
That would cause the MDNS,update() not being called.
Due to this construct :

  // Wait for data from client to become available
  while (client.connected() && !client.available()) {
    delay(1);
  }

Can you retry with this updated example and report back ?

/*
  ESP8266 mDNS responder sample

  This is an example of an HTTP server that is accessible
  via http://esp8266.local URL thanks to mDNS responder.

  Instructions:
  - Update WiFi SSID and password as necessary.
  - Flash the sketch to the ESP8266 board
  - Install host software:
    - For Linux, install Avahi (http://avahi.org/).
    - For Windows, install Bonjour (http://www.apple.com/support/bonjour/).
    - For Mac OSX and iOS support is built in through Bonjour already.
  - Point your browser to http://esp8266.local, you should see a response.

*/


#include <ESP8266WiFi.h>
#include <ESP8266mDNS.h>
#include <WiFiClient.h>

#include <ESP8266Webserver.h>
#ifndef STASSID
#define STASSID "your-ssid"
#define STAPSK  "your-password"
#endif

const char* ssid = STASSID;
const char* password = STAPSK;

// HTTP server at port 80 will respond to HTTP requests
ESP8266WebServer server(80);

void handleHTTPRequest() {
  Serial.println("");
  Serial.println("HTTP Request");

  IPAddress ip = WiFi.localIP();
  String ipStr = ip.toString();
  String s = "<!DOCTYPE HTML>\r\n<html><h3><head>Hello from ";
  s += WiFi.hostname() + ".local at " + server.client().localIP().toString() + "</h3></head>";

  Serial.println("Sending 200");
  server.send(200, "text/html", s);
  Serial.println("Done with request");
}

void setup(void) {
  Serial.begin(115200);

  // Connect to WiFi network
  WiFi.mode(WIFI_STA);
  WiFi.begin(ssid, password);
  Serial.println("");

  // Wait for connection
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  Serial.println("");
  Serial.print("Connected to ");
  Serial.println(ssid);
  Serial.print("IP address: ");
  Serial.println(WiFi.localIP());

  // Setup HTTP server
  server.on("/", handleHTTPRequest);
  // Start HTTP server
  server.begin();

  // Set up mDNS responder:
  // - first argument is the domain name, in this example
  //   the fully-qualified domain name is "esp8266.local"
  // - second argument is the IP address to advertise
  //   we send our IP address on the WiFi network
  if (!MDNS.begin("esp8266")) {
    Serial.println("Error setting up MDNS responder!");
    while (1) {
      delay(1000);
    }
  }
  Serial.println("mDNS responder started");

  // Add service to MDNS-SD
  MDNS.addService("http", "tcp", 80);
}

void loop(void) {

  MDNS.update();
  server.handleClient();
}

@EricDuminil
Copy link

@hreintke Sorry, it shows same behaviour as before. (I had to uppercase the S in #include <ESP8266WebServer.h>)
The ESP stops answering at esp8266.local after 2 minutes.

❯ while sleep 10; do; date; ping -c1 -w3 -O -q esp8266.local | grep received; done
Sun Dec 13 23:40:02 CET 2020
ping: esp8266.local: Name or service not known
Sun Dec 13 23:40:17 CET 2020
1 packets transmitted, 1 received, 0% packet loss, time 0ms
Sun Dec 13 23:40:27 CET 2020
1 packets transmitted, 1 received, 0% packet loss, time 0ms
Sun Dec 13 23:40:37 CET 2020
1 packets transmitted, 1 received, 0% packet loss, time 0ms
Sun Dec 13 23:40:47 CET 2020
1 packets transmitted, 1 received, 0% packet loss, time 0ms
Sun Dec 13 23:40:57 CET 2020
1 packets transmitted, 1 received, 0% packet loss, time 0ms
Sun Dec 13 23:41:07 CET 2020
1 packets transmitted, 1 received, 0% packet loss, time 0ms
Sun Dec 13 23:41:17 CET 2020
1 packets transmitted, 1 received, 0% packet loss, time 0ms
Sun Dec 13 23:41:27 CET 2020
1 packets transmitted, 1 received, 0% packet loss, time 0ms
Sun Dec 13 23:41:37 CET 2020
1 packets transmitted, 1 received, 0% packet loss, time 0ms
Sun Dec 13 23:41:47 CET 2020
1 packets transmitted, 1 received, 0% packet loss, time 0ms
Sun Dec 13 23:41:57 CET 2020
1 packets transmitted, 1 received, 0% packet loss, time 0ms
Sun Dec 13 23:42:07 CET 2020
1 packets transmitted, 1 received, 0% packet loss, time 0ms
Sun Dec 13 23:42:17 CET 2020
ping: esp8266.local: Name or service not known

Actually visiting the website regularly (with Firefox & Chrome on Linux Mint 19.3) as opposed to merely pinging esp8266.local makes the esp answers for longer than 2 minutes. But if the webserver isn't called for more than 2 minutes, it stops answering esp8266.local, even though the access via local IP still works fine.

Note that it might start answering at esp8266.local afterwards, but this seems really random and I couldn't find a reproducible reason why or when it does.

@d-a-v d-a-v added this to the 3.0.0 milestone Dec 14, 2020
@d-a-v d-a-v assigned hreintke and d-a-v and unassigned devyte and hreintke Dec 14, 2020
@d-a-v d-a-v mentioned this issue Dec 21, 2020
@d-a-v
Copy link
Collaborator

d-a-v commented Dec 21, 2020

@EricDuminil Can you try #7786git master or the alpha release v0.0.2snapshot release v0.0.1 which includes it ?

@EddieGreen
Copy link

My observations have been very similar to @EricDuminil in that the service disappears after a couple of minutes. Isn't the TTl 120 seconds? Hmmm...

For giggles, I added mdns.announce() in a 30 second timer and the service now remains discoverable.

I think that mdns.update() is not continuing to announce beyond the initial mdns.begin() Shouldn't it be doing so?

@d-a-v
Copy link
Collaborator

d-a-v commented Jan 20, 2021

@EddieGreen can you also try with the latest git version or the snapshot release ?

@hreintke
Copy link
Contributor

@EddieGreen @d-a-v
AFAIK it is not the responsibility of the mdns server to announce regularly.
The mdns client should cache the original announce and request an update after 75% of TTL has passed.
If the client does not know the IP, it should send an mdns request and the mdns server should reply accordingly.

@EddieGreen
Copy link

Just tried 0.0.2. It looks like MDNS maintains the service record but I can't be sure because command line dns-sd -B _http._tcp shows addition and no removal but the android app Service Browser reports the service as disappearing after a while.

I'm using a timer with 15ms intervals to control an RGB LED using FastLED. Changes in the ESP8266 library seem to be causing interruptions to this processing as the LED flickers and changes colour randomly. I also have had some inconsistent rebooting.

What I have that works with 2.7.4 is this:

void AdvertiseServices()
{
    if(MDNS.begin(configuredHostName))
    {
        Serial.println(F("mDNS responder started"));

        MDNS.addService("http", "tcp", 80);
    }
}

void AnnounceServices()
{
    MDNS.announce();
}

void wifiConnected() // Call this on connection or re-connection
{
    AdvertiseServices();
}

setup()
{
    ...
    timer.setInterval(1 * 1000, AnnounceServices);
    ...
}

loop()
{
    ...
    MDNS.update();
    ...
}

I'm sure this is a hack but it's working reliably and is a solution to the many posts on this subject.

@d-a-v
Copy link
Collaborator

d-a-v commented Jan 20, 2021

What I have that works with 2.7.4 is this:
I'm sure this is a hack but it's working reliably and is a solution to the many posts on this subject.

It looks fine to me. Why is it a hack ?
@hreintke are you OK with it ?
@EddieGreen is there a difference with the v0.0.2 you tried ?
With what version of this core does android service browser see that the service disappears ?

I'm using a timer with 15ms intervals to control an RGB LED using FastLED. Changes in the ESP8266 library seem to be causing interruptions to this processing as the LED flickers and changes colour randomly. I also have had some inconsistent rebooting.

I too observed this issue, that does not happen with NeoPixel. I opened an issue.

@hreintke
Copy link
Contributor

@d-a-v
It is a hack as it makes the esp8266 not behaving according the specifications.
And it probably hides the root cause of the issue.

I prefer getting into the details and fix.

@rvdbreemen
Copy link

I have some users (random) that do not have mdns resolving, some do get it to work. I have no clue what the difference is. But I keep getting people that report the multicast dns is not working for them.

Is there any progress on this issue?

@jaiswalsk71
Copy link

jaiswalsk71 commented Sep 7, 2021

mDNS was not working for me as well. I was using MDNS.begin("esp8266") within the if construct as suggested in many posts. I then added MDNS.addService("http", "tcp", 80); in void setup(). It did not work. I then added MDNS.update(); in void loop().

All this while I had been pinging or browsing esp8266.local/ or esp8266./ as suggested in some of the posts. Spending almost a day and out of frustration, I then just pinged esp8266 and it worked. It worked on browser also when I typed http://esp8266 . I then removed MDNS.update() and MDNS.addService one by one and it did not work.

So, following statements related to mDNS worked for me

  1. #include - I am assuming you include this library

  2. . have following in void setup()

    if (MDNS.begin("esp8266")) {
    Serial.println("MDNS Responder Started");
    }
    else {
    Serial.println("MDNS Responder did not start");
    }

  3. have following in void setup()
    MDNS.addService("http", "tcp", 80);

  4. have following in void loop()
    MDNS.update();

  5. Last but not the least - ping esp8266 and not esp8266.local. Browse esp8266 and not esp8266.local/

I hope this may help someone and save valuable time for him/her.

Best,
Suresh Jaiswal

@MohithReddy1
Copy link

Hello,

I try another board ESP32 Wemos LOLIN with the same program, iMac and iPhone i just change to ESP32 include :

#include <WiFi.h>
#include <ESPmDNS.h>

It's work fine !

Strange no ?

For esp8266 I am using libraries

#include <ESP8266WiFi.h>
#include <ESP8266mDNS.h>

but mdns is not working. please help me

@d-a-v
Copy link
Collaborator

d-a-v commented Sep 20, 2021

@MohithReddy1 Did you try one of the examples with the latest version of this core ?

@fkemps
Copy link

fkemps commented Oct 6, 2021

Hello,

I ran into the same issue where esp8266 was not responding on mDNS requests for .local.

Moving the MDNS.begin("") and MDNS.addService("http", "TCP", 80) code after the webserver (TCP/80) was started made it working for me.

The MDNS.update() inside the void loop() was not needed.

@EricDuminil
Copy link

I still don't understand where the problem is coming from. It's really weird, though.
On the same network, from the same laptop and with the same microcontroller, sometimes the microcontroller answers at http://esp8266, sometimes at http://esp8266.local, sometimes not at all. :-/

@faelenor
Copy link

I think I know why a lot of users are experiencing this issue. If ArduinoOTA is used and started using ArduinoOTA.begin() and no hostname was set using ArduinoOTA.setHostname, the library will start MDNS and override the hostname with something like esp8266-xxxxxx where x is the chip id.

The solution is to either call ArduinoOTA.setHostname to set the hostname and remove your own calls to the MDNS library or to call ArduinoOTA.begin(false) to prevent the library from using MDNS and leave your calls to MDNS. The argument to begin is defaulted to true so it uses MDNS.

@EricDuminil
Copy link

@faelenor : For what it's worth, I've encountered the above problem a few times, but never used ArduinoOTA.

@aghosh0605
Copy link

Hello, For me it started working when I have added to the main loop these lines: // Allow MDNS processing MDNS.update(); I think this is critical.

I do not know if this is critical, but I have this in my setup() function: Use Wifi in STA mode (not AP mode): WiFi.mode(WIFI_STA); delay(100);

And I am also registering an http service on port 80: if (MDNS.begin("myname")) { MDNS.addService("http", "tcp", 80); Serial.println("\nMDNS responder started"); }

This one worked for me pretty well.
Loved it.

@TavakoliAli
Copy link

I have same issue on ESP32. Add following code to loop function solves my problem :

        static auto timer = millis() + 4000;
        if (millis() > timer)
        {

            timer = millis() + 4000;
            MDNS.end();
            if (true == MDNS.begin("myHost"))
            {

                MDNS.addService("http", "tcp", 80);
            }
        }

@rchandrashekar53
Copy link

I spent a week trying to find why my ESP8266 mDNS wasn't working. When i ping it, the following happened- ping esp8266 -Ping request could not find host esp8266. Please check the name and try again. ping esp8266.local -Ping request could not find host esp8266.local. Please check the name and try again. ping esp8266. -Ping Worked

via browser I wasn't able to access ' esp8266.local '

finally it worked when i used ' esp8266./ '

Also this worked in Chrome on Android and on Windows both with and without bonjour installed on Windows.

possible to share your mock code? it is not working from my end

@giltal
Copy link

giltal commented Oct 13, 2022

The problem is actually with the ESP8266MDNS library from SDK 2.5.0 and up
Just get the lib from version 2.4.0 and overwrite the one from the current version and it works just as before
with no need for MDNS.update()!!

@synman
Copy link

synman commented Feb 20, 2023

was having similar issues here with the latest platform sdk.

platform = espressif8266@4.1.0

If you are using ArduinoOTA, Remove all references to mDNS in your sketch and go with the following...

in setup():

	ArduinoOTA.setHostname(hostname);
   	ArduinoOTA.begin(true);

and inside loop():

	ArduinoOTA.handle();

This fixed oddities I was having with espota post version bump of the platform sdk and restored mDNS functionality on my ESP8266 board.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting for feedback Waiting on additional info. If it's not received, the issue may be closed.
Projects
None yet
Development

Successfully merging a pull request may close this issue.