diff --git a/WifiESP32.cpp b/WifiESP32.cpp index ef02d8d..9a74138 100644 --- a/WifiESP32.cpp +++ b/WifiESP32.cpp @@ -20,6 +20,7 @@ #if defined(ARDUINO_ARCH_ESP32) #include #include "defines.h" +#include "ESPmDNS.h" #include #include "esp_wifi.h" #include "WifiESP32.h" @@ -209,6 +210,15 @@ bool WifiESP::setup(const char *SSid, // no idea to go on return false; } + + // Now Wifi is up, register the mDNS service + if(!MDNS.begin(hostname)) { + DIAG(F("Wifi setup failed to start mDNS")); + } + if(!MDNS.addService("withrottle", "tcp", 2560)) { + DIAG(F("Wifi setup failed to add withrottle service to mDNS")); + } + server = new WiFiServer(port); // start listening on tcp port server->begin(); // server started here diff --git a/platformio.ini b/platformio.ini index 3091d7f..1a87770 100644 --- a/platformio.ini +++ b/platformio.ini @@ -173,6 +173,8 @@ board = esp32dev framework = arduino lib_deps = ${env.lib_deps} build_flags = -std=c++17 +monitor_speed = 115200 +monitor_echo = yes [env:Nucleo-F411RE] platform = ststm32 diff --git a/version.h b/version.h index cfad079..9fd3001 100644 --- a/version.h +++ b/version.h @@ -4,7 +4,8 @@ #include "StringFormatter.h" -#define VERSION "4.2.59" +#define VERSION "4.2.60" +// 4.2.60 - Add mDNS capability to ESP32 for autodiscovery // 4.2.59 - Fix: AP SSID was DCC_ instead of DCCEX_ // 4.2.58 - Start motordriver as soon as possible but without waveform // 4.2.57 - New overload handling (faster and handles commonFaultPin again)