Mosquitto Websocket Client Issue

Tags: #<Tag:0x00007f326b81edf0>

Hello everybody and thank you for checking this post :slight_smile:

I am using Mosquitto and Node-Red to publish / subscribe topics and it works well with the small army of arduinos they are communicating with. However I now need to connect to the broker via a javascript / html page and am having problems.

Currently I am trying to connect to my Home Assistant’s Mosquitto addon via a websocket client (http://www.hivemq.com/demos/websocket-client/) but without success.

The Mosquitto log indicates that 1884 is open as a websocket listener.

1591012212: Opening ipv4 listen socket on port 1883.
1591012212: Opening ipv6 listen socket on port 1883.
1591012212: Opening websockets listen socket on port 1884.

Unfortunately nothing happens when I try to connect to it and the websocket client reports the following error :

image

However when I change the port to 1883 in the websocket client I still get an error BUT this time the Mosquitto log register the connexion attempt.

1591012214: New connection from 192.168.1.101 on port 1883.
1591012215: Socket error on client <unknown>, disconnecting.

When I asked on the HA Discord, I was told the error might come from “addon network config” but, despite my research, I am not sure what it refers to.

I have been trying to find the solution for days now and would be very grateful for any help.

Thanks in advance !

Did you add a user name and password

and a user in side HA

I have not. I have made a user and an integration which includes a login and password.

Think that were your error is.

I added the credentials, restarted the MQTT add-on (and the server for good measure) but unfortunately I still get the same error.

Thanks for the suggestion though :slight_smile:

Digging a quite old post, but I have the exact same issue. Any chance you succeeded in fixing it? :blush: