The use of the ESP8266 in the world of IoT

User avatar
By mithun.harikumar
#20804 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.
User avatar
By dunk
#24820 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.