├── .editorconfig ├── .gitattributes ├── .github └── workflows │ ├── dev.yml │ ├── development.yml │ └── main.yml ├── .gitignore ├── LICENSE ├── README.md ├── docker-compose.yml ├── docker ├── Dockerfile ├── download-deconz.sh └── root │ ├── firmware-update.sh │ ├── run │ └── udev │ │ └── data │ │ ├── c166:0 │ │ └── c188:0 │ └── start.sh └── version.json /.editorconfig: -------------------------------------------------------------------------------- 1 | [*.sh] 2 | indent_style = space 3 | indent_size = 2 4 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.github/workflows/dev.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | name: Build and push dev image 4 | 5 | on: 6 | pull_request: 7 | types: [ labeled ] 8 | paths: 9 | - 'docker/**' 10 | - 'version.json' 11 | workflow_dispatch: 12 | 13 | jobs: 14 | docker-build: 15 | if: ${{ github.event.label.name == 'Dev-Image' }} 16 | runs-on: ubuntu-latest 17 | strategy: 18 | matrix: 19 | include: 20 | - name: standard 21 | dockerfile: docker/Dockerfile 22 | platforms: |- 23 | linux/amd64 24 | linux/arm/v7 25 | linux/arm64 26 | image_name: "docker-deconz" 27 | steps: 28 | - name: Checkout 29 | uses: actions/checkout@v2 30 | 31 | - name: Set up QEMU 32 | uses: docker/setup-qemu-action@v1 33 | 34 | - name: Set up Docker Buildx 35 | uses: docker/setup-buildx-action@v1 36 | 37 | - name: Cache Docker layers 38 | uses: actions/cache@v2 39 | with: 40 | path: /tmp/.buildx-cache 41 | key: ${{ runner.os }}-buildx-${{ github.sha }}-${{ matrix.platforms }} 42 | restore-keys: | 43 | ${{ runner.os }}-buildx-${{ github.sha }}-${{ matrix.platforms }} 44 | ${{ runner.os }}-buildx- 45 | 46 | - name: Login to DockerHub 47 | uses: docker/login-action@v1 48 | with: 49 | username: ${{ secrets.DOCKER_HUB_USER }} 50 | password: ${{ secrets.DOCKER_HUB_TOKEN }} 51 | 52 | - name: Login to Container Registry 53 | uses: docker/login-action@v1 54 | with: 55 | registry: ghcr.io 56 | username: ${{ github.repository_owner }} 57 | password: ${{ secrets.GITHUB_TOKEN }} 58 | 59 | - name: get version 60 | id: version 61 | uses: notiz-dev/github-action-json-property@release 62 | with: 63 | path: 'version.json' 64 | prop_path: 'version' 65 | 66 | - name: get channel 67 | id: channel 68 | uses: notiz-dev/github-action-json-property@release 69 | with: 70 | path: 'version.json' 71 | prop_path: 'channel' 72 | 73 | - name: Build and push ${{ matrix.name }} 74 | uses: docker/build-push-action@v2 75 | with: 76 | context: ./docker/ 77 | file: ${{ matrix.dockerfile }} 78 | platforms: ${{ matrix.platforms }} 79 | build-args: | 80 | VERSION=${{ steps.version.outputs.prop }} 81 | CHANNEL=${{ steps.channel.outputs.prop }} 82 | push: true 83 | tags: | 84 | deconzcommunity/deconz:dev 85 | ghcr.io/${{ github.repository }}:dev 86 | labels: | 87 | maintainer=${{ github.repository_owner }} 88 | org.opencontainers.image.vendor=${{ github.repository_owner }} 89 | org.opencontainers.image.revision=${{ github.sha }} 90 | cache-from: type=local,src=/tmp/.buildx-cache 91 | cache-to: type=local,dest=/tmp/.buildx-cache 92 | -------------------------------------------------------------------------------- /.github/workflows/development.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | name: Build and push image 4 | 5 | on: 6 | pull_request: 7 | types: [ labeled ] 8 | paths: 9 | - 'docker/**' 10 | - 'version.json' 11 | workflow_dispatch: 12 | 13 | jobs: 14 | docker-build: 15 | if: ${{ github.event.label.name == 'Development-Image' }} 16 | runs-on: ubuntu-latest 17 | strategy: 18 | matrix: 19 | include: 20 | - name: standard 21 | dockerfile: docker/Dockerfile 22 | platforms: |- 23 | linux/amd64 24 | linux/arm/v7 25 | linux/arm64 26 | image_name: "docker-deconz" 27 | steps: 28 | - name: Checkout 29 | uses: actions/checkout@v2 30 | 31 | - name: Set up QEMU 32 | uses: docker/setup-qemu-action@v1 33 | 34 | - name: Set up Docker Buildx 35 | uses: docker/setup-buildx-action@v1 36 | 37 | - name: Cache Docker layers 38 | uses: actions/cache@v2 39 | with: 40 | path: /tmp/.buildx-cache 41 | key: ${{ runner.os }}-buildx-${{ github.sha }}-${{ matrix.platforms }} 42 | restore-keys: | 43 | ${{ runner.os }}-buildx-${{ github.sha }}-${{ matrix.platforms }} 44 | ${{ runner.os }}-buildx- 45 | 46 | - name: Login to DockerHub 47 | uses: docker/login-action@v1 48 | with: 49 | username: ${{ secrets.DOCKER_HUB_USER }} 50 | password: ${{ secrets.DOCKER_HUB_TOKEN }} 51 | 52 | - name: Login to Container Registry 53 | uses: docker/login-action@v1 54 | with: 55 | registry: ghcr.io 56 | username: ${{ github.repository_owner }} 57 | password: ${{ secrets.GITHUB_TOKEN }} 58 | 59 | - name: get version 60 | id: version 61 | uses: notiz-dev/github-action-json-property@release 62 | with: 63 | path: 'version.json' 64 | prop_path: 'version' 65 | 66 | - name: get channel 67 | id: channel 68 | uses: notiz-dev/github-action-json-property@release 69 | with: 70 | path: 'version.json' 71 | prop_path: 'channel' 72 | 73 | - name: Build and push ${{ matrix.name }} 74 | uses: docker/build-push-action@v2 75 | with: 76 | context: ./docker/ 77 | file: ${{ matrix.dockerfile }} 78 | platforms: ${{ matrix.platforms }} 79 | build-args: | 80 | VERSION=${{ steps.version.outputs.prop }} 81 | CHANNEL=${{ steps.channel.outputs.prop }} 82 | push: true 83 | tags: | 84 | deconzcommunity/deconz:development 85 | ghcr.io/${{ github.repository }}:development 86 | labels: | 87 | maintainer=${{ github.repository_owner }} 88 | org.opencontainers.image.vendor=${{ github.repository_owner }} 89 | org.opencontainers.image.revision=${{ github.sha }} 90 | cache-from: type=local,src=/tmp/.buildx-cache 91 | cache-to: type=local,dest=/tmp/.buildx-cache 92 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | name: Build and push image 4 | 5 | on: 6 | push: 7 | paths: 8 | - 'docker/**' 9 | - 'version.json' 10 | branches: ['main'] 11 | pull_request: 12 | paths: 13 | - 'docker/**' 14 | - 'version.json' 15 | workflow_dispatch: 16 | 17 | jobs: 18 | docker-build: 19 | runs-on: ubuntu-latest 20 | strategy: 21 | matrix: 22 | include: 23 | - name: standard 24 | dockerfile: docker/Dockerfile 25 | platforms: |- 26 | linux/amd64 27 | linux/arm/v7 28 | linux/arm64 29 | image_name: "docker-deconz" 30 | steps: 31 | - name: Checkout 32 | uses: actions/checkout@v2 33 | 34 | - name: Set up QEMU 35 | uses: docker/setup-qemu-action@v1 36 | 37 | - name: Set up Docker Buildx 38 | uses: docker/setup-buildx-action@v1 39 | 40 | - name: Login to DockerHub 41 | if: github.event_name != 'pull_request' 42 | uses: docker/login-action@v1 43 | with: 44 | username: ${{ secrets.DOCKER_HUB_USER }} 45 | password: ${{ secrets.DOCKER_HUB_TOKEN }} 46 | 47 | - name: Login to Container Registry 48 | if: github.event_name != 'pull_request' 49 | uses: docker/login-action@v1 50 | with: 51 | registry: ghcr.io 52 | username: ${{ github.repository_owner }} 53 | password: ${{ secrets.GITHUB_TOKEN }} 54 | 55 | - name: get version 56 | id: version 57 | uses: notiz-dev/github-action-json-property@release 58 | with: 59 | path: 'version.json' 60 | prop_path: 'version' 61 | 62 | - name: get channel 63 | id: channel 64 | uses: notiz-dev/github-action-json-property@release 65 | with: 66 | path: 'version.json' 67 | prop_path: 'channel' 68 | 69 | - name: Build and push ${{ matrix.name }} 70 | uses: docker/build-push-action@v2 71 | with: 72 | context: ./docker/ 73 | file: ${{ matrix.dockerfile }} 74 | platforms: ${{ matrix.platforms }} 75 | build-args: | 76 | VERSION=${{ steps.version.outputs.prop }} 77 | CHANNEL=${{ steps.channel.outputs.prop }} 78 | push: ${{ github.event_name != 'pull_request' }} 79 | provenance: false 80 | tags: | 81 | deconzcommunity/deconz:latest 82 | deconzcommunity/deconz:${{ steps.version.outputs.prop }} 83 | deconzcommunity/deconz:${{ steps.channel.outputs.prop }} 84 | ghcr.io/${{ github.repository }}:latest 85 | ghcr.io/${{ github.repository }}:${{ steps.version.outputs.prop }} 86 | ghcr.io/${{ github.repository }}:${{ steps.channel.outputs.prop }} 87 | labels: | 88 | maintainer=${{ github.repository_owner }} 89 | org.opencontainers.image.vendor=${{ github.repository_owner }} 90 | org.opencontainers.image.revision=${{ github.sha }} 91 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode 2 | .DS_Store 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Mark Coombes 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Notes for ConBee 3 users 2 | 3 | If you're using a ConBee 3 stick, you need to set the following environment variable for deCONZ to pick be able to communicate with the stick: 4 | 5 | ``` 6 | DECONZ_BAUDRATE=115200 7 | ``` 8 | 9 | ## Notes for Synology users 10 | 11 | We've had numerous reports of issues when deCONZ is run as an unprivileged user, which is the default behaviour. Because of this, it is highly recommended that you run deCONZ as root. To do so, set the following two environment variables: 12 | 13 | ``` 14 | DECONZ_UID=0 15 | DECONZ_GID=0 16 | ``` 17 | 18 | ### Notes for Raspberry Pi users 19 | 20 | It may be necessary to run the deCONZ docker image in privileged mode for it to be able to connect and control a Conbee II or Raspbee device. 21 | Using a docker compose file is the easiest to do so, and you need to make sure that `privileged: true` is contained in it. 22 | 23 | See [Configuring deCONZ Container for Conbee II on Raspberry Pi](#configuring-deconz-container-for-conbee-ii-on-raspberry-pi) below 24 | 25 | --- 26 | 27 | ## deCONZ Docker Image 28 | 29 | This Docker image containerizes the deCONZ software from Dresden Elektronik, which controls a ZigBee network using a Conbee USB or RaspBee GPIO serial interface. This image runs deCONZ in "minimal" mode, for control of the ZigBee network via the WebUIs ("Wireless Light Control" and "Phoscon") and over the REST API and Websockets, and optionally runs a VNC server for viewing and interacting with the ZigBee mesh through the deCONZ UI. 30 | 31 | Conbee is supported on `amd64`, `armhf`/`armv7`, and `aarch64`/`arm64` (i.e. RaspberryPi 2/3B/3B+, and other arm64 boards) architectures; RaspBee is supported on `armhf`/`armv7` and `aarch64`/`arm64` (and see the "Configuring Raspbian for RaspBee" section below for instructions to configure Raspbian to allow access to the RaspBee serial hardware). 32 | 33 | Builds of this image are available on (and should be pulled from) Docker Hub or Github Container Registry, with the following tags: 34 | 35 | | Tag | Description | 36 | | ------- | ------------------------------------------------------------------------------------------- | 37 | | latest | Latest release of deCONZ, stable or beta | 38 | | stable | Stable releases of deCONZ only | 39 | | beta | Beta releases of deCONZ only | 40 | | version | Specific versions of deCONZ, use only if you wish to pin your version of deCONZ, eg 2.13.02 | 41 | 42 | The "latest", "stable", and "version" tags have multiarch support for amd64, armv7, and arm64, so specifying any of these tags will pull the correct version for your architecture. 43 | 44 | Please consult Docker Hub or Github Container Registry for the latest available versions of this image. 45 | 46 | ### Registries 47 | 48 | - Docker Hub: `docker pull deconzcommunity/deconz:latest` 49 | - Github Container Registry: `docker pull ghcr.io/deconz-community/deconz-docker:latest`, more info on can be found [here](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry) 50 | 51 | ### Running the deCONZ Container 52 | 53 | #### Pre-requisites 54 | 55 | Before running the command that creates the deconz Docker container, you may need to add your Linux user to the `dialout` group, which allows the user access to serial devices (i.e. Conbee/Conbee II/RaspBee/RaspBeeII): 56 | 57 | ```bash 58 | sudo usermod -a -G dialout $USER 59 | ``` 60 | 61 | #### Command Line 62 | 63 | ```bash 64 | docker run -d \ 65 | --name=deconz \ 66 | --restart=always \ 67 | -p 80:80 \ 68 | -p 443:443 \ 69 | -v /etc/localtime:/etc/localtime:ro \ 70 | -v /opt/deconz:/opt/deCONZ \ 71 | --device=/dev/ttyUSB0 \ 72 | deconzcommunity/deconz 73 | ``` 74 | 75 | #### Command line Options 76 | 77 | | Parameter | Description | 78 | | ------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | 79 | | `--name=deconz` | Names the container "deconz". | 80 | | `--net=host` | Uses host networking mode for proper uPNP functionality; by default, the web UIs and REST API listen on port 80 and the websockets service listens on port 443. If these ports conflict with other services on your host, you can change them through the environment variables DECONZ_WEB_PORT and DECONZ_WS_PORT described below. | 81 | | `--restart=always` | Start the container when Docker starts (i.e. on boot/reboot). | 82 | | `--privileged` | Optionnal. Give privilege to the container. It can be required if the container is unable to use the device /dev/usbXXX and the logs show errors like `Unknown device "/dev/ttyUSB0": No such device` | 83 | | `-v /etc/localtime:/etc/localtime:ro` | Ensure the container has the correct local time (alternatively, use the TZ environment variable, see below). | 84 | | `-v /opt/deconz:/opt/deCONZ` | Bind mount /opt/deconz (or the directory of your choice) into the container for persistent storage. | 85 | | `--device=/dev/ttyUSB0` | Pass the serial device at ttyUSB0 into the container for use by deCONZ (you may need to investigate which device name is assigned to your device depending on if you are also using other usb serial devices; by default ConBee = /dev/ttyUSB0, Conbee II = /dev/ttyACM0, RaspBee = /dev/ttyAMA0 or /dev/ttyS0). | 86 | | `deconzcommunity/deconz` | This image uses a manifest list for multiarch support; specifying deconzcommunity/deconz:latest or deconzcommunity/deconz:stable will pull the correct version for your arch. | 87 | 88 | #### Environment Variables 89 | 90 | Use these environment variables to change the default behaviour of the container. 91 | 92 | | Parameter | Description | 93 | | ---------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | 94 | | `-e DECONZ_WEB_PORT=8080` | By default, the web UIs ("Wireless Light Control" and "Phoscon") and the REST API listen on port 80; only set this environment variable if you wish to change the listen port. | 95 | | `-e DECONZ_WS_PORT=8443` | By default, the websockets service listens on port 443; only set this environment variable if you wish to change the listen port. | 96 | | `-e DEBUG_INFO=1` | Sets the level of the deCONZ command-line flag --dbg-info (default 1). | 97 | | `-e DEBUG_APS=0` | Sets the level of the deCONZ command-line flag --dbg-aps (default 0). | 98 | | `-e DEBUG_ZCL=0` | Sets the level of the deCONZ command-line flag --dbg-zcl (default 0). | 99 | | `-e DEBUG_ZDP=0` | Sets the level of the deCONZ command-line flag --dbg-zdp (default 0). | 100 | | `-e DEBUG_DDF=0` | Sets the level of the deCONZ command-line flag --dbg-ddf (default 0). | 101 | | `-e DEBUG_DEV=0` | Sets the level of the deCONZ command-line flag --dbg-dev (default 0). | 102 | | `-e DEBUG_OTA=0` | Sets the level of the deCONZ command-line flag --dbg-ota (default 0). | 103 | | `-e DEBUG_ERROR=0` | Sets the level of the deCONZ command-line flag --dbg-error (default 0). | 104 | | `-e DEBUG_HTTP=0` | Sets the level of the deCONZ command-line flag --dbg-http (default 0). | 105 | | `-e DECONZ_DEV_TEST_MANAGED=0` | Sets the level of the deCONZ command-line flag --dev-test-managed (default 0). | 106 | | `-e DECONZ_DEVICE=/dev/ttyUSB1` | By default, deCONZ searches for RaspBee at /dev/ttyAMA0 and Conbee at /dev/ttyUSB0; when using other USB devices (e.g. a Z-Wave stick) deCONZ may not find RaspBee/Conbee properly. Set this environment variable to the same string passed to --device to force deCONZ to use the specific USB device. | 107 | | `-e TZ=America/Toronto` | Set the local time zone so deCONZ has the correct time. | 108 | | `-e DECONZ_VNC_MODE=1` | Set this option to enable VNC access to the container to view the deCONZ ZigBee mesh | 109 | | `-e DECONZ_VNC_PORT=5900` | Default port for VNC mode is 5900; this option can be used to change this port | 110 | | `-e DECONZ_VNC_PASSWORD=changeme` | Default password for VNC mode is 'changeme'; this option can (should) be used to change the default password | 111 | | `-e DECONZ_VNC_PASSWORD_FILE=/var/secrets/my_secret` | Per default this is disabled and DECONZ_VNC_PASSWORD is used. Details on creating secrets for use with Docker containers can be found in the [corresponding section from the official documentation](https://docs.docker.com/engine/swarm/secrets/) | 112 | | `-e DECONZ_NOVNC_PORT=6080` | Default port for noVNC is 6080; this option can be used to change this port; setting the port to `0` will disable the noVNC functionality | 113 | | `-e DECONZ_UPNP=0` | Set this option to 0 to disable uPNP, see: https://github.com/dresden-elektronik/deconz-rest-plugin/issues/274 | 114 | | `-e DECONZ_UID=1000` | Set the user id of deCONZ volume | 115 | | `-e DECONZ_GID=1000` | Set the group id of deCONZ volume | 116 | | `-e DECONZ_START_VERBOSE=0` | Set this option to 0 to disable verbose of start script, set to 1 to enable `set -x` logging | 117 | | `-e DECONZ_BAUDRATE=115200` | Set the baudrate of the conbee stick, for conbee 3 this needs to be set | 118 | | `-e DECONZ_APPDATA_DIR=/opt/deCONZ` | Set an alternative appdata directory incase volume bindings are not possible, eg Home Assistant OS #232 | 119 | | `-e NON_ROOT=0` | Set this option to 1 to enable NON ROOT exectution of deconz 120 | | 121 | 122 | #### Docker-Compose 123 | 124 | A full docker-compose.yml file is provided in the root of this image's GitHub repo. You may also copy/paste the following into your existing docker-compose.yml, modifying the options as required (omit the `version` and `services` lines as your docker-compose.yml will already contain these). 125 | 126 | ```yaml 127 | version: "2" 128 | services: 129 | deconz: 130 | image: deconzcommunity/deconz 131 | container_name: deconz 132 | restart: always 133 | ports: 134 | - 80:80 135 | - 443:443 136 | volumes: 137 | - /opt/deconz:/opt/deCONZ 138 | devices: 139 | - /dev/ttyUSB0 140 | environment: 141 | - DECONZ_WEB_PORT=80 142 | - DECONZ_WS_PORT=443 143 | - DEBUG_INFO=1 144 | - DEBUG_APS=0 145 | - DEBUG_ZCL=0 146 | - DEBUG_ZDP=0 147 | - DEBUG_OTA=0 148 | ``` 149 | 150 | Then, you can do `docker-compose pull` to pull the latest deconzcommunity/deconz image, `docker-compose up -d` to start the deconz container service, and `docker-compose down` to stop the deconz service and delete the container. Note that these commands will also pull, start, and stop any other services defined in docker-compose.yml. 151 | 152 | #### Healthcheck for container status 153 | 154 | Healthcheck is used for checking Phoscon web app port for detect current healthy state of the running deCONZ container. 155 | 156 | #### Running on Docker for Mac / Docker for Windows 157 | 158 | The `--net=host` option is not yet supported on Mac/Windows. To run this container on those platforms, explicitly specify the ports in the run command and omit `--net=host`: 159 | 160 | ```bash 161 | docker run -d \ 162 | --name=deconz \ 163 | -p 80:80 \ 164 | -p 443:443 \ 165 | --restart=always \ 166 | -v /opt/deconz:/opt/deCONZ \ 167 | --device=/dev/ttyUSB0 \ 168 | -e DECONZ_WEB_PORT=80 \ 169 | -e DECONZ_WS_PORT=443 \ 170 | deconzcommunity/deconz 171 | ``` 172 | 173 | ### Configuring Raspbian for RaspBee 174 | 175 | Raspbian defaults Bluetooth to /dev/ttyAMA0 and configures a login shell over serial (tty). You must disable the tty login shell and enable the serial port hardware, and swap Bluetooth to /dev/S0, to allow RaspBee to work properly under Docker. 176 | 177 | To disable the login shell over serial and enable the serial port hardware: 178 | 179 | 1. `sudo raspi-config` 180 | 2. Select `Interfacing Options` 181 | 3. Select `Serial` 182 | 4. “Would you like a login shell to be accessible over serial?” Select `No` 183 | 5. “Would you like the serial port hardware to be enabled?” Select `Yes` 184 | 6. Exit raspi-config and reboot 185 | 186 | To swap Bluetooth to /dev/S0 (moving RaspBee to /dev/ttyAMA0), run the following command and then reboot: 187 | 188 | ```bash 189 | echo 'dtoverlay=pi3-miniuart-bt' | sudo tee -a /boot/firmware/config.txt 190 | ``` 191 | Note: On Raspbian / Debian versions earlier than Bookworm the config is located under /boot/config.txt. 192 | 193 | After running the above command and rebooting, RaspBee should be available at /dev/ttyAMA0. 194 | 195 | ### Configuring deCONZ Container for Conbee II on Raspberry Pi 196 | 197 | It may be necessary to run the deCONZ docker image in privileged mode for it to be able to connect and control a Conbee II or Raspbee device. 198 | Using a docker compose file is the easiest to do so, and you need to make sure that `privileged: true` is contained in it. 199 | 200 | Here is an example of a docker-compose file: 201 | 202 | ```yaml 203 | version: "3" 204 | services: 205 | deconz: 206 | image: deconzcommunity/deconz:stable 207 | container_name: deconz 208 | restart: always 209 | privileged: true # This is important! Without it, the deCONZ image won't be able to connect to Conbee II. 210 | ports: 211 | - 80:80 212 | - 443:443 213 | volumes: 214 | - /opt/deCONZ:/opt/deCONZ 215 | devices: 216 | - /dev/ttyACM0 # This is the USB device that Conbee II is running on. 217 | environment: 218 | - TZ=Europe/Berlin 219 | - DECONZ_WEB_PORT=80 220 | - DECONZ_WS_PORT=443 221 | - DEBUG_INFO=1 222 | - DEBUG_APS=0 223 | - DEBUG_ZCL=0 224 | - DEBUG_ZDP=0 225 | - DEBUG_OTA=0 226 | - DEBUG_HTTP=0 227 | - DECONZ_DEVICE=/dev/ttyACM0 # This is the USB device that Conbee II is running on. 228 | - DECONZ_START_VERBOSE=0 229 | ``` 230 | 231 | Also note, that the USB device where Conbee II is installed needs to be mapped into the deCONZ docker container. 232 | To find out which path Conbee II is on, you can use the following command: 233 | 234 | ```shell 235 | ls -al /dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2251419-if00 236 | 237 | # output: 238 | lrwxrwxrwx 1 root root 13 Jul 23 00:13 /dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2251419-if00 -> ../../ttyACM0 239 | ``` 240 | 241 | Note the symbolic link pointing to `/dev/ttyACM0`. That's the serial device that Conbee II USB Stick is occupying! 242 | 243 | ### Updating Conbee/RaspBee Firmware 244 | 245 | Firmware updates from the web UI will fail silently. Instead, an interactive utility script is provided as part of this Docker image that you can use to flash your device's firmware. The script has been tested and verified to work for Conbee on amd64 Debian linux and armhf Raspbian Stretch and RaspBee on armhf Raspbian Stretch. 246 | 247 | Note, however, that this way of flashing the firmware **is not guaranteed to work**. If it does it will speed up the whole process. If it doesn't you just have to update the firmware manually as described here: 248 | 249 | https://github.com/dresden-elektronik/deconz-rest-plugin/wiki/Update-deCONZ-manually 250 | 251 | This could involve that you have to plug your device into another system where the deCONZ software runs without docker (i.e. windows). 252 | 253 | The script calls the flashing tool `GCFFlasher_internal` which will output any failures. In some situations the flasher runs successfully but deCONZ couldn't be started afterwards: `disconnected device`. In all these cases you may start the process some more times and/or play with the parameters for `retries` and `timeout`. 254 | 255 | To use the script for updating the firmware, follow the below instructions: 256 | 257 | ##### 1. Check your deCONZ container logs for the update firmware file name: 258 | 259 | Type `docker logs [container name]`, and look for lines near the beginning of the log that look like this, noting the `.GCF` file name listed (you'll need this later): 260 | 261 | ``` 262 | GW update firmware found: /usr/share/deCONZ/firmware/deCONZ_Rpi_0x261e0500.bin.GCF 263 | GW firmware version: 0x261c0500 264 | GW firmware version shall be updated to: 0x261e0500 265 | ``` 266 | 267 | ##### 2. Stop your running deCONZ container. You must do this or the firmware update will fail: 268 | 269 | ```bash 270 | docker stop [container name] 271 | ``` 272 | 273 | or 274 | 275 | ```bash 276 | docker-compose down 277 | ``` 278 | 279 | ##### 3. Invoke the firmware update script: 280 | 281 | ```bash 282 | docker run -it --rm --entrypoint "/firmware-update.sh" --privileged --cap-add=ALL -v /dev:/dev -v /lib/modules:/lib/modules -v /sys:/sys deconzcommunity/deconz 283 | ``` 284 | 285 | If you have multiple usb devices, you can map the `/dev/...` volume corresponding to your Conbee/Raspbee to avoid wrong path mapping. 286 | 287 | ```bash 288 | docker run -it --rm --entrypoint "/firmware-update.sh" --privileged --cap-add=ALL -v /dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DExxxxxxx-if00:/dev/ttyACM0 -v /lib/modules:/lib/modules -v /sys:/sys deconzcommunity/deconz 289 | ``` 290 | 291 | You could also put additional options to the end of this call: 292 | 293 | ```bash 294 | docker run ... deconzcommunity/deconz [option1] [value1] [option2] [value2] ... 295 | ``` 296 | 297 | If these are valid options for the flashing tool they will be added to the call: 298 | |Option|Description|Default (if any)| 299 | |------|-----------|----------------| 300 | |`-f [firmware]`|flash firmware file|| 301 | |`-d [device]`|device number or path to use, e.g. 0, /dev/ttyUSB0 or RaspBee|The value of DECONZ_DEVICE| 302 | |`-t [timeout]`|retry until timeout (seconds) is reached|60| 303 | |`-R [retries]`|max. retries|| 304 | |`-x [loglevel]`|debug log level 0, 1, 3|| 305 | 306 | Please note that the values for device and firmware-file are still asked by the script but your options are taken as default. 307 | 308 | ##### 4. Follow the prompts: 309 | 310 | - Enter the path (e.g. `/dev/ttyUSB0`) that corresponds to your device in the listing. 311 | - Type or paste the full file name that corresponds to the file name that you found in the deCONZ container logs in step 1 (or, select a different filename, but you should have a good reason for doing this). 312 | If there are newer firmware files ([found here](https://deconz.dresden-elektronik.de/deconz-firmware/)) than the ones contained in your docker you could specify the name and the script will try to initiate a download. Just follow the prompts. 313 | - If the device/path, file name and listed options look OK, type Y to start flashing! 314 | 315 | ##### 5. Restart your deCONZ container: 316 | 317 | ```bash 318 | docker start [container name] 319 | ``` 320 | 321 | or 322 | 323 | ```bash 324 | docker-compose up 325 | ``` 326 | 327 | #### Firmware Flashing Script FAQ 328 | 329 | Q: Why does the script give an error about not being able to unload modules ftdi_sio and usbserial, or that the device couldn't be rest? 330 | 331 | A: In order to flash the device, no other program or device on the system can be using these kernel modules or the device. Stop any program/container that could be using the modules or device (likely deCONZ) and then invoke the script again. If the error persists, you may need to temporarily remove other USB serial devices from the system in order allow the script to completely unload the kernel modules. 332 | 333 | Q: Why does a flash run fail after some seconds even if I specified a timeout much longer? 334 | 335 | A: By setting a timeout you allowed the flashing tool to start as many runs as will fit into this period. The timeout of a single run can not be changed by parameters. 336 | 337 | ### Notes on OTAU (Over The Air Updates) 338 | 339 | The OTAU Plugin in deCONZ expects to find firmware files in the `/opt/deCONZ/otau` folder inside the container. 340 | 341 | ### Viewing the deCONZ ZigBee mesh with VNC 342 | 343 | Setting the environment variable DECONZ_VNC_MODE to 1 enables a VNC server in the container; connect to this VNC server with a VNC client to view the deCONZ ZigBee mesh. The environment variable DECONZ_VNC_PORT allows you to control the port the VNC server listens on (default 5900); environment variable DECONZ_VNC_PASSWORD allows you to set the password for the VNC server (default is 'changeme' and should be changed!). 344 | 345 | Note that if you are not using --host networking, you will need to add a -p directive for the DECONZ_VNC_PORT (i.e. `-p 5900:5900`). 346 | 347 | If VNC does not work and you see an error like the following in the container logs, you can resolve by incrementing the DECONZ_VNC_PORT variable (i.e. to 5901 or 5902). 348 | 349 | ``` 350 | tigervncserver: /usr/bin/Xtigervnc did not start up, please look into '/root/.vnc/debian:0.log' to determine the reason! -2 351 | Invalid MIT-MAGIC-COOKIE-1 keyqt.qpa.screen: QXcbConnection: Could not connect to display :0 352 | Could not connect to any X display. 353 | ``` 354 | 355 | By enabling VNC, per default, you also enabled noVNC which allows you to connect using a browser. Per default the port is been set to 6080 and if you are not using "--host" networking you need to open the port using the -p directive. 356 | Access is through https://hostname:6080/vnc.html, this is a self signed SSL certificate so you need to accept it before you can access the page. If you do not want to enable noVNC, you can disable it using the environment variable `DECONZ_NOVNC_PORT=0` 357 | 358 | NoVNC acts as a proxy for the VNC server, meaning that if you disable VNC functionality, noVNC will not be available either. 359 | 360 | The minimum port for DECONZ_VNC_PORT must be 5900 or higher and the minimum port for DECONZ_NOVNC_PORT must be 6080 or higher. 361 | 362 | ### Gotchas / Known Issues 363 | 364 | Firmware updates from the web UI will fail silently and the Conbee/RaspBee device will stay at its current firmware level. See "Updating Conbee/RaspBee Firmware" above for instructions to update your device's firmware when a new version is available. 365 | 366 | If you are NOT using host networking (i.e. `--net=host`), and wish to change the websocket port, make sure that both "ends" of the port directive (i.e. `-p`) are changed to match the port specified in the `DECONZ_WS_PORT` environment variable (otherwise, the websocket will not connect resulting in possibly no updating of lights, switches and sensors). For example, if you wish to change the websocket port to 4443, you must specify BOTH `-e DECONZ_WS_PORT=4443` AND `-p 4443:4443` in your `docker run` command. 367 | 368 | Over-the-air update functionality is currently untested. 369 | 370 | ### Issues / Contributing 371 | 372 | Please raise any issues with this container at its GitHub repo: https://github.com/deconz-community/deconz-docker. Please check the "Gotchas / Known Issues" section above before raising an Issue on GitHub in case the issue is already known. 373 | 374 | To contribute, please fork the GitHub repo, create a feature branch, and raise a Pull Request; for simple changes/fixes, it may be more effective to raise an Issue instead. 375 | 376 | ### Building Locally 377 | 378 | Pulling `deconzcommunity/deconz` from Docker Hub is the recommended way to obtain this image. However, you can build this image locally by: 379 | 380 | ```bash 381 | git clone https://github.com/deconz-community/deconz-docker.git 382 | cd deconz-docker 383 | docker build --build-arg VERSION=`[BUILD_VERSION]` --build-arg CHANNEL=`[BUILD_CHANNEL]` -t "[your-user/]deconz[:local]" ./Docker/ 384 | ``` 385 | 386 | | Parameter | Description | 387 | | ----------------- | ---------------------------------------------------------------------------------------------------------------------- | 388 | | `[BUILD_VERSION]` | The version of deCONZ you wish to build. | 389 | | `[BUILD_CHANNEL]` | The channel (i.e. stable or beta) that corresponds to the deCONZ version you wish to build. | 390 | | `[your-user/]` | Your username (optional). | 391 | | `deconz` | The name you want the built Docker image to have on your system (default: deconz). | 392 | | `[local]` | Adds the tag `:local` to the image (to help differentiate between this image and your locally built image) (optional). | 393 | 394 | _Note: VERSION and CHANNEL are required arguments and the image will fail to build if they are not specified._ 395 | 396 | ### Acknowledgments 397 | 398 | Dresden Elektronik for making deCONZ and the Conbee and RaspBee hardware. 399 | 400 | https://github.com/multiarch/qemu-user-static for making multi-arch builds on Travis CI possible. 401 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "2" 2 | services: 3 | deconz: 4 | image: deconzcommunity/deconz 5 | container_name: deconz 6 | restart: always 7 | ports: 8 | - 80:80 9 | - 443:443 10 | volumes: 11 | - /opt/deconz:/opt/deCONZ 12 | devices: 13 | - /dev/ttyUSB0 14 | environment: 15 | - TZ=Europe/Brussels 16 | - DECONZ_WEB_PORT=80 17 | - DECONZ_WS_PORT=443 18 | - DEBUG_INFO=1 19 | - DEBUG_APS=0 20 | - DEBUG_ZCL=0 21 | - DEBUG_ZDP=0 22 | - DEBUG_OTAU=0 23 | - DEBUG_HTTP=0 24 | - DECONZ_DEVICE=/dev/ttyUSB0 25 | - DECONZ_VNC_MODE=1 26 | - DECONZ_VNC_PORT=5900 27 | - DECONZ_VNC_PASSWORD=changeme 28 | - DECONZ_UID=1000 29 | - DECONZ_GID=1000 30 | - DECONZ_START_VERBOSE=0 31 | - DECONZ_BAUDRATE=115200 32 | logging: 33 | driver: "json-file" 34 | options: 35 | max-size: "50m" 36 | -------------------------------------------------------------------------------- /docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:12.9-slim 2 | 3 | # Build arguments 4 | ARG VERSION 5 | ARG CHANNEL 6 | ARG TARGETPLATFORM 7 | ARG BUILDPLATFORM 8 | 9 | # Runtime environment variables 10 | ENV DEBIAN_FRONTEND=noninteractive \ 11 | DECONZ_VERSION=${VERSION} \ 12 | DECONZ_WEB_PORT=80 \ 13 | DECONZ_WS_PORT=443 \ 14 | DEBUG_INFO=1 \ 15 | DEBUG_APS=0 \ 16 | DEBUG_ZCL=0 \ 17 | DEBUG_ZDP=0 \ 18 | DEBUG_DDF=0 \ 19 | DEBUG_DEV=0 \ 20 | DEBUG_OTA=0 \ 21 | DEBUG_ERROR=0 \ 22 | DEBUG_HTTP=0 \ 23 | DECONZ_DEV_TEST_MANAGED=0 \ 24 | DECONZ_DEVICE=0 \ 25 | DECONZ_VNC_MODE=0 \ 26 | DECONZ_VNC_DISPLAY=0 \ 27 | DECONZ_VNC_DISABLE_PASSWORD=0 \ 28 | DECONZ_VNC_PASSWORD=changeme \ 29 | DECONZ_VNC_PASSWORD_FILE=0 \ 30 | DECONZ_VNC_PORT=5900 \ 31 | DECONZ_NOVNC_PORT=6080 \ 32 | DECONZ_UPNP=1 \ 33 | DECONZ_UID=1000 \ 34 | DECONZ_GID=1000 \ 35 | DECONZ_START_VERBOSE=0 \ 36 | DECONZ_BAUDRATE=0 \ 37 | DECONZ_APPDATA_DIR=/opt/deCONZ \ 38 | NON_ROOT=0 39 | 40 | # Install deCONZ dependencies 41 | RUN apt-get update && \ 42 | apt-get install -y \ 43 | gosu \ 44 | curl \ 45 | kmod \ 46 | udev \ 47 | libatomic1 \ 48 | libcap2-bin \ 49 | libqt5core5a \ 50 | libqt5gui5 \ 51 | libqt5network5 \ 52 | libqt5serialport5 \ 53 | libqt5sql5 \ 54 | libqt5websockets5 \ 55 | libqt5widgets5 \ 56 | libqt5qml5 \ 57 | libssl3 \ 58 | libssl-dev \ 59 | lsof \ 60 | sqlite3 \ 61 | tigervnc-standalone-server \ 62 | tigervnc-common \ 63 | novnc \ 64 | websockify \ 65 | openbox \ 66 | xfonts-base \ 67 | xfonts-scalable && \ 68 | apt-get clean && \ 69 | rm -rf /var/lib/apt/lists/* 70 | 71 | # Workaround required on amd64 to address issue #292 72 | RUN if [ "${TARGETPLATFORM}" = "linux/amd64" ] ; then \ 73 | apt-get update && \ 74 | apt-get install -y \ 75 | binutils && \ 76 | apt-get clean && \ 77 | rm -rf /var/lib/apt/lists/* && \ 78 | strip --remove-section=.note.ABI-tag /usr/lib/x86_64-linux-gnu/libQt5Core.so.5 ; fi 79 | 80 | # Add start.sh and Conbee udev data; set execute permissions 81 | COPY root / 82 | RUN chmod +x /start.sh && \ 83 | chmod +x /firmware-update.sh 84 | 85 | # Make user 86 | RUN groupadd -g ${DECONZ_GID} "deconz" && \ 87 | useradd -u ${DECONZ_UID} -g "deconz" -G dialout -ms /bin/bash "deconz" 88 | 89 | # Add deCONZ, install deCONZ, make OTAU dir 90 | COPY download-deconz.sh / 91 | 92 | RUN chmod +x /download-deconz.sh && /download-deconz.sh ${VERSION} ${CHANNEL} ${TARGETPLATFORM} 93 | 94 | RUN dpkg -i /deconz.deb && \ 95 | chown root:root /usr/bin/deCONZ* && \ 96 | setcap CAP_NET_BIND_SERVICE=+eip /usr/bin/deCONZ && \ 97 | rm -f /deconz.deb 98 | 99 | VOLUME [ "/opt/deCONZ" ] 100 | 101 | HEALTHCHECK --interval=10s --timeout=20s --retries=5 CMD curl -I 127.0.0.1:${DECONZ_WEB_PORT} || exit 1 102 | 103 | EXPOSE ${DECONZ_WEB_PORT} ${DECONZ_WS_PORT} ${DECONZ_VNC_PORT} ${DECONZ_NOVNC_PORT} 104 | 105 | ENTRYPOINT [ "/start.sh" ] 106 | -------------------------------------------------------------------------------- /docker/download-deconz.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -ex 4 | 5 | DECONZ_VERSION=$1 6 | CHANNEL=$2 7 | PLATFORM=$3 8 | 9 | if echo "${PLATFORM}" | grep -qE "arm64"; then 10 | URL="http://deconz.dresden-elektronik.de/debian/${CHANNEL}/deconz_${DECONZ_VERSION}-debian-buster-${CHANNEL}_arm64.deb" 11 | fi 12 | if echo "${PLATFORM}" | grep -qE "amd64"; then 13 | URL="http://deconz.dresden-elektronik.de/ubuntu/${CHANNEL}/deconz-${DECONZ_VERSION}-qt5.deb" 14 | fi 15 | if echo "${PLATFORM}" | grep -qE "v7"; then 16 | URL="http://deconz.dresden-elektronik.de/raspbian/${CHANNEL}/deconz-${DECONZ_VERSION}-qt5.deb" 17 | fi 18 | 19 | curl -vv "${URL}" -o /deconz${DEV}.deb 20 | -------------------------------------------------------------------------------- /docker/root/firmware-update.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # =========================== 4 | # Configuration 5 | # =========================== 6 | VERSION=0.9 7 | # --------------------------- 8 | # Flasher and options 9 | # --------------------------- 10 | FLASHER=/usr/bin/GCFFlasher_internal 11 | FLASHER_PARAM_LIST=( -d -f -t -x ) 12 | typeset -A FLASHER_PARAM_NAMES=( # GCFFlasher 13 | # -r force device reset without programming 14 | [-f]="Firmware file" # -f flash firmware file 15 | [-d]="Device path ." # -d device number or path to use, e.g. 0, /dev/ttyUSB0 or RaspBee 16 | [-c]="Debug serial " # -c connect and debug serial protocol 17 | [-t]="Timeout ....." # -t retry until timeout (seconds) is reached 18 | # -l list devices 19 | [-x]="Loglevel ...." # -x debug log level 0, 1, 3 20 | # -h -? print this help 21 | ) 22 | typeset -A FLASHER_PARAM_PRINT=( 23 | [-f]="[^/]*$" 24 | [default]=".*" 25 | ) 26 | # Default values 27 | typeset -A FLASHER_PARAM_VALUES=( 28 | [-d]="$DECONZ_DEVICE" 29 | [-t]="60" 30 | ) 31 | 32 | # --------------------------- 33 | # Firmware details 34 | # --------------------------- 35 | FW_PATH=/tmp 36 | typeset -A FW_ONLINE_BASES=( 37 | [stable]="http://deconz.dresden-elektronik.de/deconz-firmware/" 38 | [beta]="http://deconz.dresden-elektronik.de/deconz-firmware/beta/" 39 | ) 40 | FW_ONLINE_BASE_ORDER=( stable beta ) 41 | 42 | # =========================== 43 | # exit functions 44 | # =========================== 45 | # --------------------------- 46 | # Exit the script 47 | # - on exit print 1st param or "Exiting..." as message 48 | # - use 2nd param or 1 as exit-code 49 | # --------------------------- 50 | function exit_with_error() { 51 | typeset msg="${1:-Exiting...}" 52 | typeset -i retVal="${2:-1}" 53 | printf "\n%s\n\n" "$msg" 54 | exit $retVal 55 | } 56 | 57 | # --------------------------- 58 | # Check last return-code or 2nd param 59 | # - if non-zero exit with message 60 | # - on exit print 1st param or "Exiting..." as message 61 | # --------------------------- 62 | function exit_on_error() { 63 | typeset -i retVal="${2:-$?}" 64 | typeset msg="$1" 65 | (( retVal == 0 )) || exit_with_error "$msg" $retVal 66 | } 67 | 68 | # --------------------------- 69 | # Check last return-code or 3rd param 70 | # - if non-zero exit with message 71 | # - on exit remove file (1st param) if present 72 | # - on exit print 2nd param or "Exiting..." as message 73 | # --------------------------- 74 | function delete_and_exit_on_error() { 75 | typeset -i retVal="${3:-$?}" 76 | typeset file="$1" 77 | typeset msg="$2" 78 | if (( retVal != 0 )); then 79 | [[ -f $file ]] && rm "$file" 80 | exit_with_error "$msg" $retVal 81 | fi 82 | } 83 | 84 | # --------------------------- 85 | # Check 1st param as user-input 86 | # - exit script on empty input 87 | # --------------------------- 88 | function exit_on_enter() { 89 | typeset input="$1" 90 | [[ -n $input ]] || exit_with_error 91 | } 92 | 93 | # =========================== 94 | # utility functions 95 | # =========================== 96 | # --------------------------- 97 | # Parse all options passed to the script. 98 | # Options of the flasher are valid options. 99 | # --------------------------- 100 | function parse_options() { 101 | while (( $# > 0)); do 102 | [[ -n ${FLASHER_PARAM_NAMES[$1]} ]] || exit_with_error "Unknown argument '$1'. Exiting ..." 103 | FLASHER_PARAM_VALUES[$1]="$2" 104 | shift 2 105 | done 106 | } 107 | 108 | echo "-------------------------------------------------------------------" 109 | echo " " 110 | echo " deconzcommunity/deconz Firmware Flashing Script" 111 | echo " " 112 | echo " Version: $VERSION" 113 | echo " " 114 | echo "-------------------------------------------------------------------" 115 | echo " " 116 | 117 | parse_options "$@" 118 | 119 | echo " " 120 | echo "Listing attached devices..." 121 | echo " " 122 | 123 | $FLASHER -l 124 | 125 | echo " " 126 | echo "Enter the full device path, or press Enter now to exit." 127 | echo " " 128 | 129 | param=-d 130 | read -ep "${FLASHER_PARAM_NAMES[$param]}: " -i "${FLASHER_PARAM_VALUES[$param]}" FLASHER_PARAM_VALUES[$param] 131 | exit_on_enter ${FLASHER_PARAM_VALUES[$param]} 132 | 133 | echo " " 134 | echo "-------------------------------------------------------------------" 135 | echo " " 136 | echo "Firmware available for flashing:" 137 | ls -1 "$FW_PATH" 138 | 139 | echo " " 140 | echo "Enter the firmware file name from above, including extension." 141 | echo "Alternatively, you may enter the name of a firmware file to download" 142 | echo "from any of the following sources:" 143 | for base in "${FW_ONLINE_BASE_ORDER[@]}"; do 144 | printf " - %-60s (%s)\n" "${FW_ONLINE_BASES[$base]}" "$base" 145 | done 146 | echo " " 147 | echo "If you wish to exit, just hit Enter." 148 | echo " " 149 | 150 | param=-f 151 | read -ep "${FLASHER_PARAM_NAMES[$param]}: " -i "${FLASHER_PARAM_VALUES[$param]##*/}" fileName 152 | exit_on_enter $fileName 153 | FLASHER_PARAM_VALUES[$param]="${FW_PATH%/}/$fileName" 154 | 155 | echo " " 156 | if [[ ! -f ${FLASHER_PARAM_VALUES[-f]} ]]; then 157 | for base in "${FW_ONLINE_BASE_ORDER[@]}"; do 158 | fw_url="${FW_ONLINE_BASES[$base]%/}/$fileName" 159 | curl --fail --silent --head --output /dev/null "$fw_url" && break 160 | done 161 | exit_on_error "Can't find '$fileName' neither locally nor online. Exiting ..." 162 | read -ep "File not found locally. Enter Y to download from ${fw_url}: " answer 163 | [[ $answer == [yY] ]] || exit_with_error 164 | 165 | echo " " 166 | echo "Downloading..." 167 | echo " " 168 | curl --fail --output "${FLASHER_PARAM_VALUES[-f]}" "${fw_url}" && [[ -f ${FLASHER_PARAM_VALUES[-f]} ]] 169 | delete_and_exit_on_error "${FLASHER_PARAM_VALUES[-f]}" "Download Error! Please re-run this script..." 170 | echo " " 171 | echo "Download complete! Checking md5 checksum..." 172 | md5=$(curl --fail --silent "${fw_url}.md5") 173 | [[ -n $md5 ]] || delete_and_exit_on_error "${FLASHER_PARAM_VALUES[-f]}" "Checksum file '${fileName}.md5' not found! Please re-run this script..." 174 | echo "${md5% *} ${FLASHER_PARAM_VALUES[-f]}" | md5sum --check 175 | delete_and_exit_on_error "${FLASHER_PARAM_VALUES[-f]}" "Error comparing checksums! Please re-run this script..." 176 | echo " " 177 | fi 178 | 179 | echo "-------------------------------------------------------------------" 180 | echo " " 181 | FLASHER_PARAMS=() 182 | for param in "${FLASHER_PARAM_LIST[@]}"; do 183 | value="${FLASHER_PARAM_VALUES[$param]}" 184 | [[ -n $value ]] || continue 185 | FLASHER_PARAMS+=( "$param" "$value" ) 186 | 187 | pattern="${FLASHER_PARAM_PRINT[$param]-${FLASHER_PARAM_PRINT[default]}}" 188 | [[ $value =~ $pattern ]] && printf "%s: %s\n" "${FLASHER_PARAM_NAMES[$param]}" "${BASH_REMATCH}" 189 | done 190 | 191 | echo " " 192 | echo "Are the above values correct?" 193 | read -ep "Enter Y to proceed, any other entry to exit: " correctVal 194 | [[ $correctVal == [yY] ]] || exit_with_error 195 | 196 | echo " " 197 | echo "Flashing..." 198 | echo " " 199 | $FLASHER "${FLASHER_PARAMS[@]}" 200 | exit_on_error "Flashing Error! Please re-run this script..." 201 | -------------------------------------------------------------------------------- /docker/root/run/udev/data/c166:0: -------------------------------------------------------------------------------- 1 | E:ID_VENDOR_ID=1cf1 2 | E:ID_MODEL_ID=0030 3 | -------------------------------------------------------------------------------- /docker/root/run/udev/data/c188:0: -------------------------------------------------------------------------------- 1 | E:ID_VENDOR_ID=0403 2 | E:ID_MODEL_ID=6015 3 | -------------------------------------------------------------------------------- /docker/root/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ "$DECONZ_START_VERBOSE" = 1 ]; then 4 | set -x 5 | fi 6 | 7 | 8 | echo "[deconzcommunity/deconz] Starting deCONZ..." 9 | echo "[deconzcommunity/deconz] Current deCONZ version: $DECONZ_VERSION" 10 | echo "[deconzcommunity/deconz] Web UI port: $DECONZ_WEB_PORT" 11 | echo "[deconzcommunity/deconz] Websockets port: $DECONZ_WS_PORT" 12 | 13 | DECONZ_OPTS="--auto-connect=1 \ 14 | --appdata=$DECONZ_APPDATA_DIR \ 15 | --dbg-info=$DEBUG_INFO \ 16 | --dbg-aps=$DEBUG_APS \ 17 | --dbg-zcl=$DEBUG_ZCL \ 18 | --dbg-ddf=$DEBUG_DDF \ 19 | --dbg-dev=$DEBUG_DEV \ 20 | --dbg-zdp=$DEBUG_ZDP \ 21 | --dbg-ota=$DEBUG_OTA \ 22 | --dbg-error=$DEBUG_ERROR \ 23 | --dbg-http=$DEBUG_HTTP \ 24 | --dev-test-managed=$DECONZ_DEV_TEST_MANAGED \ 25 | --http-port=$DECONZ_WEB_PORT \ 26 | --ws-port=$DECONZ_WS_PORT" 27 | 28 | if [ "$NON_ROOT" = 0 ]; then 29 | GOSU="gosu deconz" 30 | else 31 | GOSU="" 32 | fi 33 | 34 | if [ "$DECONZ_BAUDRATE" != 0 ]; then 35 | DECONZ_OPTS="$DECONZ_OPTS --baudrate=$DECONZ_BAUDRATE" 36 | fi 37 | 38 | echo "[deconzcommunity/deconz] Using options" $DECONZ_OPTS 39 | 40 | echo "[deconzcommunity/deconz] Modifying user and group ID" 41 | if [ "$DECONZ_UID" != 1000 ]; then 42 | DECONZ_UID=${DECONZ_UID:-1000} 43 | usermod -o -u "$DECONZ_UID" deconz 44 | fi 45 | if [ "$DECONZ_GID" != 1000 ]; then 46 | DECONZ_GID=${DECONZ_GID:-1000} 47 | groupmod -o -g "$DECONZ_GID" deconz 48 | fi 49 | 50 | echo "[deconzcommunity/deconz] Checking device group ID" 51 | if [ "$DECONZ_DEVICE" != 0 ]; then 52 | DEVICE=$DECONZ_DEVICE 53 | else 54 | if [ -e /dev/ttyUSB0 ]; then 55 | DEVICE=/dev/ttyUSB0 56 | fi 57 | if [ -e /dev/ttyACM0 ]; then 58 | DEVICE=/dev/ttyACM0 59 | fi 60 | if [ -e /dev/ttyAMA0 ]; then 61 | DEVICE=/dev/ttyAMA0 62 | fi 63 | if [ -e /dev/ttyS0 ]; then 64 | DEVICE=/dev/ttyS0 65 | fi 66 | fi 67 | 68 | DIALOUTGROUPID=$(stat --printf='%g' $DEVICE) 69 | DIALOUTGROUPID=${DIALOUTGROUPID:-20} 70 | if [ "$DIALOUTGROUPID" != 20 ]; then 71 | groupmod -o -g "$DIALOUTGROUPID" dialout 72 | fi 73 | 74 | #workaround if the group of the device doesn't have any permissions 75 | GROUPPERMISSIONS=$(stat -c "%A" $DEVICE | cut -c 5-7) 76 | if [ "$GROUPPERMISSIONS" = "---" ]; then 77 | chmod g+rw $DEVICE 78 | fi 79 | 80 | if [ "$DECONZ_VNC_MODE" != 0 ]; then 81 | 82 | if [ "$DECONZ_VNC_PORT" -lt 5900 ]; then 83 | echo "[deconzcommunity/deconz] ERROR - VNC port must be 5900 or greater!" 84 | exit 1 85 | fi 86 | 87 | DECONZ_VNC_DISPLAY=:$(($DECONZ_VNC_PORT - 5900)) 88 | echo "[deconzcommunity/deconz] VNC port: $DECONZ_VNC_PORT" 89 | 90 | if [ ! -e $DECONZ_APPDATA_DIR/vnc ]; then 91 | mkdir -p $DECONZ_APPDATA_DIR/vnc 92 | fi 93 | 94 | ln -sfT $DECONZ_APPDATA_DIR/vnc /home/deconz/.vnc 95 | chown deconz:deconz /home/deconz/.vnc 96 | chown deconz:deconz $DECONZ_APPDATA_DIR -R 97 | 98 | echo "[deconzcommunity/deconz] VNC DISABLE PASSWORD: $DECONZ_VNC_DISABLE_PASSWORD" 99 | if [ "$DECONZ_VNC_DISABLE_PASSWORD" = 0 ]; then 100 | # Set VNC password 101 | if [ "$DECONZ_VNC_PASSWORD_FILE" != 0 ] && [ -f "$DECONZ_VNC_PASSWORD_FILE" ]; then 102 | DECONZ_VNC_PASSWORD=$(cat $DECONZ_VNC_PASSWORD_FILE) 103 | fi 104 | 105 | echo "$DECONZ_VNC_PASSWORD" | tigervncpasswd -f >$DECONZ_APPDATA_DIR/vnc/passwd 106 | chmod 600 $DECONZ_APPDATA_DIR/vnc/passwd 107 | chown deconz:deconz $DECONZ_APPDATA_DIR/vnc/passwd 108 | SECURITYTYPES="VncAuth,TLSVnc" 109 | else 110 | SECURITYTYPES="None,TLSNone" 111 | fi 112 | 113 | # Check if hostname is valid, otherwise apply fix 114 | tigervncserver -version >/dev/null 2>&1 115 | if [ $? != 0 ]; then 116 | echo "[deconzcommunity/deconz] Applying hostname fix to avoid tigervncserver crash" 117 | echo '127.0.0.1 deconz' >>/etc/hosts 118 | echo 'deconz' >/etc/hostname 119 | hostname deconz 120 | fi 121 | 122 | # Cleanup previous VNC session data 123 | $GOSU tigervncserver -kill ':*' 124 | $GOSU tigervncserver -list ':*' -cleanstale 125 | for lock in "/tmp/.X${DECONZ_VNC_DISPLAY#:}-lock" "/tmp/.X11-unix/X${DECONZ_VNC_DISPLAY#:}"; do 126 | [ -e "$lock" ] || continue 127 | echo "[deconzcommunity/deconz] WARN - VNC-lock found. Deleting: $lock" 128 | rm "$lock" 129 | done 130 | 131 | # Set VNC security 132 | $GOSU tigervncserver -SecurityTypes "$SECURITYTYPES" -PasswordFile $DECONZ_APPDATA_DIR/vnc/passwd "$DECONZ_VNC_DISPLAY" 133 | 134 | # Export VNC display variable 135 | export DISPLAY=$DECONZ_VNC_DISPLAY 136 | 137 | if [ "$DECONZ_NOVNC_PORT" = 0 ]; then 138 | echo "[deconzcommunity/deconz] noVNC Disabled" 139 | else 140 | if [ "$DECONZ_NOVNC_PORT" -lt 6080 ]; then 141 | echo "[deconzcommunity/deconz] ERROR - NOVNC port must be 6080 or greater!" 142 | exit 1 143 | fi 144 | 145 | # Assert valid SSL certificate 146 | NOVNC_CERT="$DECONZ_APPDATA_DIR/vnc/novnc.pem" 147 | if [ -f "$NOVNC_CERT" ]; then 148 | openssl x509 -noout -in "$NOVNC_CERT" -checkend 0 >/dev/null 149 | if [ $? != 0 ]; then 150 | echo "[deconzcommunity/deconz] The noVNC SSL certificate has expired; generating a new certificate now." 151 | rm "$NOVNC_CERT" 152 | fi 153 | fi 154 | if [ ! -f "$NOVNC_CERT" ]; then 155 | openssl req -x509 -nodes -newkey rsa:2048 -keyout "$NOVNC_CERT" -out "$NOVNC_CERT" -days 365 -subj "/CN=deconz" 156 | fi 157 | 158 | chown deconz:deconz $NOVNC_CERT 159 | 160 | #Start noVNC 161 | $GOSU websockify -D --web=/usr/share/novnc/ --cert="$NOVNC_CERT" $DECONZ_NOVNC_PORT localhost:$DECONZ_VNC_PORT 162 | echo "[deconzcommunity/deconz] NOVNC port: $DECONZ_NOVNC_PORT" 163 | fi 164 | 165 | else 166 | echo "[deconzcommunity/deconz] VNC Disabled" 167 | DECONZ_OPTS="$DECONZ_OPTS -platform minimal" 168 | fi 169 | 170 | if [ "$DECONZ_DEVICE" != 0 ]; then 171 | DECONZ_OPTS="$DECONZ_OPTS --dev=$DECONZ_DEVICE" 172 | fi 173 | 174 | if [ "$DECONZ_UPNP" != 1 ]; then 175 | DECONZ_OPTS="$DECONZ_OPTS --upnp=0" 176 | fi 177 | 178 | mkdir -p $DECONZ_APPDATA_DIR/otau 179 | ln -sfT $DECONZ_APPDATA_DIR/otau /home/deconz/otau 180 | chown deconz:deconz /home/deconz/otau 181 | chown deconz:deconz $DECONZ_APPDATA_DIR -R 182 | 183 | exec $GOSU /usr/bin/deCONZ $DECONZ_OPTS 184 | -------------------------------------------------------------------------------- /version.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.30.2", 3 | "channel": "stable" 4 | } 5 | --------------------------------------------------------------------------------