# MQTT Node connections

**URL:** <https://discourse.nodered.org/t/mqtt-node-connections/6819>\
**Category:** General\
**Created:** [15 January 2019 04:15 UTC](https://discourse.nodered.org/t/mqtt-node-connections/6819 "2019-01-15T04:15:41Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![manal](https://avatars.discourse-cdn.com/v4/letter/m/54ee81/32.png) [@manal](https://discourse.nodered.org/u/manal)\
**Post date:** [15 January 2019 04:15 UTC](https://discourse.nodered.org/t/mqtt-node-connections/6819/1 "2019-01-15T04:15:42Z")

</div>

Hi ,

I am using MQTT node to publish and subscribe on different topics (all the same flow) to mosquitto broker.  
everything work very well, I can send command to the node-red in raspberry pi3 and publish data from sensor to the broker.  
but I monitor the traffic in wireshark, I have found that MQTT publish and subscriber in the same TCP Channel, when I checked the conversation statistic in wireshark it is only one connection with two way, that means, it has only the following two connections:  
raspberry pi IP to Mosquitto IP  
mosquitto IP to raspberry pi

only these two, and the packet counts and size are increasing all the time.

my question, can we make mqtt over multiple TCP connections?

---

<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:** [15 January 2019 07:19 UTC](https://discourse.nodered.org/t/mqtt-node-connections/6819/2 "2019-01-15T07:19:26Z")

</div>

Hi @manal

In the MQTT nodes there is the drop-down list of brokers you pick from. They represent the individual connections the nodes will make. So if two nodes use the same broker from the list, they will share a connection.

If you want two nodes to use different connections, you can add additional brokers to the drop-down - even if they ultimately point at the same physical broker.

---

<div class="post-metadata">

**Author:** ![manal](https://avatars.discourse-cdn.com/v4/letter/m/54ee81/32.png) [@manal](https://discourse.nodered.org/u/manal)\
**Post date:** [16 January 2019 03:21 UTC](https://discourse.nodered.org/t/mqtt-node-connections/6819/3 "2019-01-16T03:21:37Z")

</div>

> [@knolleary](#):
>
> In the MQTT nodes there is the drop-down list of brokers you pick from. They represent the individual connections the nodes will make. So if two nodes use the same broker from the list, they will share a connection.
> 
> If you want two nodes to use different connections, you can add additional brokers to the drop-down - even if they ultimately point at the same physical broker.

Thanks a lot  
it is working

---

<div class="post-metadata">

**Author:** ![aaroneden](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/aaroneden/32/67486_2.png) [@aaroneden](https://discourse.nodered.org/u/aaroneden)\
**Post date:** [7 September 2022 22:31 UTC](https://discourse.nodered.org/t/mqtt-node-connections/6819/4 "2022-09-07T22:31:55Z")

</div>

I appear to be having a similar issue... I've added 2 MQTT broker configurations. When I added the 2nd config, my 1st one stopped working. I've confirmed that each of the broker nodes is correctly pointing to the right broker config.

Config:  
#1 -- points to TeslaMate mosquito  
#2 --- points to a publicly accessible Mosquito broker I setup

#1 used to work, but now that I added #2 it only shows "connecting" status....

Any suggestions would be welcome!

![Screen Shot 2022-09-07 at 3.25.50 PM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/7/17f736e4c8a28d0263f6a8f9ccc6556ed56d7024.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:** [8 September 2022 06:18 UTC](https://discourse.nodered.org/t/mqtt-node-connections/6819/5 "2022-09-08T06:18:26Z")

</div>

Welcome to the forum @aaroneden

Please select one mqtt In node using each broker and export them and post the flow here.

---

<div class="post-metadata">

**Author:** ![aaroneden](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/aaroneden/32/67486_2.png) [@aaroneden](https://discourse.nodered.org/u/aaroneden)\
**Post date:** [8 September 2022 14:21 UTC](https://discourse.nodered.org/t/mqtt-node-connections/6819/6 "2022-09-08T14:21:59Z")

</div>

```auto
[
    {
        "id": "0abdf0de8c2a622b",
        "type": "tab",
        "label": "Flow 1",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "dc7293be156e9cae",
        "type": "mqtt in",
        "z": "0abdf0de8c2a622b",
        "name": "",
        "topic": "teslamate/cars/1/#",
        "qos": "2",
        "datatype": "auto-detect",
        "broker": "eeb70a28ff34f022",
        "nl": false,
        "rap": true,
        "rh": 0,
        "inputs": 0,
        "x": 190,
        "y": 100,
        "wires": [
            [
                "82b319ae6d932ada"
            ]
        ]
    },
    {
        "id": "82b319ae6d932ada",
        "type": "debug",
        "z": "0abdf0de8c2a622b",
        "name": "debug 5",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 400,
        "y": 100,
        "wires": []
    },
    {
        "id": "3ade092fcf693249",
        "type": "mqtt in",
        "z": "0abdf0de8c2a622b",
        "name": "Devices",
        "topic": "devices/#",
        "qos": "2",
        "datatype": "auto-detect",
        "broker": "994221fef28b4b49",
        "nl": false,
        "rap": true,
        "rh": 0,
        "inputs": 0,
        "x": 170,
        "y": 200,
        "wires": [
            [
                "6d2a6311b0cd865f"
            ]
        ]
    },
    {
        "id": "6d2a6311b0cd865f",
        "type": "debug",
        "z": "0abdf0de8c2a622b",
        "name": "debug 6",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 360,
        "y": 200,
        "wires": []
    },
    {
        "id": "eeb70a28ff34f022",
        "type": "mqtt-broker",
        "name": "mosquitto",
        "broker": "docker_mosquitto_1",
        "port": "1883",
        "clientid": "NodeRed",
        "autoConnect": true,
        "usetls": false,
        "protocolVersion": "4",
        "keepalive": "60",
        "cleansession": true,
        "birthTopic": "",
        "birthQos": "0",
        "birthPayload": "",
        "birthMsg": {},
        "closeTopic": "",
        "closeQos": "0",
        "closePayload": "",
        "closeMsg": {},
        "willTopic": "",
        "willQos": "0",
        "willPayload": "",
        "willMsg": {},
        "userProps": "",
        "sessionExpiry": ""
    },
    {
        "id": "994221fef28b4b49",
        "type": "mqtt-broker",
        "name": "Mosquitto-public",
        "broker": "192.168.86.106",
        "port": "41883",
        "clientid": "NodeRed",
        "autoConnect": true,
        "usetls": false,
        "protocolVersion": "4",
        "keepalive": "60",
        "cleansession": true,
        "birthTopic": "",
        "birthQos": "0",
        "birthPayload": "",
        "birthMsg": {},
        "closeTopic": "",
        "closeQos": "0",
        "closePayload": "",
        "closeMsg": {},
        "willTopic": "",
        "willQos": "0",
        "willPayload": "",
        "willMsg": {},
        "userProps": "",
        "sessionExpiry": ""
    }
]

```

---

<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:** [8 September 2022 14:51 UTC](https://discourse.nodered.org/t/mqtt-node-connections/6819/7 "2022-09-08T14:51:37Z")

</div>

Are you now in the state that the public one (which is on 192.168.86.106 port 41883) is working ok, but the original one, which I guess is a docker install, running on port 1883 is not?

Is that two separate installs of Mosquitto or two routes to the same broker?

Have you tried rebooting everything (the machines running the servers and the machines running node-red)?

Install MQTTExplorer and see if you can connect from that. If you can then you know that it is not a broker issue.
