# Could not connect to MQTT broker hosted on OVH

**URL:** https://discourse.nodered.org/t/could-not-connect-to-mqtt-broker-hosted-on-ovh/77533
**Category:** General
**Tags:** mqtt
**Created:** [13 April 2023 13:56 UTC](https://discourse.nodered.org/t/could-not-connect-to-mqtt-broker-hosted-on-ovh/77533 "2023-04-13T13:56:34Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![moussa869](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/moussa869/32/78823_2.png) [@moussa869](https://discourse.nodered.org/u/moussa869)
#### Post date: [13 April 2023 13:56 UTC](https://discourse.nodered.org/t/could-not-connect-to-mqtt-broker-hosted-on-ovh/77533/1 "2023-04-13T13:56:34Z")

</div>

Hi, please I could not connect to my broker with node red even that i tried it with MQTT spy and it woks normally could pub and sub data but with node red i get not connected i could not do anything without reaching the broker ?? please help me

---

<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: [13 April 2023 14:13 UTC](https://discourse.nodered.org/t/could-not-connect-to-mqtt-broker-hosted-on-ovh/77533/2 "2023-04-13T14:13:32Z")

</div>

Welcome to the forum @moussa869

> [@moussa869](#):
>
> i tried it with MQTT spy and it woks normally

Is that running on the same machine as node red is?

Tell us how you configured mqtt spy.

What OS/hardware are you running node-red on?

How did you install node-red?

Click on one of the MQTT In nodes you are using to test it and Export that node (Ctrl-E) and paste it here. When pasting use the `</>` button in the forum entry window.

What is the status showing under the MQTT node?

What is OVH?

---

<div class="post-metadata">

### Author: ![moussa869](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/moussa869/32/78823_2.png) [@moussa869](https://discourse.nodered.org/u/moussa869)
#### Post date: [13 April 2023 14:27 UTC](https://discourse.nodered.org/t/could-not-connect-to-mqtt-broker-hosted-on-ovh/77533/3 "2023-04-13T14:27:02Z")

</div>

node red is running in my computer  
i just put server URI client ID a user name and password and some topics i use to communicate with the broker hosted in OVH (cloud ) in MQTT spy but whene am in nod red dosnt work  
am running node red in windows with laptop i mad some exemple privied in the documentation it works (CSV URI)

```auto
[
    {
        "id": "bf2454555afc5dc2",
        "type": "mqtt out",
        "z": "d741bddf9f6c9c2f",
        "name": "",
        "topic": "",
        "qos": "",
        "retain": "",
        "respTopic": "",
        "contentType": "",
        "userProps": "",
        "correl": "",
        "expiry": "",
        "broker": "dac71d767023fc83",
        "x": 370,
        "y": 320,
        "wires": []
    },
    {
        "id": "dac71d767023fc83",
        "type": "mqtt-broker",
        "name": "",
        "broker": "51.210.241.46",
        "port": "1883",
        "clientid": "HUTCHINSON",
        "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": ""
    }
]

```

Admin edit, corrected the flow format. You did not use the `</>` button

---

<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: [13 April 2023 14:46 UTC](https://discourse.nodered.org/t/could-not-connect-to-mqtt-broker-hosted-on-ovh/77533/4 "2023-04-13T14:46:40Z")

</div>

Did you put the user and password in node-red?

Please try and answer all the questions asked

> [@Colin](#):
>
> How did you install node-red?

> [@Colin](#):
>
> What is the status showing under the MQTT node?

---

<div class="post-metadata">

### Author: ![moussa869](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/moussa869/32/78823_2.png) [@moussa869](https://discourse.nodered.org/u/moussa869)
#### Post date: [13 April 2023 14:50 UTC](https://discourse.nodered.org/t/could-not-connect-to-mqtt-broker-hosted-on-ovh/77533/5 "2023-04-13T14:50:02Z")

</div>

yes i put the user and password in node-red  
i install it normaly with the cmd and all the commande lines after installing Node.js  
the status under MQTT node is desconected

---

<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: [13 April 2023 14:58 UTC](https://discourse.nodered.org/t/could-not-connect-to-mqtt-broker-hosted-on-ovh/77533/6 "2023-04-13T14:58:28Z")

</div>

> [@moussa869](#):
>
> the status under MQTT node is desconected

Can you show us a screenshot of that?

Please stop node-red then start it again in a command window and copy/paste the full output here. This is the `</>` button you should use when pasting code, logs etc  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/9/897e24496e4509fca7bc87af42a4631d76f8db90.png)

---

<div class="post-metadata">

### Author: ![moussa869](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/moussa869/32/78823_2.png) [@moussa869](https://discourse.nodered.org/u/moussa869)
#### Post date: [17 April 2023 11:35 UTC](https://discourse.nodered.org/t/could-not-connect-to-mqtt-broker-hosted-on-ovh/77533/7 "2023-04-17T11:35:44Z")

</div>

In fact the node connect and disconnected with strange way i dont understant it

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/8/b8197ccd385d9b3f684c36d634a94260976eba03.png)

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [17 April 2023 11:40 UTC](https://discourse.nodered.org/t/could-not-connect-to-mqtt-broker-hosted-on-ovh/77533/8 "2023-04-17T11:40:30Z")

</div>

Looks like you have reused "HUTCHINSON" as the client ID in another MQTT client.

Try changing this to **HUTCHINSON2**. Does it still disconnect/connect over and over?

Failing that, you might have a bad topic or option set. So if the above doesn't work, tell us what broker type& version this is connecting to and show us how you have setup the client (broker config) properties in node-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: [16 June 2023 11:40 UTC](https://discourse.nodered.org/t/could-not-connect-to-mqtt-broker-hosted-on-ovh/77533/9 "2023-06-16T11:40:34Z")

</div>

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