Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2023-05-16 Zigbee2MQTT adaptation to expected kernel change - master branch - PR 1 of 2 #706

Merged
merged 2 commits into from
Jun 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .templates/zigbee2mqtt/service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@ zigbee2mqtt:
container_name: zigbee2mqtt
image: koenkk/zigbee2mqtt:latest
environment:
- TZ=Etc/UTC
- TZ=${TZ:-Etc/UTC}
- ZIGBEE2MQTT_CONFIG_MQTT_SERVER=mqtt://mosquitto:1883
- ZIGBEE2MQTT_CONFIG_FRONTEND=true
- ZIGBEE2MQTT_CONFIG_ADVANCED_LOG_SYMLINK_CURRENT=true
# - DEBUG=zigbee-herdsman*
ports:
- "8080:8080"
volumes:
- ./volumes/zigbee2mqtt/data:/app/data
devices:
- /dev/ttyAMA0:/dev/ttyACM0
- "${ZIGBEE2MQTT_DEVICE_PATH:?eg echo ZIGBEE2MQTT_DEVICE_PATH=/dev/ttyACM0 >>~/IOTstack/.env}:/dev/ttyACM0"
restart: unless-stopped
depends_on:
- mosquitto
Expand Down
37 changes: 17 additions & 20 deletions docs/Containers/Zigbee2MQTT.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,25 +131,21 @@ For those reasons, it is better to take the time to identify your Zigbee adapter

What the output is telling you is that the *by-id* path is a symbolic link to `/dev/ttyACM0`. Although this *may* always be true on your Raspberry Pi, the only part that is actually *guaranteed* to be true is the *by-id* path, which is why you should use it.

7. Use your favourite text editor to open your *compose file*.
8. Find your `zigbee2mqtt` service definition and identify this line:
7. Once you have identified the path to your adapter, you communicate that information to docker-compose like this:

```yaml
- /dev/ttyAMA0:/dev/ttyACM0
```console
$ echo ZIGBEE2MQTT_DEVICE_PATH=/dev/serial/by-id/usb-Texas_Instruments_TI_CC2531_USB_CDC___0X00125A00183F06C5-if00 >>~/IOTstack/.env
```

The default from the IOTstack template maps the *external* (Raspberry Pi) device `/dev/ttyAMA0` to the *internal* (Zigbee2MQTT container) device `/dev/ttyACM0`.

> On the Raspberry Pi, the *external* device `/dev/ttyAMA0` is the Bluetooth adapter. It was chosen as the default because it normally exists and its presence avoids docker-compose refusing to bring up the container. However, a Bluetooth adapter doesn't actually respond like a Zigbee adapter so the Zigbee2MQTT container will go into a restart loop if you start it before completing these steps. A side-effect of the container entering a restart loop is the web GUI never starts.

9. Replace `/dev/ttyAMA0` with your *by-id* path. Example:
Note:

* if you forget to do this step, docker-compose will display the following error message:

```yaml
- /dev/serial/by-id/usb-Texas_Instruments_TI_CC2531_USB_CDC___0X00125A00183F06C5-if00:/dev/ttyACM0
```
```
parsing ~/IOTstack/docker-compose.yml: error while interpolating services.zigbee2mqtt.devices.[]: required variable ZIGBEE2MQTT_DEVICE_PATH is missing a value: eg echo ZIGBEE2MQTT_DEVICE_PATH=/dev/ttyACM0 >>~/IOTstack/.env
```

10. Save your work.
11. Continue from [bring up your stack](#upStack).
8. Continue from [bring up your stack](#upStack).

## Configuration { #configuration }

Expand All @@ -172,10 +168,6 @@ $ docker-compose up -d zigbee2mqtt

The default service definition provided with IOTstack includes the following environment variables:

* `TZ=Etc/UTC`

You should replace `Etc/UTC` with a value that is correct for your location.

* `ZIGBEE2MQTT_CONFIG_MQTT_SERVER=mqtt://mosquitto:1883` { #mqttServer }

Typical values for this are:
Expand Down Expand Up @@ -212,6 +204,10 @@ The default service definition provided with IOTstack includes the following env
```

See [Checking the log](#checkLog) for more information about why this is useful.

* `- DEBUG=zigbee-herdsman*` { #enableDebug }

Enabling this variable turns on extended debugging inside the container.

### Configuration file { #confFile }

Expand Down Expand Up @@ -393,16 +389,17 @@ zigbee2mqtt:
container_name: zigbee2mqtt
image: koenkk/zigbee2mqtt:latest
environment:
- TZ=Etc/UTC
- TZ=${TZ:-Etc/UTC}
- ZIGBEE2MQTT_CONFIG_MQTT_SERVER=mqtt://mosquitto:1883
- ZIGBEE2MQTT_CONFIG_FRONTEND=true
- ZIGBEE2MQTT_CONFIG_ADVANCED_LOG_SYMLINK_CURRENT=true
# - DEBUG=zigbee-herdsman*
ports:
- "8080:8080"
volumes:
- ./volumes/zigbee2mqtt/data:/app/data
devices:
- /dev/ttyAMA0:/dev/ttyACM0
- "${ZIGBEE2MQTT_DEVICE_PATH:?eg echo ZIGBEE2MQTT_DEVICE_PATH=/dev/ttyACM0 >>~/IOTstack/.env}:/dev/ttyACM0"
restart: unless-stopped
depends_on:
- mosquitto
Expand Down