From bbd569cc88b487392b80758282cd6dd203edab52 Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Tue, 4 Jan 2022 19:47:57 +0100 Subject: [PATCH] add mDNS --- WifiInterface.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/WifiInterface.cpp b/WifiInterface.cpp index bd7b7f2..5db6934 100644 --- a/WifiInterface.cpp +++ b/WifiInterface.cpp @@ -277,10 +277,16 @@ wifiSerialState WifiInterface::setup2(const FSH* SSid, const FSH* password, StringFormatter::send(wifiStream, F("AT+CIPSERVER=0\r\n")); // turn off tcp server (to clean connections before CIPMUX=1) checkForOK(1000, true); // ignore result in case it already was off - + StringFormatter::send(wifiStream, F("AT+CIPMUX=1\r\n")); // configure for multiple connections if (!checkForOK(1000, true)) return WIFI_DISCONNECTED; + if(!oldCmd) { // no idea to test this on old firmware + StringFormatter::send(wifiStream, F("AT+MDNS=1,\"%S\",\"withrottle\",%d\r\n"), + hostname, port); // mDNS responder + checkForOK(1000, true); // dont care if not supported + } + StringFormatter::send(wifiStream, F("AT+CIPSERVER=1,%d\r\n"), port); // turn on server on port if (!checkForOK(1000, true)) return WIFI_DISCONNECTED; #endif //DONT_TOUCH_WIFI_CONF