I added the following to the mosquitto add-on in hassio:
“customize”: {
“active”: true,
“folder”: “mosquitto”
},
in /share I have a mosquitto directory with a conf file that contains:
listener 8080
protocol websockets
When I restart the mosquitto add-on it reports:
starting version 3.2.2
1509573381: mosquitto version 1.4.12 (build date 2017-06-01 13:03:46+0000) starting
1509573381: Config loaded from /etc/mosquitto.conf.
1509573381: Opening websockets listen socket on port 8080.
1509573381: Opening ipv4 listen socket on port 1883.
1509573381: Opening ipv6 listen socket on port 1883.
Looks like websockets is started, but, when I try to use HiveMQ to access 8080 I get errors (it works OK for some test sites).
I’m very much interested in activating a listener with websockets to using mosquitto broker. The embedded broker should support it but can’t really get it to work at all.
Could you please give some more detailed instructions on what exactly needs to be done? It would be much appreciated!!
The add-on broker was not compiled with websockets support, so you can configure all day to no avail.
I followed the instructions provided by NotoriousBDG and have a local add-on that supports websockets. Have you tried to follow those instructions?
If so, do you have a specific problem with which you need help?
If you do not understand those instructions enough to attempt the process, then more detail will be time consuming to produce, and still may not help.
Instead, I will endeavor to make my version available as a community supported add-on or as an additional repository add-on. Either way you will install a different mosquitto add-on and then configure it for websockets.
I’ve not done this before, so I’ll let you know when I have accomplished one or the other.
Edt “config.json”. Revise ports as follows and save:
“ports”: {
“1883/tcp”: 1883,
“8883/tcp”: 8883,
“8080/tcp”: 8080
},
Install Samba Share add-on. Copy revised mosquitto folder to addons folder on hass.io.
In share folder on hass.io create a mosquitto folder and in it create “enable_websockets.conf” as follows:
listener 8080
protocol websockets
log_type websockets
websockets_log_level 255
restart hass.io. Access your Hass.io > ADD-ON STORE. In Local add-ons find your Mosquitto broker. Open it, and install it.
Edit and save the config to include:
“customize”: {
“active”: true,
“folder”: “mosquitto”
},