# MQTT Dynamic connection with changing IP Adress

**URL:** <https://discourse.nodered.org/t/mqtt-dynamic-connection-with-changing-ip-adress/69299>\
**Category:** General\
**Tags:** mqtt\
**Created:** [20 October 2022 05:38 UTC](https://discourse.nodered.org/t/mqtt-dynamic-connection-with-changing-ip-adress/69299 "2022-10-20T05:38:37Z")\
**Posts on this page:** 8\
**Page:** 2

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [21 October 2022 08:47 UTC](https://discourse.nodered.org/t/mqtt-dynamic-connection-with-changing-ip-adress/69299/21 "2022-10-21T08:47:43Z")

</div>

It's not clear to me if the OP is talking about changes in the internal, local ip address provided by the router or about the router's public IP address provided by the ISP.

> special cloud service to get access from the internet.

> special access from the Internet and the local IP adress is maped by a special cloudservice

---

<div class="post-metadata">

**Author:** ![manfred9999](https://avatars.discourse-cdn.com/v4/letter/m/e9bcb4/32.png) [@manfred9999](https://discourse.nodered.org/u/manfred9999)\
**Post date:** [22 October 2022 07:21 UTC](https://discourse.nodered.org/t/mqtt-dynamic-connection-with-changing-ip-adress/69299/22 "2022-10-22T07:21:00Z")

</div>

Thanks for your replies!

I had another two go on installing a Wifi Hotspot on the raspberry Pi.  
The first installation for all types of rapberry pi disconnected my pi from the jetwork when I enabled the bridge.

The second hotspot included in the Dietpi installation software installed fine. My application server connected and I have no problem even accessing from the internet. But to my disappointment MQTT in Node-red can not connect. I think it is some bridge problem between the hotspot and the fiber modem/wifi

Until now I could not figure out how to solve this problem. There is very little documentation available and I'm not an expert on Rasberry and networking.

Manfred

---

<div class="post-metadata">

**Author:** ![manfred9999](https://avatars.discourse-cdn.com/v4/letter/m/e9bcb4/32.png) [@manfred9999](https://discourse.nodered.org/u/manfred9999)\
**Post date:** [22 October 2022 08:16 UTC](https://discourse.nodered.org/t/mqtt-dynamic-connection-with-changing-ip-adress/69299/23 "2022-10-22T08:16:46Z")

</div>

I think it is runnig now. I only need still to figure out how to configure the DHCP server on the pi to have a reservation for my application server.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [22 October 2022 08:20 UTC](https://discourse.nodered.org/t/mqtt-dynamic-connection-with-changing-ip-adress/69299/24 "2022-10-22T08:20:01Z")

</div>

I don't understand, I thought you were not able to configure the pi, so how were you able to set it up as a hotspot?  
You have not answered the questions in the last few posts clarifying exactly what the problem is.

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [22 October 2022 08:41 UTC](https://discourse.nodered.org/t/mqtt-dynamic-connection-with-changing-ip-adress/69299/25 "2022-10-22T08:41:14Z")

</div>

I was having some difficulty understanding your setup.  
Now you have told us that you are running dietpi and a hotspot on your Raspberry Pi, I'm totally confused.

But you asked about reserved addresses and I will try and respond.

What DHCP server do you have running on your Pi?  
What is this "application server"? Where is it and how does it connect to your network?  
Have you turned off the DHCP server in your router?  
How does the Pi connect to the router?  
We seem to have drifted away from Node-red.  
Have you tried asking in Dietpi or Raspberry Pi forums?

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [22 October 2022 08:49 UTC](https://discourse.nodered.org/t/mqtt-dynamic-connection-with-changing-ip-adress/69299/26 "2022-10-22T08:49:13Z")

</div>

> I was having some difficulty understanding your setup.

perhaps OP should make a little drawing, where what is running with what type of connectivity, will clear things up.

---

<div class="post-metadata">

**Author:** ![manfred9999](https://avatars.discourse-cdn.com/v4/letter/m/e9bcb4/32.png) [@manfred9999](https://discourse.nodered.org/u/manfred9999)\
**Post date:** [22 October 2022 21:58 UTC](https://discourse.nodered.org/t/mqtt-dynamic-connection-with-changing-ip-adress/69299/27 "2022-10-22T21:58:30Z")

</div>

I could manage to install the wifi hotspot on the same PI as node-red is running. After I connected the app server to this wifi. Node-red can now connect to MQTT on that app PI.

I try to find information how to configure the DHCP configuation file to ensure the app pi receives always the same IP address. Make a reservation or no expiration of the leases since MQTT subscribers might be the only device connecting to that wifi imfinit leases time would also be ok.

Thanks for helping!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [21 December 2022 21:58 UTC](https://discourse.nodered.org/t/mqtt-dynamic-connection-with-changing-ip-adress/69299/28 "2022-12-21T21:58:55Z")

</div>

Closed on 21 December 2022 21:58 UTC

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.

[Previous page](https://discourse.nodered.org/t/mqtt-dynamic-connection-with-changing-ip-adress/69299.md?page=1)
