We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 24f2306 commit 07e303bCopy full SHA for 07e303b
wled00/mqtt.cpp
@@ -215,7 +215,9 @@ bool initMqtt()
215
} else {
216
#ifdef ARDUINO_ARCH_ESP32
217
String mqttMDNS = mqttServer;
218
- mqttMDNS.replace(F(".local"), ""); // remove .local if present
+ mqttMDNS.toLowerCase(); // make sure we have a lowercase hostname
219
+ int pos = mqttMDNS.indexOf(F(".local"));
220
+ if (pos > 0) mqttMDNS.remove(pos); // remove .local domain if present (and anything following it)
221
if (strlen(cmDNS) > 0 && mqttMDNS.length() > 0 && mqttMDNS.indexOf('.') < 0) { // if mDNS is enabled and server does not have domain
222
mqttIP = MDNS.queryHost(mqttMDNS.c_str());
223
if (mqttIP != IPAddress()) // if MDNS resolved the hostname
0 commit comments