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

MQTT broker config unable to resolve .local hostnames #129

Closed
xoseperez opened this issue Apr 18, 2017 · 7 comments
Closed

MQTT broker config unable to resolve .local hostnames #129

xoseperez opened this issue Apr 18, 2017 · 7 comments

Comments

@xoseperez
Copy link
Owner

Originally reported by: Brian Anderson (Bitbucket: bhaonvashon, GitHub: bhaonvashon)


When attempting to configure a MQTT broker, I used the 'hostname.local' format to specify the broker address on my local network. This did not work. Using the IP address for the broker did work.

@xoseperez
Copy link
Owner Author

Does the hostname.local format work from your other devices? This normally requires bonjour or avahi to work.

@xoseperez
Copy link
Owner Author

Original comment by Brian Anderson (Bitbucket: bhaonvashon, GitHub: bhaonvashon):


Yes it does. Obviously works from a MAC, but also I have a bunch of Beaglebone Blacks with avahi-utils installed in order to support hostname discovery and avahi-daemon installed to support hostname advertisement. My Linux Mint box also has the proper support for this.

Looks like you have implemented (or indirectly from a library) hostname and website advertisement. They appear just fine in my MAC Bonjour browser.

I guess this would be an enhancement rather than a bug. Maybe better title would be something like "Add local hostname discovery" as this isn't really directly related to MQTT...I assume unless its part of the MQTT client library. It took me awhile to figure out why I wasn't getting a MQTT broker connection as I (incorrectly) assumed that hostname.local would just work.

Whilst poking around, I came across Discover OTA-able esp8266/Arduino modules which might make a nice enhancement someday...PlatformIO automagic discovery of OTA updatable devices. Doesn't look like its made it into PlatformIO 3 yet as the issue is still open. It was on the Milestone 3 list, just didn't make it.

@xoseperez
Copy link
Owner Author

There is an issue in the Arduino Core for ESP8266 repo about this: esp8266/Arduino#2373. It looks like it will at some point be supported.
In the meantime one of the users has created a library for this: https://github.com/madpilot/mDNSResolver. I guess that would do.

@xoseperez
Copy link
Owner Author

Original comment by Chris (Bitbucket: chrishiscox, GitHub: chrishiscox):


I have the same issue on espurna where both ntp and mqtt hostnames are not resolved. I dont have same issue with Tasmota. I prefer your build as it suits the way I work, but without dns rsolving I cannot deploy to others. Any chance of a fix soon?

@xoseperez
Copy link
Owner Author

The version in the dev branch supports mDNS resolve using the mDNSResolver library by Myles Eftos (https://github.com/madpilot/mDNSResolver). This adds a bit of overhead (~3Kb) to the binary size and ~1K to the memory usage... so it is disabled by default. You can enable it setting MDNS_CLIENT_SUPPORT to 1 (you can use your own custom.h file for that).
It will be released with next version.

@xoseperez
Copy link
Owner Author

Released with 1.12.0

@xoseperez
Copy link
Owner Author

Removing milestone: 1.12.0 (automated comment)

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

No branches or pull requests

1 participant