Error "Not connected to MQTT server" after installing zigbee2mqtt

Hello,

I have installed hassio and zigbee2mqtt from: https://github.com/danielwelch/hassio-zigbee2mqtt.
After starting zigbee2mqtt I got repeatedly the error “Not connected to MQTT server”.
Is there some kind of extra configuring I need to do?

Best regards,

Wamor

On the page you just pointed to it says

The following table describes all available options. To run this add-on, you must set the required parameters via the Hass.io user interface.

And of course you must set up a mqtt server (that is a separate hassio addon).

Hello nickrout,

First of all, thank you for replying. I am quite new with Hass.io so please forgive me my newbie questions.
I have started zigbee2mqtt with the default config which are in the details-screen (see below).
{
“data_path”: “/share/zigbee2mqtt”,
“homeassistant”: true,
“permit_join”: false,
“mqtt_base_topic”: “zigbee2mqtt”,
“mqtt_server”: “mqtt://homeassistant”,
“serial_port”: “/dev/ttyACM0”,
“devices”: [],
“network_key”: []
}

When I start zigbee2mqtt I receive the following error message:
zigbee2mqtt:error 2019-2-18 19:43:13 Not connected to MQTT server!

I want to use the integrated MQTT-server shipped with Hass.io. Do I need to change some configuration?

Regards,

Wamor

First I recommend against using the inbuilt mqtt server, it is just not as good as mosquitto.

Second if you want to use the inbuilt one, you have to set it up first, look through the docs, I don’t use it so you’ll have to figure it out from the docs.

If you want to take my advice (and most people’s advice on this forum) and use mosquitto, see here. https://www.home-assistant.io/addons/mosquitto/

you need to set
“permit_join”: false, to true (for new devices to join, after all devices are joined put it back to false)
“mqtt_server”: “mqtt://homeassistant”, needst to be your ip-adress for the device HA is running on ending with port :1883 for example “192.168.1.14:1883”,

hope it helps

1 Like

Hi marinesjeng,

I tried you suggestions but without succes.
I therefor installed mosquitto.

@nickrout: I have installed mosquitto but got the following lines keep repeating in the log-window:
1550603281: New connection from 172.30.32.1 on port 1883.
1550603281: Socket error on client , disconnecting.

Is this correct?
The mosquitto-broker has the following config:
{
“logins”: [],
“anonymous”: false,
“customize”: {
“active”: false,
“folder”: “mosquitto”
},
“certfile”: “fullchain.pem”,
“keyfile”: “privkey.pem”
}

In the log-file of zigbee2mqtt I see the below unhandled error. Any suggestion what I missed here.
Do I still have te configure additional settings?

Thank you and best regards,

Wamor

zigbee2mqtt:info 2019-2-19 20:24:21 zigbee-shepherd ready

events.js:183
throw er; // Unhandled ‘error’ event
^
Error: Connection refused: Not authorized
at MqttClient._handleConnack (/zigbee2mqtt-1.1.1/node_modules/mqtt/lib/client.js:920:15)
at MqttClient._handlePacket (/zigbee2mqtt-1.1.1/node_modules/mqtt/lib/client.js:350:12)
at work (/zigbee2mqtt-1.1.1/node_modules/mqtt/lib/client.js:292:12)
at Writable.writable._write (/zigbee2mqtt-1.1.1/node_modules/mqtt/lib/client.js:302:5)
at doWrite (/zigbee2mqtt-1.1.1/node_modules/readable-stream/lib/_stream_writable.js:428:64)
at writeOrBuffer (/zigbee2mqtt-1.1.1/node_modules/readable-stream/lib/_stream_writable.js:417:5)
at Writable.write (/zigbee2mqtt-1.1.1/node_modules/readable-stream/lib/_stream_writable.js:334:11)
at Socket.ondata (_stream_readable.js:639:20)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
npm
ERR!
code ELIFECYCLE
npm
ERR! errno 1
npm
ERR! [email protected] start: node index.js
npm ERR! Exit status 1
npm ERR!
npm
ERR! Failed at the [email protected] start script.
npm ERR!
This is probably not a problem with npm. There is likely additional logging output above.
npm ERR!
A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2019-02-19T19_24_21_180Z-debug.log

Hello,

Just to let you know.
When changing the “anonymous” parameter to true in the mosquitto-config there are no errors in the log files of both mosquitto and zigbee2mqtt.

Best regards,

Wamor

1 Like