# Can't connect websocket (disconnected)

**URL:** https://discourse.nodered.org/t/cant-connect-websocket-disconnected/37590
**Category:** General
**Created:** [16 December 2020 20:09 UTC](https://discourse.nodered.org/t/cant-connect-websocket-disconnected/37590 "2020-12-16T20:09:00Z")
**Posts on this page:** 17
**Page:** 1

<div class="post-metadata">

### Author: ![MrWolff](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mrwolff/32/30557_2.png) [@MrWolff](https://discourse.nodered.org/u/MrWolff)
#### Post date: [16 December 2020 20:09 UTC](https://discourse.nodered.org/t/cant-connect-websocket-disconnected/37590/1 "2020-12-16T20:09:00Z")

</div>

Hi everyone,

I have a problem to connect the websocket node. When is use the default adress (127.0.0.1.8080) the websocket still gets disconnected.

When I search for the "node-red-contrib-websocket" I don't found it on the pallete at the "nodes tab".  
At the "install tap" I found "node-red-contrib-websocket" and is says that it has a conflict.

When I start node-red in the LXTerminal I get the message:  
Unable to listen on [http://127.0.0.1:1880/](http://127.0.0.1:1880/)  
Port in use.

I also use ip 127.0.0.1:8086 for InfluxDB and it works properly!

Can anyone help me to fix this problem on using the websocket?

---

<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: [16 December 2020 20:45 UTC](https://discourse.nodered.org/t/cant-connect-websocket-disconnected/37590/2 "2020-12-16T20:45:40Z")

</div>

> [@MrWolff](#):
>
> Unable to listen on [http://127.0.0.1:1880/](http://127.0.0.1:1880/)  
> Port in use.

The usual reason for that is that node red is already running, and you are trying to start another one. Have you got it set to run on boot for example?

---

<div class="post-metadata">

### Author: ![MrWolff](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mrwolff/32/30557_2.png) [@MrWolff](https://discourse.nodered.org/u/MrWolff)
#### Post date: [16 December 2020 20:56 UTC](https://discourse.nodered.org/t/cant-connect-websocket-disconnected/37590/3 "2020-12-16T20:56:08Z")

</div>

Hello Colin,

Yes I start Node-Red automatically at boot.  
Why is that a problem?  
And what can I do to solve the problem?

---

<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: [16 December 2020 21:19 UTC](https://discourse.nodered.org/t/cant-connect-websocket-disconnected/37590/4 "2020-12-16T21:19:52Z")

</div>

If you want to start it in a terminal then you must first stop the node-red that was started on boot.

---

<div class="post-metadata">

### Author: ![MrWolff](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mrwolff/32/30557_2.png) [@MrWolff](https://discourse.nodered.org/u/MrWolff)
#### Post date: [17 December 2020 19:28 UTC](https://discourse.nodered.org/t/cant-connect-websocket-disconnected/37590/5 "2020-12-17T19:28:44Z")

</div>

Okay, I get it.  
Node-Red is starting at boot, so I don't have to start it again.

But the questions are is:  
-Why says the websocket it is disconnected (on adress 127.0.0.1.8080)

-And when I search for the "node-red-contrib-websocket" I don't found it on the pallete at the "nodes tab".  
When is search at the "install tap" I found "node-red-contrib-websocket" and is says that it has a conflict. How can I find out witch conflict?

---

<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 December 2020 20:21 UTC](https://discourse.nodered.org/t/cant-connect-websocket-disconnected/37590/6 "2020-12-17T20:21:42Z")

</div>

> [@MrWolff](#):
>
> I found "node-red-contrib-websocket" and is says that it has a conflict. How can I find out witch conflict?

It probably confilcts with built in websockets  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/6/c693098ca6494d2638c0debc8f76d19aabd673ad.png)

i am not 100% certain (I am guessing) but you might be able to get past this by disabling the built in websocket nodes...  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/8/f875f9d9d3de100f477a0b1c39f85fe4711b4e32.png)

---

<div class="post-metadata">

### Author: ![MrWolff](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mrwolff/32/30557_2.png) [@MrWolff](https://discourse.nodered.org/u/MrWolff)
#### Post date: [17 December 2020 21:33 UTC](https://discourse.nodered.org/t/cant-connect-websocket-disconnected/37590/7 "2020-12-17T21:33:49Z")

</div>

Hi Steve-Mcl, I think this is the build in websocket.  
That’s the one ☝ I mean.  
When I use this websocket I get always “disconnected”

Where can I disable it?

In the tab with installed nodes I can’t found it...

---

<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 December 2020 21:49 UTC](https://discourse.nodered.org/t/cant-connect-websocket-disconnected/37590/8 "2020-12-17T21:49:08Z")

</div>

built in nodes are in the pallete --\> nodes...

 ![aFMRbFMWW5](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/9/e9fac82304dcd806883782947513ccfa343c9d7b.gif)

---

<div class="post-metadata">

### Author: ![MrWolff](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mrwolff/32/30557_2.png) [@MrWolff](https://discourse.nodered.org/u/MrWolff)
#### Post date: [18 December 2020 14:17 UTC](https://discourse.nodered.org/t/cant-connect-websocket-disconnected/37590/9 "2020-12-18T14:17:00Z")

</div>

I can't find the websocket in the "nodes" tab as you showed.

When I search in the "Install" tab I see there is a conflict:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/7/d752678208a8dbf2ef3cc2ddafb2fca7a520a4b6.png)

What could this conflict be?  
Is the "node-red-contrib-websocket" the original build in websocket as you showed in the "nodes" tab?

When I use the websocket (in an example below) I can't get any connection.  
It says "disconnected"

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/6/a6ae92061374c839b9d41bd00970a17908bd6b0b.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: [18 December 2020 14:31 UTC](https://discourse.nodered.org/t/cant-connect-websocket-disconnected/37590/10 "2020-12-18T14:31:05Z")

</div>

> [@MrWolff](#):
>
> Is the "node-red-contrib-websocket" the original build in websocket as you showed in the "nodes" tab?

no it is a contribution node (node-red- **contrib** -websocket)

Look at your picture...

> [@MrWolff](#):
>
> What could this conflict be?

You have installed node-red-contrib-websocket (it appears in the "Install" tab)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/9/0904bf11337bf253c8dd4002e60695d59e030596.png)

it is probably conflicting with the build in websocket node  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/c/5c1a1d720c903beb5a6f385a4219650125c2180d.png)

* * *

To be honest, I would DELETE that contrib node - it was last 4 1/2 years ago. Use the build in web socket node.

---

<div class="post-metadata">

### Author: ![MrWolff](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mrwolff/32/30557_2.png) [@MrWolff](https://discourse.nodered.org/u/MrWolff)
#### Post date: [18 December 2020 14:46 UTC](https://discourse.nodered.org/t/cant-connect-websocket-disconnected/37590/11 "2020-12-18T14:46:39Z")

</div>

Okay, but how can I delete it?  
Because there is no button: delete or uninstall

---

<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: [18 December 2020 14:51 UTC](https://discourse.nodered.org/t/cant-connect-websocket-disconnected/37590/12 "2020-12-18T14:51:19Z")

</div>

- delete any websocket nodes from your flow and deploy (make a backup first if need be)
- stop node-red
- in a terminal
  - go to the nodered folder e.g. `cd ./node-red`
  - uinstall via npm e.g. `npm uninstall node-red-contrib-websocket`

- start node-red

---

<div class="post-metadata">

### Author: ![MrWolff](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mrwolff/32/30557_2.png) [@MrWolff](https://discourse.nodered.org/u/MrWolff)
#### Post date: [19 December 2020 12:16 UTC](https://discourse.nodered.org/t/cant-connect-websocket-disconnected/37590/13 "2020-12-19T12:16:13Z")

</div>

I tried to uninstall as you described above.

I looked into the conflict. The conflict is saying that the node-red-contrib-websocket can't be installed while there is another websocket installed. So that's good. It means that the node-red-contrib-websocket isn't installed.

I still have the problem that the websocket is disconnected.  
Is there a service running on the raspberry pi which i can check? A serving wich is on ip 127.0.0.1?

---

<div class="post-metadata">

### Author: ![MrWolff](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mrwolff/32/30557_2.png) [@MrWolff](https://discourse.nodered.org/u/MrWolff)
#### Post date: [19 December 2020 16:06 UTC](https://discourse.nodered.org/t/cant-connect-websocket-disconnected/37590/14 "2020-12-19T16:06:45Z")

</div>

I prefer to run node-red on my raspberry pi with desktop environment. Like Raspbian Buster.

When I install Raspbian Buster with Node-Red on the SD card.  
And install "node-red-contrib-unipi-evok" ,and I insert a unipi flow, the websocket node doesn't connect.  
Whatever I try, the only thing I get is "disconnected" 😩:  
 ![Schermafbeelding 2020-12-19 om 17.14.16](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/0/4017e6e449caee164f00e2a0ad01e1321331b990.png)

When I install the "Unipi 1.1 Node-RED OS" image on the SD card, and start node-red, the websocket works fine.  
It's "connected" 🙂:  
 ![Schermafbeelding 2020-12-19 om 13.58.43](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/6/c6358ca3f37e6682ab9f53b86cac8c3491b38912.png)  
But in this option I have no desktop environment on my Raspberry Pi. So the "Unipi image" is no option.

I'm trying to find out why the websocket doesn't work in node-red installed on Raspbian Buster. 🤔

I don't onderstand why this doesn't work. 😩

Does anyone have any idea what the problem is here?

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [19 December 2020 16:10 UTC](https://discourse.nodered.org/t/cant-connect-websocket-disconnected/37590/15 "2020-12-19T16:10:14Z")

</div>

from what you show the top one does not have a correct url for the connection - /ws/127.0.0.1:8080 is not valid.

---

<div class="post-metadata">

### Author: ![MrWolff](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mrwolff/32/30557_2.png) [@MrWolff](https://discourse.nodered.org/u/MrWolff)
#### Post date: [19 December 2020 16:16 UTC](https://discourse.nodered.org/t/cant-connect-websocket-disconnected/37590/16 "2020-12-19T16:16:20Z")

</div>

Hi @dceejay, you are corrected. I had uploaded the wrong picture why I tried a lot.  
Now I have changed the picture in the right one. 🙂

---

<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: [17 February 2021 16:16 UTC](https://discourse.nodered.org/t/cant-connect-websocket-disconnected/37590/17 "2021-02-17T16:16:25Z")

</div>

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