2025-04-06 9:30 AM
Hello Community!
I'm busy with a project that needs support for mDNS, after a long search i can't find any documentation howto implement mDNS on a Free-RTOS system. The examples provided by ST are not aware of any OS (I Think).
Can someone share some information please?
2025-04-06 1:40 PM - edited 2025-04-06 1:45 PM
FreeRTOS+ TCP supports mDNS. Why you prefer LwIP over FreeRTOS+ TCP?
LwIP does support mDNS as well: https://www.nongnu.org/lwip/2_1_x/group__mdns.html
2025-04-07 3:53 AM - edited 2025-04-07 3:56 AM
Hello
Many thanks for your post.
When m i add this line in this way (right after lwip init, i use static ip):
static void srv_txt(struct mdns_service *service, void *txt_userdata)
{
res = mdns_resp_add_service_txtitem(service, "path=/", 6);
LWIP_ERROR("mdns add service txt failed\n", (res == ERR_OK), return);
}
//Inside Default Thread
....
// Init LWIP
LOCK_TCPIP_CORE();
mdns_resp_add_service(&gnetif, "myweb", "_http", DNSSD_PROTO_TCP, 80, 3600, srv_txt, NULL);
UNLOCK_TCPIP_CORE();
I Get this error on the terminal (When running):
Assertion "mdns_resp_add_service: Not an mdns netif" failed at line 2202 ... Middlewares/Third_Party/LwIP/src/apps/mdns/mdns.c
Maybe i forgot something to enable or i understand the implementation wrong?
I got exactly one ping back from the board, then it is dead. When i remove the mDNS stuff, the board works fine.