MQTT Broker connect without IP address

1,638 views
Skip to first unread message

shantanu...@gmail.com

unread,
Aug 23, 2016, 2:47:29 AM8/23/16
to MQTT
Hi,
I have a local broker installed locally.
Currently I am connecting various devices to the MQTT broker using the Broker's IP address (IpV4 local address).

My Q is....is it anyhow possible to make my embedded devices to connect to this Local MQTT Broker WITHOUT the IP address? Because the DHCP will change the Local Host IP address if i move my system into my home from my office. Then the end devices will not be able to connect to the broker. Is it possible?
 Any kind of help is much appreciated. Thank You.

Francis Brosnan Blázquez

unread,
Aug 23, 2016, 3:50:38 AM8/23/16
to mq...@googlegroups.com
Hello,

Make sure you bind your broker to listen to 0.0.0.0:1883 (or the
port you need) and then use 127.0.0.1:1883 to connect from inside.

Because you are binding to 0.0.0.0, your broker will listen to all available
addresses anytime, including the changing IP address (dhcp) but also to
the predictable one 127.0.0.1,

Best Regards,

--
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.

-- 
Francis Brosnan Blázquez  -  ASPL
http://www.asplhosting.com/
http://www.aspl.es/
https://twitter.com/aspl_es
https://twitter.com/asplhosting
https://twitter.com/francisbrosnanb

91 134 14 22 - 91 134 14 45 - 91 116 07 57

AVISO LEGAL
 
En virtud de lo dispuesto en la Ley Orgánica 15/1999, de 13 de
diciembre, de Protección de Datos de Carácter Personal, le informamos de
que sus datos de carácter personal, recogidos de fuentes accesibles al
público o datos que usted nos ha facilitado previamente, proceden de
bases de datos propiedad de Advanced Software Production Line, S.L.
(ASPL).
 
ASPL garantiza que los datos serán tratados con la finalidad de mantener
las oportunas relaciones comerciales o promocionales con usted o la
entidad que usted representa. No obstante, usted puede ejercitar sus
derechos de acceso, rectificación, cancelación y oposición dispuestos en
la mencionada Ley Orgánica, notificándolo por escrito a ASPL -
Protección Datos, C/Antonio Suárez 10 A-102, 28802, Alcalá de Henares
(Madrid).



Paul Fremantle

unread,
Aug 23, 2016, 3:57:56 AM8/23/16
to mq...@googlegroups.com
The general approach for this is to use mDNS to publish the broker's address on the local network. There are mDNS clients for many embedded devices including Arduino and ESP8266.

Paul

--
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+unsubscribe@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.



--
Paul Fremantle
Part-time PhD student - School of Computing
twitter: pzfreo / skype: paulfremantle / blog: http://pzf.fremantle.org
Co-Founder, WSO2
Apache Member and Committer
07740 199 729

shantanu...@gmail.com

unread,
Aug 24, 2016, 12:24:34 AM8/24/16
to MQTT
My broker is installed on a microcontroller which is also an access point. Its like a central hub. Wouldn't my end devices need the IP address of the access point atleast to communicate with the broker installed in it?
My problem is, if i change the entire system (Access Point + Broekr) to another location, the Access Point's IP address will change. Then my same devices wouldn't be able to communicate with it. How do I solve this problem?

Paul Fremantle

unread,
Aug 24, 2016, 1:57:17 AM8/24/16
to mq...@googlegroups.com
What is the hardware for the access point? If its decent enough you can run mDNS on it.

Paul

--
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+unsubscribe@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.

shantanu...@gmail.com

unread,
Aug 24, 2016, 7:14:28 AM8/24/16
to MQTT
I am thinking of using a raspberry pi. But i am still looking for more economical options. Any suggestions?


On Wednesday, 24 August 2016 11:27:17 UTC+5:30, Paul Fremantle wrote:
What is the hardware for the access point? If its decent enough you can run mDNS on it.

Paul
On 24 August 2016 at 05:24, <shantanu...@gmail.com> wrote:
My broker is installed on a microcontroller which is also an access point. Its like a central hub. Wouldn't my end devices need the IP address of the access point atleast to communicate with the broker installed in it?
My problem is, if i change the entire system (Access Point + Broekr) to another location, the Access Point's IP address will change. Then my same devices wouldn't be able to communicate with it. How do I solve this problem?


On Tuesday, 23 August 2016 12:17:29 UTC+5:30, shantanu...@gmail.com wrote:
Hi,
I have a local broker installed locally.
Currently I am connecting various devices to the MQTT broker using the Broker's IP address (IpV4 local address).

My Q is....is it anyhow possible to make my embedded devices to connect to this Local MQTT Broker WITHOUT the IP address? Because the DHCP will change the Local Host IP address if i move my system into my home from my office. Then the end devices will not be able to connect to the broker. Is it possible?
 Any kind of help is much appreciated. Thank You.

--
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.

Paul Fremantle

unread,
Aug 24, 2016, 9:15:01 AM8/24/16
to mq...@googlegroups.com
If you use a Raspberry Pi you can run https://github.com/lathiat/avahi

Paul

To unsubscribe from this group and stop receiving emails from it, send an email to mqtt+unsubscribe@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.
Reply all
Reply to author
Forward
0 new messages