Skip to content

mdns not answer to linux mdns-scan #1978

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
miky2k opened this issue Apr 26, 2016 · 6 comments
Closed

mdns not answer to linux mdns-scan #1978

miky2k opened this issue Apr 26, 2016 · 6 comments

Comments

@miky2k
Copy link

miky2k commented Apr 26, 2016

----------------------------- Remove above -----------------------------

Basic Infos

Hardware

Hardware: generic
Core Version: 2.1.0

Description

mdns not answer to linux mdns-scan
mdns.begin is executed after receiving ip from dhcp in sta mode

addService return void so i don't know if it exit because does not addService
(but i suppose it can return error with minor changes).

mdns.update is located in loop.

Settings in IDE

Module: Generic ESP8266 Module
Flash Size: 4MB/3MB
CPU Frequency: 80Mhz
Flash Mode: qio
Flash Frequency: 40Mhz
Upload Using: SERIAL
Reset Method: ck

@miky2k miky2k changed the title mdns not answare to linux mdns-scan mdns not answer to linux mdns-scan Apr 26, 2016
@me-no-dev
Copy link
Collaborator

mdns is global and asynchronous service.
the following is all you need to start it and add a service

void setup(){
  MDNS.begin(hostname);
  MDNS.addService("http","tcp",80);
}

If you are using ArduinoOTA, then you should know that MDNS is started by ArduinoOTA and you need to just add the service after you ArduinoOTA.begin()

@miky2k
Copy link
Author

miky2k commented Apr 29, 2016

I'm not using arduino OTA, do you suggest to remove mdns.update() from loop ?

@igrr
Copy link
Member

igrr commented Apr 29, 2016

Yes, it's sufficient to do MDNS.begin and whatever MDNS.addService needed in your application.
Make sure you're not creating an instance of MDNS though (as in ESP8266mDNS mdns;).

@miky2k
Copy link
Author

miky2k commented Apr 29, 2016

Ok, now work , but i have to wait dhcp for assigned ip.
What happen if i change ip (dhcp lease) of if i lost for a while AP signal (autoreconect enable) or if i use wifimulti ?
There is possibility to hook MDNS begin with wifievent to make ip change traking automatically?

mdns-scan not work but i see in wireshark answer and linux avahi give to browser correct ip-name resolution.

@igrr
Copy link
Member

igrr commented May 16, 2016

Re automatic (re-)start of mDNS, there is an open ticket: #1828.

@igrr igrr closed this as completed May 16, 2016
@miky2k
Copy link
Author

miky2k commented May 16, 2016

ok , i will wait for mdns improveent

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

3 participants