Copyright ©

Mongoose OS Forum

ATTENTION! This forum has moved to:

Do not post any new messages.

DLNA (SSDP Multicast) discover devices on network

Hi all!

I need to discover the DLNA devices in the network and list them.

As i understand, I must send a package of request in port 1901 and have a listener in the same port to get the requests.

Can you help me with a C example of how to do it?



  • Hi Gustav,

    I am having similar problem for IoT network, if you happen to know, would you mind sharing the method to discover my devices which are using Mongoose on the network ??

  • Hi Ahmedabad,

    For your case, I recommend using DNS-sd to publish the arduino services in the network.
    You can use a bonjour-like client to discover it.

    My case is the reverse.
    I need to discover my devices (smarttvs, DLNA servers etc) using the nodemcu as a client.


    Thanked by 1ankit_malpani
  • @gustavocmorais The starting point is
    Download the upnp specifications and read UPnP-arch-DeviceArchitecture-v2.0-20150220.pdf
    In a mos application issue a udp M-SEARCH request and process the responses.
    Sample code:

      struct mg_connection *udp = mg_connect(
          mgos_get_mgr(), "udp://", udp_discover_handler, NULL);
                "M-SEARCH * HTTP/1.1\r\n"

    udp_discover_handler processes the responses.

    Thanked by 1gustavocmorais
  • Thanks Gustav,

    but wouldn't it require user to know the name of ESP8266 device running MOS ? I am trying to give him a button on mobile app that can discover every esp8266 running my firmware on network without knowing its IP address or name,

    Should I make a function added to RPC which responds with device name and other relevant data to Polling app ? that way, in my mobile app when user clicks discovery button, the app tries RPC for each ip address in that address range ( ex: to ) and list MOS devices based on the reply received ??

    please guide me to right direction.

Sign In or Register to comment.