Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add MDNS enable in Web UI #22602

Closed
wants to merge 5 commits into from

Conversation

cristiklein
Copy link

Description:

This allows the awesome MDNS advertise feature to be easier to discover and enable for novice users. See screenshot below.

image

May I use the space in this PR to express the awesomeness of this project. I'm not a stranger to embedded development, but have never worked with PlatformIO or Tasmota before. Few hours later, I can build my own firmware and contribute to this project. Kudos!

Related issue (if applicable): fixes #

Note to review: I didn't find guidance on how to perform testing against Tasmota core ESP8266 V.2.7.8 and Tasmota core ESP32 V.3.1.0.241206. Please provide me with guidance and I'll perform the tests.

Checklist:

  • The pull request is done against the latest development branch
  • Only relevant files were touched
  • Only one feature/fix was added per PR and the code change compiles without warnings
  • The code change is tested and works with Tasmota core ESP8266 V.2.7.8
  • The code change is tested and works with Tasmota core ESP32 V.3.1.0.241206
  • I accept the CLA.

NOTE: The code change must pass CI tests. Your PR cannot be merged unless tests pass

This allows the awesome MDNS advertise feature to be easier to discover
and enable for novice users.
Copy link
Collaborator

@s-hadinger s-hadinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks but your PR is broken on multiple levels: missing languages and guarding with USE_DISCOVERY.

Overall MDNS is a feature that brings most problems than it solves, I'm not sure we want to surface it in the GUI. As it is only for advanced users that know what they are doing, I recommend not to add it.

@@ -350,6 +350,7 @@
#define D_MQTT_TLS_ENABLE "MQTT TLS"
#define D_HTTP_API "HTTP API"
#define D_HTTP_API_ENABLE "HTTP API enable"
#define D_MDNS_ENABLE "MDNS enable"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The define must be done in every language file, not just English

@@ -351,6 +351,7 @@ const char HTTP_FORM_OTHER[] PROGMEM =
"<br>"
"<label><input id='b3' type='checkbox'%s><b>" D_HTTP_API_ENABLE "</b></label><br>"
"<label><input id='b1' type='checkbox'%s><b>" D_MQTT_ENABLE "</b></label><br>"
"<label><input id='b4' type='checkbox'%s><b>" D_MDNS_ENABLE "</b></label><br>"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This must be guarded by #ifdef USE_DISCOVERY to not show it when MDNS is not present in the build

@@ -2653,6 +2654,7 @@ void HandleOtherConfiguration(void) {
WSContentSend_P(HTTP_FORM_OTHER, HtmlEscape(ResponseData()).c_str(), (USER_MODULE == Settings->module) ? PSTR(" checked disabled") : "",
(Settings->flag5.disable_referer_chk) ? PSTR(" checked") : "", // SetOption128 - Enable HTTP API
(Settings->flag.mqtt_enabled) ? PSTR(" checked") : "", // SetOption3 - Enable MQTT
(Settings->flag3.mdns_enabled) ? PSTR(" checked") : "", // SetOption55 - Enable MDNS
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guard with #ifdef USE_DISCOVERY

@@ -2706,6 +2708,8 @@ void OtherSaveSettings(void) {
cmnd += Webserver->hasArg(F("b1"));
cmnd += F(";" D_CMND_SO "128 ");
cmnd += Webserver->hasArg(F("b3"));
cmnd += F(";" D_CMND_SO "55 ");
cmnd += Webserver->hasArg(F("b4"));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guard with #ifdef USE_DISCOVERY

@Jason2866
Copy link
Collaborator

Jason2866 commented Dec 7, 2024

There is no mDNS support in the esp8266 precompiled builds and there will be never (horrible faulty and eats up to much flash).
mDNS is only activated in esp32 builds where Matter is active (Matter needs parts of mDNS services)
And mDNS is everything than great it is by design a mess!

From my side a clear no to add in GUI

@arendst
Copy link
Owner

arendst commented Dec 7, 2024

Thx for your work.

As you noticed we hate mDNS as it uses way to much code space and except for Matter it isn't really needed once you've managed to install a simple DNS server in your home environment.

@arendst arendst closed this Dec 7, 2024
@cristiklein
Copy link
Author

I agree. Thanks folks for taking the time to look at my PR and give me feedback. It was good practice for me and I hope I'll come with a more useful PR next time. (Although, to be honest, the project feels rather finished, so I'm unsure what that could be.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants