You are reading a single comment by @indianajones and its replies. Click here to read the full conversation.
  • I tweaked Gordon's example code snippet for flexibility:

    wifi.enableMDNS = function(hostname, serviceType, port, callback) {
        let mdns = "AT+MDNS=1," + JSON.stringify(hostname) + "," + JSON.stringify(serviceType) + "," + JSON.stringify(port) + "\r\n";
        this.at.cmd(mdns, 500, function(d) {
            callback(d);
        });
    };
    

    Now you can specify the service type and port, like this:

    wifi.enableMDNS("esp-livingroom", "iot", 80, function(result) {
        console.log("result is " + result);
    });
    
    
About