Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By thedroid
#73263 Hi all,

Initially I set the mds.hostname in setup with something like

Code: Select allvoid setup() {
....
if (!MDNS.begin(hostString)) {
    Serial.println("Error setting up MDNS responder!");
  }
 
MDNS.addService("http", "tcp", 80);

...

}


Is it possible / advisable to change the hostname on the fly in the loop just by calling MDNS.begin again?
E.G.

Code: Select all
void loop() {
  ...
  if (_newHostname)
  {
    _newHostname = false;
    if (!MDNS.begin(updatedhostName)) {
      Serial.println("Error setting up MDNS responder!");
    }
 
  }
  ...
}