Can't connect websocket (disconnected)

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/
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?

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?

Hello Colin,

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

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

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?

It probably confilcts with built in websockets
image

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

Hi Steve-Mcl, I think this is the build in websocket.
That’s the one :point_up: 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...

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

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

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"

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

Look at your picture...

You have installed node-red-contrib-websocket (it appears in the "Install" tab)
image

it is probably conflicting with the build in websocket node
image


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

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

  • 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

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?

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" :weary::
Schermafbeelding 2020-12-19 om 17.14.16

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" :slightly_smiling_face::
Schermafbeelding 2020-12-19 om 13.58.43
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. :thinking:

I don't onderstand why this doesn't work. :weary:

Does anyone have any idea what the problem is here?

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.

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. :slight_smile:

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