Skip to main content
Visitor II
April 6, 2025
Question

Free-RTOS and mDNS

  • April 6, 2025
  • 3 replies
  • 628 views

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?

    This topic has been closed for replies.

    3 replies

    Super User
    April 6, 2025

    Here: https://www.freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/02-Networking-basics/21-mDNS

    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

     

    JDWBEAuthor
    Visitor II
    April 7, 2025

    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.

    JDWBEAuthor
    Visitor II
    April 10, 2025

    Hello

    Is there any suggestion what i can try?

    Kind Regards

    Super User
    April 10, 2025

    Try to debug, sometimes it helps. Questions about LwIP and its applications can be also asked on Stack Overflow.