Auto Discovery of MQTT Client Paho devices, topics and subscribe

607 views
Skip to first unread message

ashok athukuri

unread,
Jan 14, 2016, 1:34:40 AM1/14/16
to MQTT
Is there any way to auto discover mqtt devices know its capabilities and then subscribe to topics of that device? Not sure its a valid question But I have a working environment with statically subscribed devices. Looking for some kind of auto discovering thing.

Thanks,
Ashok

Dougie Lawson

unread,
Jan 20, 2016, 2:45:40 PM1/20/16
to mq...@googlegroups.com
If you create /etc/avahi/services/mqtt.service

<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
 <name replace-wildcards="yes">MQTT on %h</name>
  <service>
   <type>_mqtt._tcp</type>
   <port>1883</port>
  </service>
</service-group>

Then the Avahi (Bonjour) daemon will announce your MQTT service for auto-configuration.

Regards, Dougie

--
To learn more about MQTT please visit http://mqtt.org
---
You received this message because you are subscribed to the Google Groups "MQTT" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mqtt+uns...@googlegroups.com.
To post to this group, send email to mq...@googlegroups.com.
Visit this group at https://groups.google.com/group/mqtt.
For more options, visit https://groups.google.com/d/optout.



--

shirou

unread,
Jan 22, 2016, 4:10:56 AM1/22/16
to mq...@googlegroups.com
I think auto discovery is not in the MQTT specification, but you can use DNS.

For example, mosquitto client has an -S option to use SRV record to
determine which host to connect to.

If you want to know not only MQTT server hostname but also other
things like topics, you should create your own discovery service.

WAKAYAMA Shirou
Reply all
Reply to author
Forward
0 new messages