-
Notifications
You must be signed in to change notification settings - Fork 7.6k
MDNS.addService not working #962
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
I confirm this problem even with a generic ESP32 board |
But that’s to advertize the Arduino service. If you want to advertize a generic service (like OSC over UDP) it doesn’t work. |
No the service is not shown even in Service Browser forAndroid WiFi.setHostname(..) |
Ok, I started comparing the ESPmDNS.cpp (ESP32) with the ESP8266mDNS.cpp (ESP8266) and found some interesting differences.
On the ESP8266 version the library takes care of
So maybe try
It nether bothered me because I did the same all my ESP8266 projects and ESP32 projects already, so I never saw the problem. @me-no-dev - Maybe ESPmDNS needs some update to be 100% compatible with the ESP8266 version. |
Doesn't work for me either. And hasn't for quite a while. Edit: I changed "tcp" to "_tcp" and it works! |
I tried it on
I tried it with the ESP32 example codes
In the example codes I only made the changes from One thing I found out is that after flashing, the mDNS advertise sometimes couldn't be found immediately. Then I had to do a hard reset (push reset button or power off/on cycle). After a hard reset it worked always. Can you give me a code excerpt that shows the initialization and adding of services? |
@beegee-tokyo I've added the "_" prefix to service and protocol and now it works.. TO BE DOCUMENTED.. but the query method doesn't work since MDNS.query cannot find any result..( with or without the prefix) Anyway there is a bug or a serious inconsistency, since in the query method code the "_" prefix is added anyway while int the addService method the prefix is required to be provided in the input parameter.. |
Saw this as well. Inconsistent and in general the ESP8266 and ESP32 mDNS should work the same. But happy I could at least help with the advertising. |
@beegee-tokyo so can you fix that all? |
Will try in the next days. |
@baggior pull request sent, now it is up to @me-no-dev to merge it. |
@beegee-tokyo thank you anyway the query() method doesnt works for me with or without '_' can you please check also this bug and try to fix it in the same PR #1085? here's my code gist the output is always "no services found" |
@baggior I successfully tested the query with "standard" services like http, workstation or SSH. Didn't try it with UDP port and "special" service. |
Really please add a note in the source as a comment about that then... |
I think that is intended behavior. I setup an |
@beegee-tokyo initially after the esp32 startup all the service I publish on MDNS are shown by the client (Android Service Browser) what could be the issue? |
@baggior I do not make any update to the mDNS services after I fired them up and they still show after hours. But I do not use the _workstation._tcp at the moment. As this is the one you see after the others disappeared, it might be connected to this service. How do you initiate that service? Are you using the EDIT |
@baggior Did you ever find a solution for this? Tried the example code to align it with the thread: With ESP8266 and this works perfectly, but not with ESP32 (ESP-Wroom-32). Any ideas? |
FWIW, i was also having the same trouble. I was using Firefox this whole time. I tried it with Opera and using http://esp32.local/ it worked perfect. |
Works on ESP32 devkit V4 with Opera but not with Firefox or Edge. |
Adding the _ in front, worked for me |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This stale issue has been automatically closed. Thank you for your contributions. |
I finally found a workaround for this.
(Here is the full code) Without that line, the mDNS disappears after 6-12 hours. |
- Underscore before names per espressif/arduino-esp32#962 - Only one service per port The combination of both changes is needed to make the service discoverable in OpenHAB The removal of the published http service is maybe something you don't want, but as long as it doesn't serve web pages it is maybe OK?
Please fill the info fields, it helps to get you faster support ;)
Hardware:
Board: Adafruit ESP32 Feather
Core Installation/update date:
IDE name: Arduino 1.8.5 on MacOS
Flash Frequency: ?80Mhz?
Upload Speed:
Description:
Using the mDNS_Web_Server example sketch, I can't get the addService method to work. The sketch runs fine, I can access my ESP32 using the esp32.local URL but it doesn't get advertised on the network when checking with different mdns browsers. Similar code works with the esp8266. Also browsing services seems to work.
The text was updated successfully, but these errors were encountered: