Skip to content

ESPmDNS Seems not to work. #387

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

Closed
Kraay89 opened this issue May 19, 2017 · 8 comments
Closed

ESPmDNS Seems not to work. #387

Kraay89 opened this issue May 19, 2017 · 8 comments

Comments

@Kraay89
Copy link

Kraay89 commented May 19, 2017

Not sure if this is even close to allowed here (my first ever issue created on GH).

After adding the following to my program in the appropriate place in a slightly altered wifi server example (after WiFi.begin... and before server.begin)

WiFi.setHostname("MyDevice");

My program compiles and everything works as advertised, however:
I can't reach the device from a browser as i was expecting to... I cant ping the device either from powershell. Is this correct behavior and did i misinterpret how ESPmDNS works and what it provides or am i missing something?

@erenfro
Copy link

erenfro commented May 19, 2017

I'm having this same issue. In my case, I'm using the ArduinoOTA which does ultimately set the mDNS name itself, and it too started failing since a recent git pull. It worked at one point prior, but stopped. I just wish I recalled which checkout tag I was on at the time I noticed it working.

@copercini
Copy link
Contributor

@Kraay89 try with all letters in lowercase ;)

@zsiroslaci
Copy link

I just tried ESPmDNS example. I was compiled without any error, but it not work.
I suppose that MDNS.begin("esp32"); should include IPAddress as well , or something to bond to it, but no exaple what and how. In case of Esp8266, the WiFi.localIP() is included an that is working. in ESP32 it does not work, giving compiling error. What is the solution?

@baggior
Copy link
Contributor

baggior commented Feb 3, 2018

I can confirm that mdns is not working to me too
no error shown but the service is not dicovered.
board = esp32dev

(The same code on ESP8266 works)

@beegee-tokyo
Copy link
Contributor

beegee-tokyo commented Feb 5, 2018

As commented here there are differences between the ESP8266 version of the library and the ESP32 version

  • Service name must be all lower case and start with an '_'
  • Protocol must be all lower case and start with an '_'

If you call the same way as in ESP8266

MDNS.addService("osc", "udp", 4500);
MDNS.addServiceTxt("osc", "udp", "board", "ESP8266");

it will fail (without error) on ESP32. You need to call with

MDNS.addService("_osc", "_udp", 4500);
MDNS.addServiceTxt("_osc", "_udp", "board", "ESP32");

@everslick
Copy link
Contributor

This issue is closed, because it looks as if it is not a bug or problem with the ESP32 Arduino core or its support libraries. For general API usage questions or help on specific coding challenges, please visit the arduino-esp32 Gitter channel. If you feel this issue was closed in error, reopen it and comment, why you think this is a bug in the Arduino-Core.

@MkLHX
Copy link

MkLHX commented Dec 17, 2018

Hi, i have the same problem now on ESP32 with ESPmDNS lib.

I understand the reason why this issue is closed but where put the searching result about fix it.

I tried all i can seen here. But nothing help me.

I tried the mDNS_Web_Server example and just change "http" and "tcp" to "_http" and "_tcp" on

   MDNS.addService("_http", "_tcp", 80);

But when i try to acces on http://esp32.local
nothing happens

I'm using ESP32 Dev Module board / PlatformIO / Espressif Arduino-Esp

@elchupokabrapolisetty
Copy link

@MkLHX

Add

MDNS.addService("_http", "_tcp", 80);
MDNS.addServiceTxt("_http", "_tcp", "board", "ESP32");

make sure that both the statements are added.
I had the same problem and it was fixed after i added the Second line

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

No branches or pull requests

9 participants