# MQTT-In Not Connecting

**URL:** <https://discourse.nodered.org/t/mqtt-in-not-connecting/17325>\
**Category:** General\
**Created:** [30 October 2019 12:24 UTC](https://discourse.nodered.org/t/mqtt-in-not-connecting/17325 "2019-10-30T12:24:17Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [5 November 2019 08:51 UTC](https://discourse.nodered.org/t/mqtt-in-not-connecting/17325/22 "2019-11-05T08:51:46Z")

</div>

You need a broker that the remote Node-RED can connect to.

I’m guessing that the remote Node-RED can not connect to your local broker.

So you need to find one that it can attach to.  
There are several internet MQTT brokers you can use that you should be able to find with an internet search.

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [5 November 2019 10:10 UTC](https://discourse.nodered.org/t/mqtt-in-not-connecting/17325/23 "2019-11-05T10:10:17Z")

</div>

is 176.31.21. the external ip address of the local network your raspberry are on?

---

<div class="post-metadata">

**Author:** ![mirou\_IoT](https://avatars.discourse-cdn.com/v4/letter/m/958977/32.png) [@mirou\_IoT](https://discourse.nodered.org/u/mirou_IoT)\
**Post date:** [5 November 2019 11:01 UTC](https://discourse.nodered.org/t/mqtt-in-not-connecting/17325/24 "2019-11-05T11:01:30Z")

</div>

@cymplecy no the 176.31... is the broker of node red that i have to use to connect node red with raspberry

---

<div class="post-metadata">

**Author:** ![mirou\_IoT](https://avatars.discourse-cdn.com/v4/letter/m/958977/32.png) [@mirou\_IoT](https://discourse.nodered.org/u/mirou_IoT)\
**Post date:** [5 November 2019 11:04 UTC](https://discourse.nodered.org/t/mqtt-in-not-connecting/17325/25 "2019-11-05T11:04:32Z")

</div>

@knolleary i don't have two device in same local network i have just my raspberry in my local network but the node red is in an other place so i should using the mqtt

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [5 November 2019 11:07 UTC](https://discourse.nodered.org/t/mqtt-in-not-connecting/17325/26 "2019-11-05T11:07:08Z")

</div>

You have Node-RED running on a server that has an ip address starting 176.31

You want to send information from your local raspberry via MQTT to Node-RED on this server.

Yes?

---

<div class="post-metadata">

**Author:** ![mirou\_IoT](https://avatars.discourse-cdn.com/v4/letter/m/958977/32.png) [@mirou\_IoT](https://discourse.nodered.org/u/mirou_IoT)\
**Post date:** [5 November 2019 15:14 UTC](https://discourse.nodered.org/t/mqtt-in-not-connecting/17325/27 "2019-11-05T15:14:32Z")

</div>

@cymplecy yes it's right i want to send data from my local raspbery via MQTT to remote node rd on this server 176.31...

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [5 November 2019 15:33 UTC](https://discourse.nodered.org/t/mqtt-in-not-connecting/17325/28 "2019-11-05T15:33:14Z")

</div>

You send the data to a MQTT broker

Your Node-RED server then gets the data from a MQTT broker

You need a broker that both machines can see

---

<div class="post-metadata">

**Author:** ![mirou\_IoT](https://avatars.discourse-cdn.com/v4/letter/m/958977/32.png) [@mirou\_IoT](https://discourse.nodered.org/u/mirou_IoT)\
**Post date:** [5 November 2019 15:36 UTC](https://discourse.nodered.org/t/mqtt-in-not-connecting/17325/29 "2019-11-05T15:36:50Z")

</div>

i use the [mqtt.eclipse.org](http://mqtt.eclipse.org) and i use also the [test.mosquitto.org](http://test.mosquitto.org) it's work but when i want to use the 176.31... my broker, the result is disconnect

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [5 November 2019 15:47 UTC](https://discourse.nodered.org/t/mqtt-in-not-connecting/17325/30 "2019-11-05T15:47:22Z")

</div>

Then either your broker isn’t installed properly or configured properly or your machine sending the data can’t see it properly.

Try looking to see if you can see the data using another MQTT tool. Look to see if there are any errors being sent back to the machine sending the data.

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [5 November 2019 15:56 UTC](https://discourse.nodered.org/t/mqtt-in-not-connecting/17325/31 "2019-11-05T15:56:19Z")

</div>

> [@mirou\_IoT](#):
>
> but when i want to use the 176.31... my broker, the result is disconnect

Have you installed mosquitto on 176.31.. ?

If you have not then try to do so

If you cannot install it - try installing node-red-contrib-mqtt-broker [node-red-contrib-mqtt-broker (node) - Node-RED](http://flows.nodered.org/node/node-red-contrib-mqtt-broker)

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [5 November 2019 16:00 UTC](https://discourse.nodered.org/t/mqtt-in-not-connecting/17325/32 "2019-11-05T16:00:01Z")

</div>

> [@cymplecy](#):
>
> node-red-contrib-mqtt-broker

Does this have appropriate security for a device that is exposed to the internet????

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [5 November 2019 16:09 UTC](https://discourse.nodered.org/t/mqtt-in-not-connecting/17325/33 "2019-11-05T16:09:33Z")

</div>

> [@ukmoose](#):
>
> Does this have appropriate security for a device that is exposed to the internet????

Same level of security as using mosquitto

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [5 November 2019 16:28 UTC](https://discourse.nodered.org/t/mqtt-in-not-connecting/17325/34 "2019-11-05T16:28:20Z")

</div>

Really? [https://github.com/zuhito/node-red-contrib-mqtt-broker/issues/23](https://github.com/zuhito/node-red-contrib-mqtt-broker/issues/23)

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [5 November 2019 16:44 UTC](https://discourse.nodered.org/t/mqtt-in-not-connecting/17325/35 "2019-11-05T16:44:26Z")

</div>

That seems to reference an issue that was subsequently fixed (unless I'm missing something)

But, the OP is really struggling to even get going - I think differences between security of one broker over another one comes later in the conversation

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [5 November 2019 17:08 UTC](https://discourse.nodered.org/t/mqtt-in-not-connecting/17325/36 "2019-11-05T17:08:23Z")

</div>

The published version is 1year 8months old

That issue dates from 3 months ago. Whilst there is a possible fix in a pull request it is not yet merged and published.

Security afterwards is not a sensible solution, it needs to be thought of before you do something not afterwards

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [5 November 2019 17:17 UTC](https://discourse.nodered.org/t/mqtt-in-not-connecting/17325/37 "2019-11-05T17:17:00Z")

</div>

> [@ukmoose](#):
>
> Security afterwards is not a sensible solution,

in this case, it is.

The OP can't speak English well and can''t connect at all at the moment.

If we manage to get them connected, then we can recommend how to secure it 🙂

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [5 November 2019 17:22 UTC](https://discourse.nodered.org/t/mqtt-in-not-connecting/17325/38 "2019-11-05T17:22:55Z")

</div>

> [@mirou\_IoT](#):
>
> i don't have two device in same local network i have just my raspberry in my local network but the node red is in an other place so i should using the mqtt

Hi @mirou_IoT - I'm trying hard to understand exactly what you have got, but I'm still slightly confused.

- you have a raspberry pi on your local network
- "node-red is in another place" - what do you mean? What is it running on? A different device on a different network? Can your local raspberrypi access the network your other device is running on?

If the machine running node-red is not on the public internet then your raspberry pi is not going to be able to connect to it.

As other people have said, you need an MQTT broker somewhere that both your local device and the machine running node-red can access. This is why it works with `mqtt.eclipse.org` - because that is on the public internet.

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [5 November 2019 17:26 UTC](https://discourse.nodered.org/t/mqtt-in-not-connecting/17325/39 "2019-11-05T17:26:34Z")

</div>

> [@knolleary](#):
>
> but I'm still slightly confused.

I think we've got this far with determining their setup

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/8/84d0173b208f80c26c8ffeed01ed910e8b37c327.png)

---

<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:** [5 November 2019 18:05 UTC](https://discourse.nodered.org/t/mqtt-in-not-connecting/17325/40 "2019-11-05T18:05:36Z")

</div>

Check with MQTT Explorer that you can access the broker, then you will know whether it is a problem with access to the broker or with node-red.

> **[MQTT Explorer](http://mqtt-explorer.com/)**
>
> An all-round MQTT client that provides a structured topic overview

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [5 November 2019 18:50 UTC](https://discourse.nodered.org/t/mqtt-in-not-connecting/17325/41 "2019-11-05T18:50:35Z")

</div>

> [@cymplecy](#):
>
> I think we've got this far with determining their setup

Yes, but that doesn't answer my questions about the basic layout of devices and what can see what.

[Previous page](https://discourse.nodered.org/t/mqtt-in-not-connecting/17325.md?page=1)

[Next page](https://discourse.nodered.org/t/mqtt-in-not-connecting/17325.md?page=3)
