Hi,
The mDNS example in IDF V3.3 works fine for me, but v4.0 does not. I can ping the targets IP address, and pressing the BOOT button results in a list of mDNS devices on my network. What's not working is ping esp32-mdns.local. I can ping other .local devices on my network.
One big difference from v3.3 to v4.0 is the change to using esp_event_loop_create_default()
So I'm wondering where mdns_handle_system_event is called in the v4.0 example?
The IDF docs say applications are required to call it from the system event handler for normal operation of mDNS service. In looking at the IDF source I don't see where this happens.
mDNS ping example not working in ESP-IDF v4.0 Beta 0.2
Re: mDNS ping example not working in ESP-IDF v4.0 Beta 0.2
It's not mentioned in the IDF docs, but mdns_handle_system_event is tagged as deprecated in mdns.h, so the default handler must handle mDNS somehow.
Still trying to figure out why mDNS is not working.
Still trying to figure out why mDNS is not working.
Code: Select all
esp_err_t mdns_handle_system_event(void *ctx, system_event_t *event) __attribute__((deprecated));
-
- Posts: 69
- Joined: Thu Nov 01, 2018 8:32 am
Re: mDNS ping example not working in ESP-IDF v4.0 Beta 0.2
Hi growver,
The mdns event handler is registered internally in mdns_init() here: https://github.com/espressif/esp-idf/bl ... ns.c#L4246.
There's no need to register them in a user code anymore, nor use the `mdns_handle_system_event()`
How does your mdns initialisation code look like? Is it the same as the mdns example code from v4.0 https://github.com/espressif/esp-idf/bl ... ple_main.c?
Thanks,
David
The mdns event handler is registered internally in mdns_init() here: https://github.com/espressif/esp-idf/bl ... ns.c#L4246.
There's no need to register them in a user code anymore, nor use the `mdns_handle_system_event()`
How does your mdns initialisation code look like? Is it the same as the mdns example code from v4.0 https://github.com/espressif/esp-idf/bl ... ple_main.c?
Thanks,
David
Re: mDNS ping example not working in ESP-IDF v4.0 Beta 0.2
Unfortunately, the ESP-IDF mDNS example itself is not working for me either. Reporting of other mDNS devices works (i.e. when the button is pressed), but I can't ping esp32-mdns.local just the IP address.
I tried the example in ESP-IDF v3.3 and had no issues, so still stumped about what's wrong now that I'm working with v4.0. Wireshark shows the mDNS client request from the ping, but it's completely ignored by unmodified ESP32 mDNS example. I'll dig deeper, but was hoping it was something obvious.
I tried the example in ESP-IDF v3.3 and had no issues, so still stumped about what's wrong now that I'm working with v4.0. Wireshark shows the mDNS client request from the ping, but it's completely ignored by unmodified ESP32 mDNS example. I'll dig deeper, but was hoping it was something obvious.
Re: mDNS ping example not working in ESP-IDF v4.0 Beta 0.2
I still haven't been able to successfully run ping esp32-mdns.local using ESP-IDF V4. I've been digging into mdns code by adding ESP_LOGI statements. I can see that the ESP32 mdns example is seeing the multicast mDNS packet, the host name matches successfully, and _mdns_upd_pcb_write() completes, sending 92 UDP bytes is response (from mdns_networking.c)
However, I still can't see the response in wireshark and the ping fails.
Can someone confirm that pinging the mDNS example in V4 works? (only v3.3 works for me).
However, I still can't see the response in wireshark and the ping fails.
Can someone confirm that pinging the mDNS example in V4 works? (only v3.3 works for me).
Re: mDNS ping example not working in ESP-IDF v4.0 Beta 0.2
It works in 4.1
Re: mDNS ping example not working in ESP-IDF v4.0 Beta 0.2
Thanks WiFive,
Moving my project to IDF V4.1-dev got mDNS working. I don't understand why but moving forward again.
Moving my project to IDF V4.1-dev got mDNS working. I don't understand why but moving forward again.
-
- Posts: 69
- Joined: Thu Nov 01, 2018 8:32 am
Re: mDNS ping example not working in ESP-IDF v4.0 Beta 0.2
There might be a related bugfix, not included in v4.0-beta2, but already on the release branch (https://github.com/espressif/esp-idf/co ... 3652efa30c)
Could you please check if that resolves the ping issue? (either using release/v4.0 branch or picking that commit to your IDF version)
Could you please check if that resolves the ping issue? (either using release/v4.0 branch or picking that commit to your IDF version)
Re: mDNS ping example not working in ESP-IDF v4.0 Beta 0.2
cermak,
I can confirm that your changes fixed the issue I was seeing. To be sure I also went back to V4.0 Beta 2 to re-confirm that the mDNS example was not working.
Thanks for the fix!
I can confirm that your changes fixed the issue I was seeing. To be sure I also went back to V4.0 Beta 2 to re-confirm that the mDNS example was not working.
Thanks for the fix!
Who is online
Users browsing this forum: Bing [Bot], ok-home and 132 guests