# Gladys and MQTT (and ZigBee)

**URL:** <https://community.gladysassistant.com/t/gladys-et-mqtt-et-zigbee/6873>\
**Category:** Configuration\
**Created:** [January 29, 2022, 3:33pm UTC](https://community.gladysassistant.com/t/gladys-et-mqtt-et-zigbee/6873 "2022-01-29T15:33:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bong101](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/bong101/32/9808_2.png) [@bong101](https://community.gladysassistant.com/u/bong101)\
**Post date:** [January 29, 2022, 3:33pm UTC](https://community.gladysassistant.com/t/gladys-et-mqtt-et-zigbee/6873/1 "2022-01-29T15:33:01Z")

</div>

Hello

On an Ubuntu installation (VERSION=«&nbsp;20.04.3 LTS (Focal Fossa)&nbsp;»), Odroid card, I installed Gladys Assistant. When trying to install ZigBee to MQTT, I noticed that it doesn’t work

The 2 containers are launched

```auto
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
91862eef2c3b koenkk/zigbee2mqtt:latest "docker-entrypoint.s…" 34 minutes ago Up 5 seconds gladys-z2m-zigbee2mqtt
ad8ff539547e eclipse-mosquitto:2 "/docker-entrypoint.…" 37 minutes ago Up 37 minutes gladys-z2m-mqtt
485cf29283e0 gladysassistant/gladys:latest "docker-entrypoint.s…" 42 minutes ago Up 42 minutes gladys

```

but communication is not happening (red crosses in Gladys)

Looking at the logs, we see that

```auto
Using '/app/data' as data directory
Zigbee2MQTT:info 2022-01-29 15:04:21: Logging to console and directory: '/app/data/log/2022-01-29.15-04-18' filename: log.txt
Zigbee2MQTT:info 2022-01-29 15:04:21: Starting Zigbee2MQTT version 1.22.2 (commit #414c51f)
Zigbee2MQTT:info 2022-01-29 15:04:21: Starting zigbee-herdsman (0.13.188)
Zigbee2MQTT:info 2022-01-29 15:04:23: zigbee-herdsman started (resumed)
Zigbee2MQTT:info 2022-01-29 15:04:23: Coordinator firmware version: '{"meta":{"maintrel":1,"majorrel":2,"minorrel":7,"product":1,"revision":20210708,"transportrev":2},"type":"zStack3x0"}'
Zigbee2MQTT:info 2022-01-29 15:04:23: Currently 0 devices are joined:
Zigbee2MQTT:info 2022-01-29 15:04:23: Zigbee: disabling joining new devices.
Zigbee2MQTT:info 2022-01-29 15:04:23: Connecting to MQTT server at mqtt://localhost:1884
Zigbee2MQTT:error 2022-01-29 15:04:23: MQTT failed to connect: Connection refused: Not authorized
Zigbee2MQTT:error 2022-01-29 15:04:23: Exiting...
Zigbee2MQTT:info 2022-01-29 15:04:23: Stopping zigbee-herdsman...
Zigbee2MQTT:info 2022-01-29 15:04:34: Stopped zigbee-herdsman

```

and

```auto
1643470019: New connection from 127.0.0.1:52546 on port 1884.
1643470019: Client gladys-main-instance-636325 disconnected, not authorised.
1643470024: New connection from 127.0.0.1:52547 on port 1884.
1643470024: Client gladys-main-instance-636325 disconnected, not authorised.
1643470029: New connection from 127.0.0.1:52548 on port 1884.
1643470029: Client mqttjs_49405afd disconnected, not authorised.
1643470029: New connection from 127.0.0.1:52549 on port 1884.
1643470029: Client gladys-main-instance-636325 disconnected, not authorised.

```

If I look at the mosquitto configuration, we see that

```auto
# cat /mosquitto/config/mosquitto.conf
listener 1884
allow_anonymous **false**
# connection_messages false
password_file /mosquitto/config/mosquitto.passwd

```

My question is: how can we set allow\_anonymous to True in Docker in a permanent way (easy solution, but not very secure) or use the mosquitto users (and the mosquitto\_passwd command)?

Thanks in advance  
Olivier
