# Mqtt client connection to a remote mosquitto broker

**URL:** <https://discourse.nodered.org/t/mqtt-client-connection-to-a-remote-mosquitto-broker/22494>\
**Category:** General\
**Created:** [2 March 2020 11:37 UTC](https://discourse.nodered.org/t/mqtt-client-connection-to-a-remote-mosquitto-broker/22494 "2020-03-02T11:37:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![saeed1](https://avatars.discourse-cdn.com/v4/letter/s/838e76/32.png) [@saeed1](https://discourse.nodered.org/u/saeed1)\
**Post date:** [2 March 2020 11:37 UTC](https://discourse.nodered.org/t/mqtt-client-connection-to-a-remote-mosquitto-broker/22494/1 "2020-03-02T11:37:15Z")

</div>

Hi,  
I want to send my temperature sensor data on a remote sensor. Node Red , mosquitto broker has been installed already.  
I am accessing my remote Server by using vpn. My mqtt Client is connected to my home Network.

Remote Server IP : 138.246.234.68  
mqtt Client IP: 10.154.241.2

I am trying to send data from Client to remote Server but no way. Need your help.

Thank you.

---

<div class="post-metadata">

**Author:** ![unixneo](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/unixneo/32/17441_2.png) [@unixneo](https://discourse.nodered.org/u/unixneo)\
**Post date:** [2 March 2020 12:11 UTC](https://discourse.nodered.org/t/mqtt-client-connection-to-a-remote-mosquitto-broker/22494/2 "2020-03-02T12:11:22Z")

</div>

It's probably best to provide more detailed information.

You say:

> Node Red , mosquitto broker has been installed already.

Installed on what?

You say:

> My mqtt Client is connected to my home Network

Connected how?

You conclude:

> I am trying to send data from Client to remote Server but no way. Need your help.

MQTT is a publish and subscribe paradigm. Your client (whatever it is) needs to get that sensor data to an MQTT client with a topic and maybe some security credentials for your MQTT broker.

Your MQTT broker is using a userid and password (basic authentication) or open?

Details matter, unfortunately.

You have posted, but have not provided many details, to be honest.

---

<div class="post-metadata">

**Author:** ![saeed1](https://avatars.discourse-cdn.com/v4/letter/s/838e76/32.png) [@saeed1](https://discourse.nodered.org/u/saeed1)\
**Post date:** [2 March 2020 12:20 UTC](https://discourse.nodered.org/t/mqtt-client-connection-to-a-remote-mosquitto-broker/22494/3 "2020-03-02T12:20:19Z")

</div>

Case 1:  
i was sending a senosr data from mqtt Client (Arduino+ethernetshield+dht11) to mqtt Broker(PC). In this case my mqtt Client and mqtt broker (PC) were connected to my home router. It worked fine.

Case 2:  
Now my mqtt broker is not on my PC. It is installed on a remote Server. It means now my mqtt Client and mqtt broker are not connected to same Network.  
How can i send data now?  
Note: 1883 port on remote Server is open

---

<div class="post-metadata">

**Author:** ![unixneo](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/unixneo/32/17441_2.png) [@unixneo](https://discourse.nodered.org/u/unixneo)\
**Post date:** [2 March 2020 12:23 UTC](https://discourse.nodered.org/t/mqtt-client-connection-to-a-remote-mosquitto-broker/22494/4 "2020-03-02T12:23:15Z")

</div>

You simply send the data to the remote MQTT broker.

You avoided all details about the remote MQTT server. Does it require a username and a password, etc.

Can you pub/sub to it using an MQTT tool locally or on your mobile?

Details matter. Sorry to keep repeating this.

When you / we have the details, the solution will be easy (generally speaking).

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [3 March 2020 18:24 UTC](https://discourse.nodered.org/t/mqtt-client-connection-to-a-remote-mosquitto-broker/22494/5 "2020-03-03T18:24:18Z")

</div>

A number of my IoT students make use of (the FREE plan with) BeeBotte for their remote MQTT broker.

```
https://beebotte.com/

```

It's very easy to set up and works really well with Nod-RED.

---

<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:** [2 May 2020 18:24 UTC](https://discourse.nodered.org/t/mqtt-client-connection-to-a-remote-mosquitto-broker/22494/6 "2020-05-02T18:24:24Z")

</div>

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