Code Monkey home page Code Monkey logo

gateway-docker's Introduction

⚠️ Note: This repo has been deprecated. The WebThings Gateway docker image can now be built from the main gateway repository. See README.docker.md.

Docker Mozilla WebThings Gateway

Docker image based on Debian Buster for running the Mozilla WebThings Gateway. The image is built for AMD64, ARMv7, and ARMv8 (AArch64).

Compatibility

While the gateway doesn't necessarily require full local network access, some add-ons may. Therefore, it is best to run with the --network="host" flag. Currently, this flag will not work when using Docker for Mac or Docker for Windows due to this and this.

Usage

  • On Linux:

    docker run \
        -d \
        -e TZ=America/Los_Angeles \
        -v /path/to/shared/data:/home/node/.mozilla-iot \
        --network="host" \
        --log-opt max-size=1m \
        --log-opt max-file=10 \
        --name webthings-gateway \
        mozillaiot/gateway:latest
  • On Windows or macOS:

    docker run \
        -d \
        -p 8080:8080 \
        -p 4443:4443 \
        -e TZ=America/Los_Angeles \
        -v /path/to/shared/data:/home/node/.mozilla-iot \
        --log-opt max-size=1m \
        --log-opt max-file=10 \
        --name webthings-gateway \
        mozillaiot/gateway:latest

Parameters

  • -d - Run in daemon mode (in the background)
  • -e TZ=America/Los_Angeles - Set the time zone to America/Los_Angeles. The list of names can be found here.
  • -v /path/to/shared/data:/home/node/.mozilla-iot - Change /path/to/shared/data to some local path. We are mounting a directory on the host to the container in order to store the persistent "user profile" data, e.g. add-ons, logs, configuration data, etc.
  • --network="host" - Shares host networking with container (highly recommended, needed by some addons, -p is ignored if this option is used).
  • -p 8080:8080 / -p 4443:4443 - Forward necessary ports to the container (ignored if --network="host" is present).
  • --log-opt max-size=1m - limit the log size to 1 MB
  • --log-opt max-file=10 - limit the number of saved log files to 10
  • --name webthings-gateway - Name of the container.

Changing ports in --network="host" mode

Create a file local.json and map it to /path/to/shared/data/config/local.json (where /path/to/shared/data is the volume mounted to /home/node/.mozilla-iot). Contents of the file:

{
  "ports": {
    "https": 8081,
    "http": 8080
  }
}

Edit the ports as you like.

Using docker-compose

docker-compose up -d

Connecting

After running the container, you can connect to it at: http://<host-ip-address>:8080

Building

If you'd like to build an image yourself, run the following:

git clone https://github.com/mozilla-iot/gateway-docker
cd gateway-docker
docker build -t gateway .
docker run \
    -d \
    -e TZ=America/Los_Angeles \
    -v /path/to/shared/data:/home/node/.mozilla-iot \
    --network="host" \
    --log-opt max-size=1m \
    --log-opt max-file=10 \
    --name webthings-gateway \
    gateway

You can add the following build args:

  • --build-arg "gateway_url=https://github.com/<your-fork>/gateway"
  • --build-arg "gateway_branch=<your-branch>"
  • --build-arg "gateway_addon_version=<your-version>"

Notes

  • If you need to use Zigbee, Z-Wave, or some other add-on which requires physically attached hardware, you will have to share your device into your container, e.g. --device /dev/ttyACM0:/dev/ttyACM0. They will also need to be owned by GID 20, which corresponds to the dialout group in the container. This can be done using udev rules or something else.
  • If you need to use GPIO in the container (e.g. on a Raspberry Pi host), you will need to either run in privileged mode with --privileged or share in your sysfs filesystem with -v /sys:/sys. The sysfs nodes will also need to be owned by GID 997, which corresponds to the gpio group in the container.
  • If you need to use Bluetooth in the container, you will need to disable BlueZ on the host (if running), e.g. systemctl disable bluetooth, and you will need to run the container in privileged mode, i.e. --privileged.

gateway-docker's People

Contributors

benfrancis avatar kmehant avatar mozilla-github-standards avatar mrstegeman avatar rmeissn avatar rzr avatar snorp avatar white-gecko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gateway-docker's Issues

Docker Hub releases do not have tags with associated mozilla-iot/gateway versions

Docker is built and only has latest tag, during the building of image a git clone is issued and the latest commits from mozilla-iot/gateway master branch are cloned. This might contain newer, possibly breaking, features which are not in the latest release.

To improve stability it would be wise to match the Docker Hub releases with stable mozilla-iot/gateway releases via tagging. To lower the required maintenance of Docker images this process could be automated by CI server.

Avahi - daemon already running

My container logs are spammed with the following message:

Daemon already running on PID X

The PID inside the container corresponds to the avahi daemon.
It has started after the upgrade from 0.9.2 version of the image (most likely after #28).

I am running the container with "network_mode: host" on Raspberry PI, which already has the avahi daemon running on the host.

Environment:

Raspberry Pi 4
Raspbian 10
Docker version 19.03.5, build 633a0ea
Image: mozillaiot/gateway:0.10.0-arm

docker-compose.yml:

version: "3"

services:
  webthings-gateway:
    container_name: webthings-gateway
    image: mozillaiot/gateway:arm
    restart: unless-stopped
    network_mode: host
    ports:
      - "8080:8080"
      - "4443:4443"
    volumes:
      - ./data:/home/node/.mozilla-iot

Developing addon requires container restart on every code change

I am using Docker image of the gateway to develop an addon on MacOS. I was able to run container with mounted volume but it looks every change in addon source code requires me to kill and re-run container again. Surely I am doing something wrong here? Please advise.

This is how I run the container:

docker run \
    -p 8080:8080 \
    -p 4443:4443 \
    -e TZ=America/Los_Angeles \
    -v /path/to/data/on/host:/home/node/.mozilla-iot \
    --log-opt max-size=1m \
    --log-opt max-file=10 \
    --name webthings-gateway \
    mozillaiot/gateway:latest

Addon code is placed at /path/to/data/on/host/addons/my-addon.

Please note I removed running it in detached mode to see logs in terminal. The rest is taken directly from README.md.

Permission errors with volumes created by `docker volume`

I'm running into permissions errors when bind mounting a volume created with docker volume:

$ docker volume create my-docker-volume
$ docker run -d -p 8080:8080 -p 4443:4443 -v my-docker-volume:/home/node/.mozilla-iot --name mozilla-iot-gateway mozillaiot/gateway
$ docker logs mozilla-iot-gateway
+ MOZIOT_HOME=/home/node/.mozilla-iot
+ args=
+ start_task=start
+ is_docker_container
+ '[' -f /.dockerenv ']'
+ return 0
+ mkdir -p /home/node/.mozilla-iot/log
mkdir: cannot create directory '/home/node/.mozilla-iot/log': Permission denied

That error just gets repeated forever.

If I create a directory on my machine directly and bind mount that, everything works as expected, so it seems to be specific to Docker-managed volumes.

Fails to work with "Mozilla IoT Philips Hue Adapter"

Not much more to it than the title indicates:

Latest Docker Image that can be pulled, installing the single addon "Mozilla IoT Philips Hue Adapter" and attempting to find the Hue Bridge then fails.

Manually sending commands through Curl does seem to work from within the Docker (using exec).

Fails to build on raspberry pi 3

I get an error when I try to build docker container on raspberry pi 3

E: Package 'nodejs' has no installation candidate

Full log:

% docker build -t gateway .
Sending build context to Docker daemon  83.97kB
Step 1/5 : FROM debian:stretch
stretch: Pulling from library/debian
25301cba2d4e: Pull complete
Digest: sha256:f7ca2200b10b859910a861d54229753b5aed94bb5c8f4321e10ec880b0909a3b
Status: Downloaded newer image for debian:stretch
 ---> f4eb764ab34f
Step 2/5 : EXPOSE 8080 4443
 ---> Running in 2712a64d4a72
Removing intermediate container 2712a64d4a72
 ---> 9d8c021d487e
Step 3/5 : RUN echo "deb http://ftp.debian.org/debian stretch-backports main" >> /etc/apt/sources.list &&     apt update &&     apt install -y curl gnupg2 &&     curl -sL https://deb.nodesource.com/setup_8.x | bash - &&     apt update &&     apt dist-upgrade &&     apt install -y         build-essential         certbot         cron         git         libffi-dev         libnanomsg-dev         libnanomsg4         libopenzwave1.5         libopenzwave1.5-dev         nodejs         npm         python         python-pip         python-setuptools         python3         python3-pip         python3-setuptools         runit         sudo &&     npm install -g yarn &&     rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* &&     pip2 install git+https://github.com/mozilla-iot/gateway-addon-python#egg=gateway_addon &&     pip3 install git+https://github.com/mozilla-iot/gateway-addon-python#egg=gateway_addon &&     pip2 install git+https://github.com/mycroftai/adapt#egg=adapt-parser &&     pip3 install git+https://github.com/mycroftai/adapt#egg=adapt-parser &&     curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash &&     useradd -m -s /bin/bash -G sudo user &&     cd /home/user &&     mkdir mozilla-iot &&     cd mozilla-iot &&     git clone https://github.com/mozilla-iot/intent-parser &&     git clone https://github.com/mozilla-iot/gateway &&     cd gateway &&     yarn &&     chown -R user:user /home/user &&     touch /etc/inittab &&     echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers &&     echo "0 */12 * * * root /home/user/mozilla-iot/gateway/tools/renew-certificates.sh" > /etc/cron.d/renew-certs
 ---> Running in be4c4592072e

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Ign:1 http://deb.debian.org/debian stretch InRelease
Get:2 http://security.debian.org stretch/updates InRelease [63.0 kB]
Get:3 http://deb.debian.org/debian stretch-updates InRelease [91.0 kB]
Get:4 http://ftp.debian.org/debian stretch-backports InRelease [91.8 kB]
Get:5 http://deb.debian.org/debian stretch Release [118 kB]
Get:6 http://deb.debian.org/debian stretch Release.gpg [2434 B]
Get:7 http://security.debian.org stretch/updates/main armel Packages [421 kB]
Get:8 http://deb.debian.org/debian stretch-updates/main armel Packages [8368 B]
Get:9 http://ftp.debian.org/debian stretch-backports/main armel Packages [331 kB]
Get:10 http://deb.debian.org/debian stretch/main armel Packages [9263 kB]
Fetched 10.4 MB in 9s (1130 kB/s)
Reading package lists...
Building dependency tree...
Reading state information...
All packages are up to date.

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Reading package lists...
Building dependency tree...
Reading state information...
The following additional packages will be installed:
  ca-certificates dirmngr gnupg gnupg-agent gnupg-l10n krb5-locales libassuan0
  libcurl3 libffi6 libgmp10 libgnutls30 libgssapi-krb5-2 libhogweed4 libidn11
  libidn2-0 libk5crypto3 libkeyutils1 libkrb5-3 libkrb5support0 libksba8
  libldap-2.4-2 libldap-common libnettle6 libnghttp2-14 libnpth0 libp11-kit0
  libpsl5 libreadline7 librtmp1 libsasl2-2 libsasl2-modules
  libsasl2-modules-db libsqlite3-0 libssh2-1 libssl1.0.2 libssl1.1 libtasn1-6
  libunistring0 openssl pinentry-curses publicsuffix readline-common
Suggested packages:
  dbus-user-session libpam-systemd pinentry-gnome3 tor parcimonie xloadimage
  scdaemon gnutls-bin krb5-doc krb5-user libsasl2-modules-gssapi-mit
  | libsasl2-modules-gssapi-heimdal libsasl2-modules-ldap libsasl2-modules-otp
  libsasl2-modules-sql pinentry-doc readline-doc
The following NEW packages will be installed:
  ca-certificates curl dirmngr gnupg gnupg-agent gnupg-l10n gnupg2
  krb5-locales libassuan0 libcurl3 libffi6 libgmp10 libgnutls30
  libgssapi-krb5-2 libhogweed4 libidn11 libidn2-0 libk5crypto3 libkeyutils1
  libkrb5-3 libkrb5support0 libksba8 libldap-2.4-2 libldap-common libnettle6
  libnghttp2-14 libnpth0 libp11-kit0 libpsl5 libreadline7 librtmp1 libsasl2-2
  libsasl2-modules libsasl2-modules-db libsqlite3-0 libssh2-1 libssl1.0.2
  libssl1.1 libtasn1-6 libunistring0 openssl pinentry-curses publicsuffix
  readline-common
0 upgraded, 44 newly installed, 0 to remove and 0 not upgraded.
Need to get 11.1 MB of archives.
After this operation, 28.1 MB of additional disk space will be used.
Get:1 http://security.debian.org stretch/updates/main armel libcurl3 armel 7.52.1-5+deb9u5 [261 kB]
Get:2 http://deb.debian.org/debian stretch/main armel libassuan0 armel 2.4.3-2 [36.4 kB]
Get:3 http://deb.debian.org/debian stretch/main armel pinentry-curses armel 1.0.0-2 [46.9 kB]
Get:4 http://deb.debian.org/debian stretch/main armel libnpth0 armel 1.3-1 [13.6 kB]
Get:5 http://deb.debian.org/debian stretch/main armel readline-common all 7.0-3 [70.4 kB]
Get:6 http://security.debian.org stretch/updates/main armel curl armel 7.52.1-5+deb9u5 [224 kB]
Get:7 http://deb.debian.org/debian stretch/main armel libreadline7 armel 7.0-3 [130 kB]
Get:8 http://deb.debian.org/debian stretch/main armel gnupg-agent armel 2.1.18-8~deb9u1 [509 kB]
Get:9 http://deb.debian.org/debian stretch/main armel libksba8 armel 1.3.5-2 [85.4 kB]
Get:10 http://deb.debian.org/debian stretch/main armel libsqlite3-0 armel 3.16.2-5+deb9u1 [495 kB]
Get:11 http://deb.debian.org/debian stretch/main armel gnupg armel 2.1.18-8~deb9u1 [1049 kB]
Get:12 http://deb.debian.org/debian stretch/main armel libssl1.0.2 armel 1.0.2l-2+deb9u2 [897 kB]
Get:13 http://deb.debian.org/debian stretch/main armel libssl1.1 armel 1.1.0f-3+deb9u1 [1109 kB]
Get:14 http://deb.debian.org/debian stretch/main armel krb5-locales all 1.15-1+deb9u1 [93.8 kB]
Get:15 http://deb.debian.org/debian stretch/main armel libgmp10 armel 2:6.1.2+dfsg-1 [190 kB]
Get:16 http://deb.debian.org/debian stretch/main armel libnettle6 armel 3.3-1+b2 [206 kB]
Get:17 http://deb.debian.org/debian stretch/main armel libhogweed4 armel 3.3-1+b2 [126 kB]
Get:18 http://deb.debian.org/debian stretch/main armel libidn11 armel 1.33-1 [112 kB]
Get:19 http://deb.debian.org/debian stretch/main armel libffi6 armel 3.2.1-6 [18.7 kB]
Get:20 http://deb.debian.org/debian stretch/main armel libp11-kit0 armel 0.23.3-2 [94.6 kB]
Get:21 http://deb.debian.org/debian stretch/main armel libtasn1-6 armel 4.10-1.1+deb9u1 [45.7 kB]
Get:22 http://deb.debian.org/debian stretch/main armel libgnutls30 armel 3.5.8-5+deb9u3 [822 kB]
Get:23 http://deb.debian.org/debian stretch/main armel libkeyutils1 armel 1.5.9-9 [11.8 kB]
Get:24 http://deb.debian.org/debian stretch/main armel libkrb5support0 armel 1.15-1+deb9u1 [58.1 kB]
Get:25 http://deb.debian.org/debian stretch/main armel libk5crypto3 armel 1.15-1+deb9u1 [115 kB]
Get:26 http://deb.debian.org/debian stretch/main armel libkrb5-3 armel 1.15-1+deb9u1 [262 kB]
Get:27 http://deb.debian.org/debian stretch/main armel libgssapi-krb5-2 armel 1.15-1+deb9u1 [131 kB]
Get:28 http://deb.debian.org/debian stretch/main armel libsasl2-modules-db armel 2.1.27~101-g0780600+dfsg-3 [67.0 kB]
Get:29 http://deb.debian.org/debian stretch/main armel libsasl2-2 armel 2.1.27~101-g0780600+dfsg-3 [97.9 kB]
Get:30 http://deb.debian.org/debian stretch/main armel libldap-common all 2.4.44+dfsg-5+deb9u1 [85.4 kB]
Get:31 http://deb.debian.org/debian stretch/main armel libldap-2.4-2 armel 2.4.44+dfsg-5+deb9u1 [197 kB]
Get:32 http://deb.debian.org/debian stretch/main armel openssl armel 1.1.0f-3+deb9u1 [701 kB]
Get:33 http://deb.debian.org/debian stretch/main armel ca-certificates all 20161130+nmu1 [196 kB]
Get:34 http://deb.debian.org/debian stretch/main armel libunistring0 armel 0.9.6+really0.9.3-0.1 [253 kB]
Get:35 http://deb.debian.org/debian stretch/main armel libidn2-0 armel 0.16-1+deb9u1 [59.3 kB]
Get:36 http://deb.debian.org/debian stretch/main armel libnghttp2-14 armel 1.18.1-1 [68.3 kB]
Get:37 http://deb.debian.org/debian stretch/main armel libpsl5 armel 0.17.0-3 [40.8 kB]
Get:38 http://deb.debian.org/debian stretch/main armel librtmp1 armel 2.4+20151223.gitfa8646d.1-1+b1 [55.1 kB]
Get:39 http://deb.debian.org/debian stretch/main armel libssh2-1 armel 1.7.0-1 [125 kB]
Get:40 http://deb.debian.org/debian stretch/main armel dirmngr armel 2.1.18-8~deb9u1 [557 kB]
Get:41 http://deb.debian.org/debian stretch/main armel gnupg2 all 2.1.18-8~deb9u1 [299 kB]
Get:42 http://deb.debian.org/debian stretch/main armel libsasl2-modules armel 2.1.27~101-g0780600+dfsg-3 [95.7 kB]
Get:43 http://deb.debian.org/debian stretch/main armel gnupg-l10n all 2.1.18-8~deb9u1 [892 kB]
Get:44 http://deb.debian.org/debian stretch/main armel publicsuffix all 20180218.2049-0+deb9u1 [103 kB]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 11.1 MB in 1s (5763 kB/s)
Selecting previously unselected package libassuan0:armel.
(Reading database ... 6480 files and directories currently installed.)
Preparing to unpack .../00-libassuan0_2.4.3-2_armel.deb ...
Unpacking libassuan0:armel (2.4.3-2) ...
Selecting previously unselected package pinentry-curses.
Preparing to unpack .../01-pinentry-curses_1.0.0-2_armel.deb ...
Unpacking pinentry-curses (1.0.0-2) ...
Selecting previously unselected package libnpth0:armel.
Preparing to unpack .../02-libnpth0_1.3-1_armel.deb ...
Unpacking libnpth0:armel (1.3-1) ...
Selecting previously unselected package readline-common.
Preparing to unpack .../03-readline-common_7.0-3_all.deb ...
Unpacking readline-common (7.0-3) ...
Selecting previously unselected package libreadline7:armel.
Preparing to unpack .../04-libreadline7_7.0-3_armel.deb ...
Unpacking libreadline7:armel (7.0-3) ...
Selecting previously unselected package gnupg-agent.
Preparing to unpack .../05-gnupg-agent_2.1.18-8~deb9u1_armel.deb ...
Unpacking gnupg-agent (2.1.18-8~deb9u1) ...
Selecting previously unselected package libksba8:armel.
Preparing to unpack .../06-libksba8_1.3.5-2_armel.deb ...
Unpacking libksba8:armel (1.3.5-2) ...
Selecting previously unselected package libsqlite3-0:armel.
Preparing to unpack .../07-libsqlite3-0_3.16.2-5+deb9u1_armel.deb ...
Unpacking libsqlite3-0:armel (3.16.2-5+deb9u1) ...
Selecting previously unselected package gnupg.
Preparing to unpack .../08-gnupg_2.1.18-8~deb9u1_armel.deb ...
Unpacking gnupg (2.1.18-8~deb9u1) ...
Selecting previously unselected package libssl1.0.2:armel.
Preparing to unpack .../09-libssl1.0.2_1.0.2l-2+deb9u2_armel.deb ...
Unpacking libssl1.0.2:armel (1.0.2l-2+deb9u2) ...
Selecting previously unselected package libssl1.1:armel.
Preparing to unpack .../10-libssl1.1_1.1.0f-3+deb9u1_armel.deb ...
Unpacking libssl1.1:armel (1.1.0f-3+deb9u1) ...
Selecting previously unselected package krb5-locales.
Preparing to unpack .../11-krb5-locales_1.15-1+deb9u1_all.deb ...
Unpacking krb5-locales (1.15-1+deb9u1) ...
Selecting previously unselected package libgmp10:armel.
Preparing to unpack .../12-libgmp10_2%3a6.1.2+dfsg-1_armel.deb ...
Unpacking libgmp10:armel (2:6.1.2+dfsg-1) ...
Selecting previously unselected package libnettle6:armel.
Preparing to unpack .../13-libnettle6_3.3-1+b2_armel.deb ...
Unpacking libnettle6:armel (3.3-1+b2) ...
Selecting previously unselected package libhogweed4:armel.
Preparing to unpack .../14-libhogweed4_3.3-1+b2_armel.deb ...
Unpacking libhogweed4:armel (3.3-1+b2) ...
Selecting previously unselected package libidn11:armel.
Preparing to unpack .../15-libidn11_1.33-1_armel.deb ...
Unpacking libidn11:armel (1.33-1) ...
Selecting previously unselected package libffi6:armel.
Preparing to unpack .../16-libffi6_3.2.1-6_armel.deb ...
Unpacking libffi6:armel (3.2.1-6) ...
Selecting previously unselected package libp11-kit0:armel.
Preparing to unpack .../17-libp11-kit0_0.23.3-2_armel.deb ...
Unpacking libp11-kit0:armel (0.23.3-2) ...
Selecting previously unselected package libtasn1-6:armel.
Preparing to unpack .../18-libtasn1-6_4.10-1.1+deb9u1_armel.deb ...
Unpacking libtasn1-6:armel (4.10-1.1+deb9u1) ...
Selecting previously unselected package libgnutls30:armel.
Preparing to unpack .../19-libgnutls30_3.5.8-5+deb9u3_armel.deb ...
Unpacking libgnutls30:armel (3.5.8-5+deb9u3) ...
Selecting previously unselected package libkeyutils1:armel.
Preparing to unpack .../20-libkeyutils1_1.5.9-9_armel.deb ...
Unpacking libkeyutils1:armel (1.5.9-9) ...
Selecting previously unselected package libkrb5support0:armel.
Preparing to unpack .../21-libkrb5support0_1.15-1+deb9u1_armel.deb ...
Unpacking libkrb5support0:armel (1.15-1+deb9u1) ...
Selecting previously unselected package libk5crypto3:armel.
Preparing to unpack .../22-libk5crypto3_1.15-1+deb9u1_armel.deb ...
Unpacking libk5crypto3:armel (1.15-1+deb9u1) ...
Selecting previously unselected package libkrb5-3:armel.
Preparing to unpack .../23-libkrb5-3_1.15-1+deb9u1_armel.deb ...
Unpacking libkrb5-3:armel (1.15-1+deb9u1) ...
Selecting previously unselected package libgssapi-krb5-2:armel.
Preparing to unpack .../24-libgssapi-krb5-2_1.15-1+deb9u1_armel.deb ...
Unpacking libgssapi-krb5-2:armel (1.15-1+deb9u1) ...
Selecting previously unselected package libsasl2-modules-db:armel.
Preparing to unpack .../25-libsasl2-modules-db_2.1.27~101-g0780600+dfsg-3_armel.deb ...
Unpacking libsasl2-modules-db:armel (2.1.27~101-g0780600+dfsg-3) ...
Selecting previously unselected package libsasl2-2:armel.
Preparing to unpack .../26-libsasl2-2_2.1.27~101-g0780600+dfsg-3_armel.deb ...
Unpacking libsasl2-2:armel (2.1.27~101-g0780600+dfsg-3) ...
Selecting previously unselected package libldap-common.
Preparing to unpack .../27-libldap-common_2.4.44+dfsg-5+deb9u1_all.deb ...
Unpacking libldap-common (2.4.44+dfsg-5+deb9u1) ...
Selecting previously unselected package libldap-2.4-2:armel.
Preparing to unpack .../28-libldap-2.4-2_2.4.44+dfsg-5+deb9u1_armel.deb ...
Unpacking libldap-2.4-2:armel (2.4.44+dfsg-5+deb9u1) ...
Selecting previously unselected package openssl.
Preparing to unpack .../29-openssl_1.1.0f-3+deb9u1_armel.deb ...
Unpacking openssl (1.1.0f-3+deb9u1) ...
Selecting previously unselected package ca-certificates.
Preparing to unpack .../30-ca-certificates_20161130+nmu1_all.deb ...
Unpacking ca-certificates (20161130+nmu1) ...
Selecting previously unselected package libunistring0:armel.
Preparing to unpack .../31-libunistring0_0.9.6+really0.9.3-0.1_armel.deb ...
Unpacking libunistring0:armel (0.9.6+really0.9.3-0.1) ...
Selecting previously unselected package libidn2-0:armel.
Preparing to unpack .../32-libidn2-0_0.16-1+deb9u1_armel.deb ...
Unpacking libidn2-0:armel (0.16-1+deb9u1) ...
Selecting previously unselected package libnghttp2-14:armel.
Preparing to unpack .../33-libnghttp2-14_1.18.1-1_armel.deb ...
Unpacking libnghttp2-14:armel (1.18.1-1) ...
Selecting previously unselected package libpsl5:armel.
Preparing to unpack .../34-libpsl5_0.17.0-3_armel.deb ...
Unpacking libpsl5:armel (0.17.0-3) ...
Selecting previously unselected package librtmp1:armel.
Preparing to unpack .../35-librtmp1_2.4+20151223.gitfa8646d.1-1+b1_armel.deb ...
Unpacking librtmp1:armel (2.4+20151223.gitfa8646d.1-1+b1) ...
Selecting previously unselected package libssh2-1:armel.
Preparing to unpack .../36-libssh2-1_1.7.0-1_armel.deb ...
Unpacking libssh2-1:armel (1.7.0-1) ...
Selecting previously unselected package libcurl3:armel.
Preparing to unpack .../37-libcurl3_7.52.1-5+deb9u5_armel.deb ...
Unpacking libcurl3:armel (7.52.1-5+deb9u5) ...
Selecting previously unselected package curl.
Preparing to unpack .../38-curl_7.52.1-5+deb9u5_armel.deb ...
Unpacking curl (7.52.1-5+deb9u5) ...
Selecting previously unselected package dirmngr.
Preparing to unpack .../39-dirmngr_2.1.18-8~deb9u1_armel.deb ...
Unpacking dirmngr (2.1.18-8~deb9u1) ...
Selecting previously unselected package gnupg2.
Preparing to unpack .../40-gnupg2_2.1.18-8~deb9u1_all.deb ...
Unpacking gnupg2 (2.1.18-8~deb9u1) ...
Selecting previously unselected package libsasl2-modules:armel.
Preparing to unpack .../41-libsasl2-modules_2.1.27~101-g0780600+dfsg-3_armel.deb ...
Unpacking libsasl2-modules:armel (2.1.27~101-g0780600+dfsg-3) ...
Selecting previously unselected package gnupg-l10n.
Preparing to unpack .../42-gnupg-l10n_2.1.18-8~deb9u1_all.deb ...
Unpacking gnupg-l10n (2.1.18-8~deb9u1) ...
Selecting previously unselected package publicsuffix.
Preparing to unpack .../43-publicsuffix_20180218.2049-0+deb9u1_all.deb ...
Unpacking publicsuffix (20180218.2049-0+deb9u1) ...
Setting up libnpth0:armel (1.3-1) ...
Setting up readline-common (7.0-3) ...
Setting up libnettle6:armel (3.3-1+b2) ...
Setting up libnghttp2-14:armel (1.18.1-1) ...
Setting up libldap-common (2.4.44+dfsg-5+deb9u1) ...
Setting up libreadline7:armel (7.0-3) ...
Setting up libsasl2-modules-db:armel (2.1.27~101-g0780600+dfsg-3) ...
Setting up libsasl2-2:armel (2.1.27~101-g0780600+dfsg-3) ...
Setting up libksba8:armel (1.3.5-2) ...
Setting up libtasn1-6:armel (4.10-1.1+deb9u1) ...
Setting up gnupg-l10n (2.1.18-8~deb9u1) ...
Setting up libssl1.0.2:armel (1.0.2l-2+deb9u2) ...
debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (Can't locate Term/ReadLine.pm in @INC (you may need to install the Term::ReadLine module) (@INC contains: /etc/perl /usr/local/lib/arm-linux-gnueabi/perl/5.24.1 /usr/local/share/perl/5.24.1 /usr/lib/arm-linux-gnueabi/perl5/5.24 /usr/share/perl5 /usr/lib/arm-linux-gnueabi/perl/5.24 /usr/share/perl/5.24 /usr/local/lib/site_perl /usr/lib/arm-linux-gnueabi/perl-base .) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.)
debconf: falling back to frontend: Teletype
Setting up libgmp10:armel (2:6.1.2+dfsg-1) ...
Setting up libssh2-1:armel (1.7.0-1) ...
Setting up krb5-locales (1.15-1+deb9u1) ...
Processing triggers for libc-bin (2.24-11+deb9u3) ...
Setting up publicsuffix (20180218.2049-0+deb9u1) ...
Setting up libunistring0:armel (0.9.6+really0.9.3-0.1) ...
Setting up libssl1.1:armel (1.1.0f-3+deb9u1) ...
debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (Can't locate Term/ReadLine.pm in @INC (you may need to install the Term::ReadLine module) (@INC contains: /etc/perl /usr/local/lib/arm-linux-gnueabi/perl/5.24.1 /usr/local/share/perl/5.24.1 /usr/lib/arm-linux-gnueabi/perl5/5.24 /usr/share/perl5 /usr/lib/arm-linux-gnueabi/perl/5.24 /usr/share/perl/5.24 /usr/local/lib/site_perl /usr/lib/arm-linux-gnueabi/perl-base .) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.)
debconf: falling back to frontend: Teletype
Setting up openssl (1.1.0f-3+deb9u1) ...
Setting up libsqlite3-0:armel (3.16.2-5+deb9u1) ...
Setting up libffi6:armel (3.2.1-6) ...
Setting up libkeyutils1:armel (1.5.9-9) ...
Setting up libsasl2-modules:armel (2.1.27~101-g0780600+dfsg-3) ...
Setting up ca-certificates (20161130+nmu1) ...
debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (Can't locate Term/ReadLine.pm in @INC (you may need to install the Term::ReadLine module) (@INC contains: /etc/perl /usr/local/lib/arm-linux-gnueabi/perl/5.24.1 /usr/local/share/perl/5.24.1 /usr/lib/arm-linux-gnueabi/perl5/5.24 /usr/share/perl5 /usr/lib/arm-linux-gnueabi/perl/5.24 /usr/share/perl/5.24 /usr/local/lib/site_perl /usr/lib/arm-linux-gnueabi/perl-base .) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.)
debconf: falling back to frontend: Teletype
Updating certificates in /etc/ssl/certs...
166 added, 0 removed; done.
Setting up libassuan0:armel (2.4.3-2) ...
Setting up libidn11:armel (1.33-1) ...
Setting up libidn2-0:armel (0.16-1+deb9u1) ...
Setting up libpsl5:armel (0.17.0-3) ...
Setting up libkrb5support0:armel (1.15-1+deb9u1) ...
Setting up libhogweed4:armel (3.3-1+b2) ...
Setting up libp11-kit0:armel (0.23.3-2) ...
Setting up pinentry-curses (1.0.0-2) ...
Setting up gnupg-agent (2.1.18-8~deb9u1) ...
Setting up libk5crypto3:armel (1.15-1+deb9u1) ...
Setting up gnupg (2.1.18-8~deb9u1) ...
Setting up libgnutls30:armel (3.5.8-5+deb9u3) ...
Setting up librtmp1:armel (2.4+20151223.gitfa8646d.1-1+b1) ...
Setting up gnupg2 (2.1.18-8~deb9u1) ...
Setting up libldap-2.4-2:armel (2.4.44+dfsg-5+deb9u1) ...
Setting up libkrb5-3:armel (1.15-1+deb9u1) ...
Setting up dirmngr (2.1.18-8~deb9u1) ...
Setting up libgssapi-krb5-2:armel (1.15-1+deb9u1) ...
Setting up libcurl3:armel (7.52.1-5+deb9u5) ...
Setting up curl (7.52.1-5+deb9u5) ...
Processing triggers for libc-bin (2.24-11+deb9u3) ...
Processing triggers for ca-certificates (20161130+nmu1) ...
Updating certificates in /etc/ssl/certs...
0 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...
done.

## Installing the NodeSource Node.js v8.x LTS Carbon repo...


## Populating apt-get cache...

+ apt-get update
Hit:1 http://security.debian.org stretch/updates InRelease
Ign:2 http://deb.debian.org/debian stretch InRelease
Hit:3 http://deb.debian.org/debian stretch-updates InRelease
Hit:4 http://ftp.debian.org/debian stretch-backports InRelease
Hit:5 http://deb.debian.org/debian stretch Release
Reading package lists...

## Installing packages required for setup: apt-transport-https lsb-release...

+ apt-get install -y apt-transport-https lsb-release > /dev/null 2>&1

## Confirming "stretch" is supported...

+ curl -sLf -o /dev/null 'https://deb.nodesource.com/node_8.x/dists/stretch/Release'

## Adding the NodeSource signing key to your keyring...

+ curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -
Warning: apt-key output should not be parsed (stdout is not a terminal)
OK

## Creating apt sources list file for the NodeSource Node.js v8.x LTS Carbon repo...

+ echo 'deb https://deb.nodesource.com/node_8.x stretch main' > /etc/apt/sources.list.d/nodesource.list
+ echo 'deb-src https://deb.nodesource.com/node_8.x stretch main' >> /etc/apt/sources.list.d/nodesource.list

## Running `apt-get update` for you...

+ apt-get update
Hit:1 http://security.debian.org stretch/updates InRelease
Ign:2 http://deb.debian.org/debian stretch InRelease
Hit:3 http://deb.debian.org/debian stretch-updates InRelease
Hit:4 http://ftp.debian.org/debian stretch-backports InRelease
Hit:5 http://deb.debian.org/debian stretch Release
Get:6 https://deb.nodesource.com/node_8.x stretch InRelease [4647 B]
Get:8 https://deb.nodesource.com/node_8.x stretch/main Sources [762 B]
Fetched 5409 B in 2s (1970 B/s)
Reading package lists...

## Run `apt-get install nodejs` (as root) to install Node.js v8.x LTS Carbon and npm


WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Ign:1 http://deb.debian.org/debian stretch InRelease
Hit:2 http://security.debian.org stretch/updates InRelease
Hit:3 http://deb.debian.org/debian stretch-updates InRelease
Hit:4 http://ftp.debian.org/debian stretch-backports InRelease
Hit:5 http://deb.debian.org/debian stretch Release
Hit:6 https://deb.nodesource.com/node_8.x stretch InRelease
Reading package lists...
Building dependency tree...
Reading state information...
All packages are up to date.

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Reading package lists...
Building dependency tree...
Reading state information...
Calculating upgrade...
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Reading package lists...
Building dependency tree...
Reading state information...
Package nodejs is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'nodejs' has no installation candidate
E: Unable to locate package npm
The command '/bin/sh -c echo "deb http://ftp.debian.org/debian stretch-backports main" >> /etc/apt/sources.list &&     apt update &&     apt install -y curl gnupg2 &&     curl -sL https://deb.nodesource.com/setup_8.x | bash - &&     apt update &&     apt dist-upgrade &&     apt install -y         build-essential         certbot         cron         git         libffi-dev         libnanomsg-dev         libnanomsg4         libopenzwave1.5         libopenzwave1.5-dev         nodejs         npm         python         python-pip         python-setuptools         python3         python3-pip         python3-setuptools         runit         sudo &&     npm install -g yarn &&     rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* &&     pip2 install git+https://github.com/mozilla-iot/gateway-addon-python#egg=gateway_addon &&     pip3 install git+https://github.com/mozilla-iot/gateway-addon-python#egg=gateway_addon &&     pip2 install git+https://github.com/mycroftai/adapt#egg=adapt-parser &&     pip3 install git+https://github.com/mycroftai/adapt#egg=adapt-parser &&     curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash &&     useradd -m -s /bin/bash -G sudo user &&     cd /home/user &&     mkdir mozilla-iot &&     cd mozilla-iot &&     git clone https://github.com/mozilla-iot/intent-parser &&     git clone https://github.com/mozilla-iot/gateway &&     cd gateway &&     yarn &&     chown -R user:user /home/user &&     touch /etc/inittab &&     echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers &&     echo "0 */12 * * * root /home/user/mozilla-iot/gateway/tools/renew-certificates.sh" > /etc/cron.d/renew-certs' returned a non-zero code: 100

Failed to generate certificate

I'm using the image with the recommended docker-compose configuration. When trying to register the subdomain, the error "Error issuing certificate. Please try again." appears (but the confirmation email is being sent). The following error is printed to the log:

webthings-gateway    | 2019-11-17 16:32:04.711 INFO   : Sent subscription to registration server
webthings-gateway    | 2019-11-17 16:32:29.900 ERROR  : Failed to generate certificate: Error: Could not resolve URL for API resource: "newAccount"
webthings-gateway    |     at HttpClient.getResourceUrl (/home/node/mozilla-iot/gateway/node_modules/acme-client/src/http.js:132:19)
webthings-gateway    |     at <anonymous>
webthings-gateway    |     at process._tickCallback (internal/process/next_tick.js:189:7)

ZigBee USB Device

Hi,
I was able to run the Mozilla-Gateway without docker and now I am switching to the docker version. Inside docker, I get following error message "Failed to load zigbee-adapter - No Digi port found". Do I need to configure something that my container has access to the zigbee Digi Stick?

sudo docker run -d --device=/dev/ttyUSB0 --rm -v /home/user/gateway:/home/node/.mozilla-iot --net=host --name mozilla-iot-gateway mozillaiot/gateway:latest

Cheers

GPIO Pins

Is anyone else having a problem accessing GPIO pins through docker?

Failed to start add-on GPIO: No permissions to /sys/class/gpio/export

Cannot run and build image

Hello,
I'm quite new to Mozilla IoT gateway and was working on getting a testing environment working in Docker by following the instructions provided in this repository and stumbled upon an issue, where it appears that the image provided in Docker Hub is outdated since it was trying to access /home/pi` folder.
Full steps on how to arrived at the issue can be seen in this gist.

Since Docker Hub image was failing I tried build the image myself and arrived with an issue where yarn did not have executable permissions. Full gist can be seen here.

I'm running this on x86 Ubuntu 16.04 server with Docker 18.03.1-ce.

Cannot run arduino CLI in container on Pi 4b

I'm attempting to use the Candle-manager-addon, which uses the arduino-cli to manage plugged in arduinos.

The Candle manager addon comes packaged with an arduino-cli that can run natively on my Raspberry Pi 4b, but that cannot be run on my Raspberry Pi 4b using the mozillaiot/gateway Docker image.

Below is output from my attempt at running the cli from the Raspberry pi:

pi@raspberrypi:/ $ uname -s && uname -m
Linux
armv7l

pi@raspberrypi:/ $ /home/pi/Development/iot/data/addons/Candle-manager-addon/arduino-cli/linux-arm/arduino-cli version
arduino-cli Version: 0.9.0 Commit: e4d02b4

Below is output from my attempt at running the cli from inside the container:
(Host volume is mapped using -v /home/pi/Development/iot/data:/home/node/.mozilla-iot).

pi@raspberrypi:/ $ docker exec -it webthings-gateway sh

# uname -s && uname -m
Linux
armv7l

# ls -lha /home/node/.mozilla-iot/addons/Candle-manager-addon/arduino-cli/linux-arm/arduino-cli
-rwxr-xr-x 1 node node 14M Jul 18 08:32 /home/node/.mozilla-iot/addons/Candle-manager-addon/arduino-cli/linux-arm/arduino-cli

# /home/node/.mozilla-iot/addons/Candle-manager-addon/arduino-cli/linux-arm/arduino-cli version
sh: 1: /home/node/.mozilla-iot/addons/Candle-manager-addon/arduino-cli/linux-arm/arduino-cli: not found

As a note, I am opting to run the gateway in a docker container so that I can use my Pi for multiple purposes (as a desktop, Pi-Hole, and iOT Gateway) so using the Pi iOT Gateway image is not a preferred solution.

Fails to install node on raspberry pi

After #1 was fixed, I'm now getting different error on trying to create docker container on raspberry pi 3. Here is relevant part (it fails on running nvm install --lts):

Step 5/8 : RUN cd /home/user &&     curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.7/install.sh | bash &&     export NVM_DIR="$HOME/.nvm" &&     [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" &&     nvm install --lts &&     npm install -g yarn &&     mkdir mozilla-iot &&     cd mozilla-iot &&     git clone https://github.com/mozilla-iot/intent-parser &&     git clone https://github.com/mozilla-iot/gateway &&     cd gateway &&     yarn
 ---> Running in 6bca6f50655b
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 12540  100 12540    0     0  32667      0 --:--:-- --:--:-- --:--:-- 32741
=> Downloading nvm from git to '/home/user/.nvm'
=> Cloning into '/home/user/.nvm'...
Note: checking out '65f0572bdc5c618f747df4b1e70a76fbc0174b82'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

=> Compressing and cleaning up git repository

=> Appending nvm source string to /home/user/.bashrc
=> Appending bash_completion source string to /home/user/.bashrc
=> Close and reopen your terminal to start using nvm or run the following to use it now:

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion
Installing latest LTS version.
Downloading and installing node v8.10.0...
Downloading https://nodejs.org/dist/v8.10.0/node-v8.10.0-linux-armv7l.tar.xz...
######################################################################## 100.0%
Computing checksum with sha256sum
Checksums matched!
/usr/bin/env: 'node': No such file or directory
nvm is not compatible with the npm config "prefix" option: currently set to ""
Run `nvm use --delete-prefix v8.10.0` to unset it.
The command '/bin/sh -c cd /home/user &&     curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.7/install.sh | bash &&     export NVM_DIR="$HOME/.nvm" &&     [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" &&     nvm install --lts &&     npm install -g yarn &&     mkdir mozilla-iot &&     cd mozilla-iot &&     git clone https://github.com/mozilla-iot/intent-parser &&     git clone https://github.com/mozilla-iot/gateway &&     cd gateway &&     yarn' returned a non-zero code: 11

I have been googling this problem quite a bit and found veeery similar issue filed for other ARM device: nvm-sh/nvm#1354 . Basically it seems to boil down to missing BLX instruction on the ARM architecture but obviously raspberry pi 3 CAN run nodejs (I do it outside of docker), but maybe the docker layer is the problem here.

So not sure that can be fixed but I wonder if you have Pi3 to test with and can confirm same problem.

Container unable to create node directory

Ran the provided script for ARM devices (Running on a Raspberry Pi Model 3 B) and container starts successfully with no errors on launch. However when checking the logs, the logs are spammed with the error below:

+ MOZIOT_HOME=/home/node/.mozilla-iot
+ args=
+ is_docker_container
+ '[' -f /.dockerenv ']'
+ return 0
+ mkdir -p /home/node/.mozilla-iot/log
mkdir: cannot create directory '/home/node/.mozilla-iot/log': Permission denied

Is there something I am doing wrong or an issue with the image?

Raspberry Pi reboots when trying to pull the image

Upon pulling the image the raspberry Pi reboots. Clean install, nothing else done. Logging via SSH the connection got closed, to figure the problem out I hooked it up to a desktop. Turns out, it reboots.

Excerpt from cat /etc/os-release Output:
PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
VERSION_ID="9"
ID=raspbian
ID_LIKE=debian

docker --version
Docker version 18.09.0, build 4d60db4

docker run hello-world does give the expected output (and does not reboot), docker pull mozillaiot/gateway:arm results in the following output:

Unable to find image 'mozillaiot/gateway:arm' locally  
arm: Pulling from mozillaiot/gateway  
773085009f9c: Pulling fs layer  
15973945ecf5: Pulling fs layer  
4e25b539801e: Pulling fs layer  
a84cdb78f6b0: Waiting  
0c9b8944dc77: Waiting  
e5d5b177fb91: Waiting  
b607d4912e2c: Waiting  
f0483e81618e: Waiting  
a1e85dbd8e2c: Waiting  
e01229de56d3: Waiting  
9dd67d3b7895: Waiting  
e983d85a8d9c: Waiting  
00e328c139d4: Waiting  
7ae91a156a8c: Waiting  
Connection reset by 192.168.X.ZZZ port 22.  

Then the raspberry reboots.

Still trying to figure out if it is my bad (I am assuming not, since it is a clean install of the OS), and if others can reproduce the issue.

Best and thanks a lot!

P.S: cloning the git repository and then trying to build it results in the same behavior. The Code used was this (/path/to/shared/data was changed obviously):
git clone https://github.com/mozilla-iot/gateway-docker
cd gateway-docker
docker build -t gateway .
docker run
-d
--rm
-v /path/to/shared/data:/home/node/.mozilla-iot
--net=host
--name mozilla-iot-gateway
gateway

openzwave not available - zwave adapter non-functional.

The arm container does not come with openzwave installed, resulting in the failure of the zwave plugin:

2018-07-15 19:52:01.244 Loading add-on: zwave-adapter
2018-07-15 19:52:02.036 zwave: Opening database: /home/node/.mozilla-iot/config/db.sqlite3
2018-07-15 19:52:02.078 zwave: Loading add-on for zwave-adapter from /home/node/.mozilla-iot/addons/zwave-adapter
2018-07-15 19:52:02.485 zwave: Failed to load zwave-adapter - Failed to load openzwave-shared: Error: libopenzwave.so.1.4: cannot open shared object file: No such file or directory
2018-07-15 19:52:02.500 Plugin: zwave-adapter died, code = 100 NOT restarting...

I was able to install it into the running container with docker exec with reasonable success. I figure it's a common protocol, so it might be worth including in this container.

Synology Gui walkthrough

Prompted by mrstegeman https://discourse.mozilla.org/t/too-many-certificates-already-issued/51534/3, I have written a walkthrough which uses the Synology Docker Gui and does not require SSH access. https://github.com/Arzachena/Mozilla-iot-gateway-on-synology/wiki
Now I don't know what to do with it. Could it be useful to some people? If yes, should I move it somewhere or what?
Clearly, the Note: "You may need to replace both occurrences of ttyACM0 with ttyACM0" is a weakness. It would be better if it could clarify which dongle brands need ttyACM0 and which need ttyACM0.

Clarification of Readme

In the Changing Ports section it says "Create a file local.json and map it to.....".
I don't know what "and map it to" means. Could the Readme be clarified in this area?

docker first run initialization permissions issue

On a first run using a rpi 3 b+, my docker container gets stuck on initialization trying to create /home/node/.mozilla-iot/log

One 'Quick fix' is to choose a host directory that already contains a log folder, and mounting that to :/home/node/.mozilla-iot

The error is a permissions error when initialization script runs: 'mkdir -p /home/node/.mozilla-iot/log'. The rest of the directories are created properly with no permissions issues.

To reproduce, run this docker command where /home/pi/folder is any folder NOT containing a folder named log.

sudo docker run \
    --rm \
    -v /home/pi/folder:/home/node/.mozilla-iot \
    --net=host \
    --name mozilla-iot-gateway \
    mozillaiot/gateway:arm

CODE_OF_CONDUCT.md file missing

As of January 1 2019, Mozilla requires that all GitHub projects include this CODE_OF_CONDUCT.md file in the project root. The file has two parts:

  1. Required Text - All text under the headings Community Participation Guidelines and How to Report, are required, and should not be altered.
  2. Optional Text - The Project Specific Etiquette heading provides a space to speak more specifically about ways people can work effectively and inclusively together. Some examples of those can be found on the Firefox Debugger project, and Common Voice. (The optional part is commented out in the raw template file, and will not be visible until you modify and uncomment that part.)

If you have any questions about this file, or Code of Conduct policies and procedures, please reach out to [email protected].

(Message COC001)

How to configure the port?

Hello,

can I pass parameters or modify a configuration file in that way, that the things webinterface listens on other ports than 8080 etc.? On the machine where I want to run this Docker image is already a service listening on port 8080 - and when running it with --net=host the port parameters have no effect.

Any solution for that?

Best regards
Matthias

LICENSE file is missing

I know gateway itself is licensed under MPL, but this repo, docker files are currently unlicensed.
Would you add LICENSE file?

Thank you.

Auto-discovery webthing-arduino project fail.

Hi all,
I am writing a project of webthing-arduino library, an air conditioner controller using Wemos D1 mini, IR Controller Shield, and SHT30 Shield. Then I would like to propose it as an example for that library, but first I must ensure that works correctly.

The main problem I find is the discovery of the device. Although it was documented in the library (https://github.com/mozilla-iot/webthing-arduino/search?q=discovery&type=Issues), I think the problem is in this project.

I am working with the Gateway in docker, with a apache reverse proxy. When I click the + button to add devices, It is supposed to start looking, but does not discover anything.

When viewing the log of the gateway, it seems that the this discovers the device, but cannot connect to it.

2019-08-05 22:59:06.151 INFO   : thing-url: Failed to connect to http://ac-controller.local:80: FetchError: request to http://ac-controller.local:80/ failed, reason: getaddrinfo ENOTFOUND ac-controller.local ac-controller.local:80

If I connect to this URL, download the description of the device correctly:

[matias@ideapad ~]$ curl -i -H "Accept: application/json" "http://ac-controller.local:80"
HTTP/1.1 200 OK
Content-Length: 872
Content-Type: application/json
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: PUT, GET, OPTIONS
Connection: close
Accept-Ranges: none

[{"id":"ac","title":"Air Conditioning Controller","@context":"https://iot.mozilla.org/schemas","securityDefinitions":{"nosec_sc":{"scheme":"nosec"}},"@type":["OnOffSwitch"],"links":[{"rel":"properties","href":"/things/ac/properties"},{"rel":"events","href":"/things/ac/events"},{"rel":"alternate","href":"ws://192.168.1.246:80/things/ac"}],"properties":{"ambientHum":{"type":"number","readOnly":true,"unit":"%","@type":"AmbientHumProperty","links":[{"href":"/things/ac/properties/ambientHum"}]},"ambientTemp":{"type":"number","readOnly":true,"unit":"°C","@type":"AmbientTempProperty","links":[{"href":"/things/ac/properties/ambientTemp"}]},"setTemp":{"type":"number","unit":"°C","@type":"TempProperty","links":[{"href":"/things/ac/properties/setTemp"}]},"on":{"type":"boolean","@type":"OnOffProperty","links":[{"href":"/things/ac/properties/on"}]}},"href":"/things/ac"}]

The code that fails is this:
https://github.com/mozilla-iot/thing-url-adapter/blob/master/thing-url-adapter.js#L479-L490

Note that If I click on "Add by url" and enter the IP, it works correctly, and I can interact with the device.

So here comes my research, I hope it helps ...
Thanks for all,

Use docker-compose and a well-known Avahi image

The current image tries to embed Avahi itself, which can cause problems if other containers or even the host is already running this. It may be better to simply rely on an existing image and use docker-compose to connect things.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.