Open archef2000 opened 3 weeks ago
Hi @archef2000
You'd have to register the interface and enable it for specific IP protocols v4, v6 or both:
If you're also advertizing, you'd also need to send announcements:
(not necessary if you're just querying)
Thanks for the quick answer when running the code (Added on line 335 in capture.c) I get the following error when adding the events for IP6 & IP4: 103 ESP_ERR_INVALID_STATE
What's the number of configured interfaces in mdns Kconifg?
CONFIG_MDNS_MAX_INTERFACES
This is 3 by default, but also 3 predefined interfaces are enabled, so there's probably no space for a another one by default.
you can either increase the CONFIG_MDNS_MAX_INTERFACES
or disable one of the predefined
(or disable everything if you just need the mdns for the lowpan6_ble_netif
)
Oh thanks I disabled the default interfaces to solve the invalid state error. Here is the new log where after 2-3 Query attempts it stops to send out packets and lwip is just doing some minimal packet handeling after that.
@archef2000 How exactly does your netif handle multicasts? I saw that you enabled NETIF_FLAG_MLD6 directly in lwip.
Is this lwip issue https://github.com/espressif/esp-lwip/issues/72 related? I would guess some memory corruption is taking place in your netif while processing multicast packets.
Answers checklist.
General issue report
I have created a custom esp netif for Apple wireless direct link. Implementation here Now I am trying to query for the airdrop service of other iPhones.
After I init the netif and registerd it with mdns i query for airdrop here: /main/wifi/capture.c#L233
But It does not send any udp packet to the custom inetif and also does not find any records.
What are all the required steps for a netif to be seen ready, valid and etc for mdns to send query packets?
Log
```js E (21156) awdl: mdns_query_task I (21156) custom_netif_example: Query PTR: _airdrop._tcp.local I (21156) _mdns_send_search_action: queue send I (21156) _mdns_execute_action: 3 I (21256) _mdns_send_search_action: queue send I (21256) _mdns_execute_action: 4 I (21256) _mdns_search_send_pcb: mdns_is_netif_ready 0 I (21256) _mdns_search_send_pcb: mdns_is_netif_ready 0 I (21266) _mdns_search_send_pcb: mdns_is_netif_ready 0 I (21266) _mdns_search_send_pcb: mdns_is_netif_ready 0 I (21276) _mdns_search_send_pcb: mdns_is_netif_ready 0 I (21276) _mdns_search_send_pcb: mdns_is_netif_ready 0 D (21466) lwip: etharp_timer D (21466) lwip: dhcp_coarse_tmr() I (22356) _mdns_send_search_action: queue send I (22356) _mdns_execute_action: 4 I (22356) _mdns_search_send_pcb: mdns_is_netif_ready 0 I (22356) _mdns_search_send_pcb: mdns_is_netif_ready 0 I (22366) _mdns_search_send_pcb: mdns_is_netif_ready 0 I (22366) _mdns_search_send_pcb: mdns_is_netif_ready 0 I (22376) _mdns_search_send_pcb: mdns_is_netif_ready 0 I (22376) _mdns_search_send_pcb: mdns_is_netif_ready 0 D (22466) lwip: etharp_timer D (22466) lwip: dhcp_coarse_tmr() I (23456) _mdns_send_search_action: queue send I (23456) _mdns_execute_action: 4 I (23456) _mdns_search_send_pcb: mdns_is_netif_ready 0 I (23456) _mdns_search_send_pcb: mdns_is_netif_ready 0 D (23466) lwip: etharp_timer I (23466) _mdns_search_send_pcb: mdns_is_netif_ready 0 D (23466) lwip: dhcp_coarse_tmr() I (23476) _mdns_search_send_pcb: mdns_is_netif_ready 0 I (23486) _mdns_search_send_pcb: mdns_is_netif_ready 0 I (23486) _mdns_search_send_pcb: mdns_is_netif_ready 0 I (24256) _mdns_send_search_action: queue send I (24256) _mdns_execute_action: 5 W (24256) custom_netif_example: No results found! D (24466) lwip: etharp_timer D (24466) lwip: dhcp_coarse_tmr() E (25256) awdl: mdns_query_task I (25256) custom_netif_example: Query PTR: _airdrop._tcp.local I (25256) _mdns_send_search_action: queue send I (25256) _mdns_execute_action: 3 I (25356) _mdns_send_search_action: queue send I (25356) _mdns_execute_action: 4 I (25356) _mdns_search_send_pcb: mdns_is_netif_ready 0 I (25356) _mdns_search_send_pcb: mdns_is_netif_ready 0 I (25366) _mdns_search_send_pcb: mdns_is_netif_ready 0 I (25366) _mdns_search_send_pcb: mdns_is_netif_ready 0 I (25376) _mdns_search_send_pcb: mdns_is_netif_ready 0 I (25376) _mdns_search_send_pcb: mdns_is_netif_ready 0 ```