-->
Page 1 of 1

Obtaining MQTT broker IP

PostPosted: Thu Jun 18, 2015 5:20 am
by mithun.harikumar
hi,
I'm currently using the esp_open_sdk and running esp_mqtt example. I was able to successfully connect to a MQTT broker by specifying the broker IP beforehand (in user_config) and was able to publish test messages. What should I do to obtain the IP of the broker by connecting to the accesspoint of the broker using just SSiD and Password? So that, I won't have to change the user_config files, everytime the router boots up as it uses DHCP.

Thank you.

Re: Obtaining MQTT broker IP

PostPosted: Fri Jun 26, 2015 2:31 am
by vladbabii
One option would be to use DNS or mDNS, or if the broker is on the same machine as the network gateway provided by dhcp, use that ip to connect.

Re: Obtaining MQTT broker IP

PostPosted: Sun Aug 02, 2015 7:04 am
by dunk
i've been working on this for the last week or two.
my solution is mDNS based and can be found here:
https://github.com/mrdunk/esp8266_mdns

it uses the ESP8622 Arduino environment which might be a deal breaker for you but could be ported to other stacks without too much effort.

there's an example program that lists the ipv4 addresses of all servers advertising the _mqtt._tcp_local service under mDNS.