Rpi Docker Install



To install the helper script, run one of the images with no arguments, and redirect the output to a file: docker run -rm CROSSCOMPILERIMAGENAME./dockcross chmod +x./dockcross mv./dockcross /bin/ Where CROSSCOMPILERIMAGENAME is the name of the cross-compiler toolchain Docker instance, e.g. $ rpi-deep-pantilt track; By default, this will track objects with the label person. You can track a different type of object using the -label parameter. For example, to track a banana, you would run: $ rpi-deep-pantilt track -label =banana. On a Raspberry Pi 4 (4GB), I benchmarked my model at roughly 8FPS. Getting started with Home Assistant. Help us to improve our documentation Suggest an edit to this page, or provide/view feedback for this page.

It is possible to run Zigbee2MQTT in a Docker container using the official Zigbee2MQTT Docker image.

This image support the following architectures: 386, amd64, arm/v6, arm/v7, arm64.Since Zigbee2MQTT images are manifest listed, Docker will auto-detect the architecture and pull the right image.

Note for Raspberry Pi 1 and zero users: there is a bug in Docker which selects the wrong image architecture.Before executing docker run pull the correct image with docker pull koenkk/zigbee2mqtt --platform linux/arm/v6.

First run the container, this will create the configuration directory. Change configuration.yaml according to your situation and start again.

Running #

Raspberry Pi Zero Docker Install

Install

Run by executing the following commmand:

Parameters explanation #

  • -v $(pwd)/data:/app/data: Directory where Zigbee2MQTT stores it configuration
  • --device=/dev/ttyACM0: Location of adapter (e.g. CC2531)
  • -v /run/udev:/run/udev:ro --privileged=true: is optional, only required for autodetecting the port
  • Optional: in case your MQTT broker is running on localhost and is not within the same Docker network as the Zigbee2MQTT container also add --network host .

Updating #

To update to the latest Docker image:

Tags #

The following tags are available:

  • Latest release version: latest
  • Latest dev version (based on dev branch): latest-dev
  • Specific release version, e.g: 1.7.0

Support new devices #

See How to support new devices

docker-compose example #

Docker Stack device mapping #

This is only relevant when using Docker Stack

Docker stack doesn’t support device mappings with option --devices when deploying a stack in Swam mode. A workaround is to bind the device as volume binding and set the right permissions.

Install Docker For Rpi

The workaround is based on the solution found at Add support for devices with “service create”, all credits goes this him.

Rpi Docker Installation

  1. Identify cc2531 device Identify the cc2531 device using the following command:

  2. UDEV Rules

    Create a new udev rule for cc2531, idVendor and idProduct must be equal to values from lsusb command. The rule below creates device /dev/cc2531:

    Reload newly created rule using the following command:

  3. Create docker-setup-cc2531.sh

    Copy the following content:

    Set permissions:

  4. Create docker-event-listener.sh

    Copy the following content:

    Set permissions:

  5. Create docker-event-listener.service

    Copy the following content:

    Set permissions:

    Reload daemon

    Start Docker event listener

    Status Docker event listener

    Enable Docker event listener

  6. Verify and deploy Zigbee2MQTT stack

    Now reconnect the cc2531. Verify using the following command:

    Below an example of a docker-stack-zigbee2mqtt.yml:

    In the above example, proxy_traefik-net is the network to connect to the mqtt broker. The constraint makes sure Docker deploys only to this (rpi-3) node, where the cc2531 is connected to. The volume binding /mnt/docker-cluster/zigbee2mqtt/data is the zigbee2mqtt persistent directory, where configuration.yaml is saved.

    The zigbee2Zigbee2MQTTmqtt configuration.yaml should point to /dev/cc2531:

    Deploy the stack: