Skip to content

Commit 382fa5e

Browse files
[SYS] Fix for build error with MDNS_SD (#2239)
* Fix for build error with MDNS_SD * Update environments.ini
1 parent 226297b commit 382fa5e

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

environments.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ build_flags =
257257
'-DMQTT_USER=""'
258258
'-DMQTT_PASS=""'
259259
'-DMQTT_PORT="1883"'
260+
'-DMDNS_SD=true'
260261
'-DDEEP_SLEEP_IN_US=120000000' ; Deep sleep for a period of time to conserve battery
261262
'-DESP32_EXT0_WAKE_PIN=GPIO_NUM_14' ;Should a water leak be detected immediatly wake the ESP32 and report the problem
262263
'-DESP32_EXT0_WAKE_PIN_STATE=0' ;Should a water leak be detected immediatly wake the ESP32 and report the problem, sensor state to look for wakeup

main/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -936,7 +936,7 @@ std::pair<String, uint16_t> discoverMQTTbroker() {
936936
}
937937
if (n == 1) {
938938
THEENGS_LOG_TRACE(F("One MQTT server found setting parameters" CR));
939-
return {MDNS.IP(0).toString(), uint16_t(MDNS.port(0))};
939+
return {MDNS.hostname(0).c_str(), uint16_t(MDNS.port(0))};
940940
} else {
941941
THEENGS_LOG_WARNING(F("Several MQTT servers found, please deactivate mDNS and set your default server" CR));
942942
}

0 commit comments

Comments
 (0)