From a9a980ab103a5dd1348621994518e8b346347255 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xose=20P=C3=A9rez?= Date: Wed, 6 Sep 2017 00:01:26 +0200 Subject: [PATCH] Add espurna-specific texts to MDNS register --- code/espurna/config/general.h | 3 ++- code/espurna/ota.ino | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/code/espurna/config/general.h b/code/espurna/config/general.h index 03cebcdc..e13234b1 100644 --- a/code/espurna/config/general.h +++ b/code/espurna/config/general.h @@ -8,6 +8,7 @@ //------------------------------------------------------------------------------ #define ADMIN_PASS "fibonacci" // Default password (WEB, OTA, WIFI) +#define DEVICE_NAME MANUFACTURER "_" DEVICE // Concatenate both to get a unique device name //------------------------------------------------------------------------------ // TELNET @@ -321,7 +322,7 @@ PROGMEM const char* const custom_reset_string[] = { // ----------------------------------------------------------------------------- #ifndef MDNS_SUPPORT -#define MDNS_SUPPORT 1 // Enable MDNS by default +#define MDNS_SUPPORT 1 // Publish services using mDNS by default #endif // ----------------------------------------------------------------------------- diff --git a/code/espurna/ota.ino b/code/espurna/ota.ino index c5a307dd..6f649ad3 100644 --- a/code/espurna/ota.ino +++ b/code/espurna/ota.ino @@ -55,6 +55,11 @@ void otaSetup() { ArduinoOTA.begin(); + // Public ESPurna related txt for OTA discovery + MDNS.addServiceTxt("arduino", "tcp", "firmware", APP_NAME); + MDNS.addServiceTxt("arduino", "tcp", "espurna_version", APP_VERSION); + MDNS.addServiceTxt("arduino", "tcp", "espurna_board", DEVICE_NAME); + } void otaLoop() {