Sachin
Sachin

Reputation: 2775

Not able to browse the mdns service created in esp8266

What I done till now is

I created mdns service in my nodemcu

    ... // code used to create the mdns service 

    if (mdns.begin("esp", WiFi.localIP()))
        Serial.println("MDNS responder started");

    server.begin();
    Serial.println("HTTP REST Server Started");

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

   ...

Then I installed Bonjour in my windows . After that I am able to ping esp.local from my windows power shell and also I could communicate with the iot device from browser using the mdns name esp.local .

The Issue Iam struggling with right now .

Iam not able discover this device while searching for mdns services . I used dns-sd in windows powershell to browse my service , but its not discovering this device .

the command is dns-sd.exe -B <Type> <Domain> (Browse for services instances) So I tried with

dns-sd -B _http._tcp local. //have doubt about this one .

and its just showing

Browsing for _http._tcp.local.

It would be great if any one could help me with this. Thanks.

Upvotes: 6

Views: 7604

Answers (4)

secmask
secmask

Reputation: 8107

for me, need to call MDNS.update() inside loop function to make it work.

Upvotes: 9

Sachin
Sachin

Reputation: 2775

Replacing MDNS.addService("http", "tcp", 80); to mdns.addService("http", "tcp", 80);

Solved the problem . mdns is my MDNSResponder object instance .

Upvotes: 1

Joni
Joni

Reputation: 841

These are the commands I use on MacOS which work for my friend's ESP8266 based device:

Browse HTTP Bonjour service instances:

$ dns-sd -B _http._tcp .

Resolve Bonjour service instance:

$ dns-sd -L <device name> _http._tcp .

Upvotes: 1

Ejal
Ejal

Reputation: 11

abhayastudios asked me to help you out.

Did you include ESP8266mDNS.h in your code?

You could always try to discover all your mdns devices using the android app called fing. Did you check the windows services to see if bonjour printing service is running (or installed)? Sometimes windows stops this service.

Let me know if this helped.

Upvotes: 1

Related Questions