OH 3 - Docker / Raspberry Pi 4 / Razberry Board -> Z-Wave addon: Status OFFLINE

Dear Community,

since i’ve been spending the whole day unsuccessfully getting the Razberry Board up and running on my Raspberry Pi 4 with Docker, I would like to ask for your advice.

I have installed the Z-Wave add-on, the device is displayed there under serial port, but the status is always offline.

The following was attempted on the host:

  • installed Ubuntu-Server for Raspberry
  • installed Raspberry OS
  • set user to dialout group
  • chmod 777 /dev/ttyAMA0
  • deactivated/uninstalled all bluetooth stuff
  • deactivated bluetooth in the boot config

My Docker compose file looks like this:

devices:
- /dev/ttyAMA0:/dev/ttyAMA0:rwm

Maybe someone has an idea… that would be great!
Thanks in advance!

best regards
Christoph

How do you know the OS sees the device there?

What is the output of sudo dmesg | grep tty ? That should list all serial & USb devices seen by the OS.

Hi @Bruce_Osborne ,

thanks for your reply. I received the following output:

On the host:

[    0.001805] printk: console [tty1] enabled
[    1.447416] fe201000.serial: ttyAMA0 at MMIO 0xfe201000 (irq = 36, base_baud = 0) is a PL011 rev2
[    1.454662] printk: console [ttyS0] disabled
[    1.454802] fe215040.serial: ttyS0 at MMIO 0xfe215040 (irq = 37, base_baud = 62500000) is a 16550
[    2.724158] printk: console [ttyS0] enabled

In the docker (docker exec -it openhab /bin/bash) i cant execute the command dmseg, so i did this:

ls /dev/tty*

and get this:
/dev/tty /dev/ttyAMA0

Therefore, I assumed that openHAB also sees the device in the Docker container. But maybe that doesn’t say anything either.

If I put the container in privileged mode, then I can use the sudo dmesg | grep tty, but get the output from the host - at least that’s how it looks to me…

[    0.001805] printk: console [tty1] enabled
[    1.447416] fe201000.serial: ttyAMA0 at MMIO 0xfe201000 (irq = 36, base_baud = 0) is a PL011 rev2
[    1.454662] printk: console [ttyS0] disabled
[    1.454802] fe215040.serial: ttyS0 at MMIO 0xfe215040 (irq = 37, base_baud = 62500000) is a 16550
[    2.724158] printk: console [ttyS0] enabled

What do you think about it?

I think the board is seen at /dev/ttyS0 rather than /dev/tty/AMA0.

Sorry @Bruce_Osborne , i forgot to mention that, of course i also tried /dev/ttyS0, unfortunately without success.

What i noticed - sometimes i can select the controller in the GUI under serial port and then the next time i try it doesn’t appear again. Something shouldn’t be going very well there.

Which rights have to be set? Is it enough to set this :rwm in the composer-file or do i have to set rights somewhere in (docker) or outside (host) the container? I’ve already tried it with the 777 on the host for the device, unfortunately without success …

it case it does not appear in the UI is it available on OS level then under the name you are looking for or does it have a different name then ?

User openhab as member of the dialout group and device permissions rw for the group should be enough.

Hello @Wolfgang_S ,

thank you for your hint.
The device can be found with the same name in the OS as in the container.

The user openhab was authorized in the container for the device with chown -R openhab: openhab /dev/ttyAMA0 the same for /devttyS0. The user does not exist on the host itself, so nothing can be authorized here.

I believe the OH user needs to be part of the dialout group in the OS.

I would interprete

that this is the case.

openHAB requires a user on the host mapped to the container.

What instructions did you use to install OH with Docker? It is documented quite well in docker Hub.

1 Like

Hello @Bruce_Osborne and @Wolfgang_S,

a user was created and authorized accordingly on the host.

I followed the instructions below:

https://hub.docker.com/r/openhab/openhab/

Maybe it has something to do with the Raspberry Pi 4 - i tried it on the Raspberry Pi 3+, everything worked right away. I also tried my second Raspberry Pi 4, unfortunately without success here as well.

Crazy question. Is your particular Razzberry board compatible with the Pi 4?

Yes, the board is compatible - i had this constellation (Raspberry Pi 4, Razberry and openHAB 2.5) running for about 2 years without any problems. Now i wanted to switch to OH3 and unfortunately that doesn’t quite work. The only thing that has changed is that i have the system running on Docker - which works fine on a Raspberry Pi 3+.

Is there any message in the openhab.log file that gives a hint ?
Any entry in the docker log file of the container ?

I have now tried again to install everything from the beginning. Will lead the steps, maybe i’ll get something wrong in the process of setting it up.

  1. Download the current image of Raspberry Pi OS Lite
  2. Write the image to an SD card
  3. Add the following two entries to the boot config:
    dtoverlay = disable-bt
    enable_uart = 1
  4. Set the following rights for the openhab user:
    sudo useradd -r -s / sbin / nologin openhab
    usermod -a -G openhab pi
  5. Create directories and authorize the user openhab:
    sudo mkdir -p / opt / openhab / {conf, userdata, addons}
    sudo chown -R openhab: openhab / opt / openhab
  6. Start the Docker Stack with the following configuration:
version: '2.2'

services:
  openhab:
    image: "openhab/openhab:latest"
    container_name: openhab
    restart: always
    network_mode: host
    volumes:
      - "/etc/localtime:/etc/localtime:ro"
      - "/etc/timezone:/etc/timezone:ro"
      - "/opt/openhab/addons:/openhab/addons"
      - "/opt/openhab/conf:/openhab/conf"
      - "/opt/openhab/userdata:/openhab/userdata"
    devices:
      - "/dev/ttyAMA0:/dev/ttyAMA0:rwm"
    environment:
      OPENHAB_HTTP_PORT: "8080"
      OPENHAB_HTTPS_PORT: "8443"
      USER_ID: "999"
      GROUP_ID: "994"
      EXTRA_JAVA_OPTS: "-Duser.timezone=Europe/Vienna"
  1. Install the Z-Wave addon in openHAB
  2. Add the controller in the GUI under Things

I have now found the solution. The following post provided me with the necessary information:

If openHAB is installed in a Docker on a Raspberry Pi OS, the serial console must be deactivated via raspi-config and the serial port must of course be activated.

@Bruce_Osborne @Wolfgang_S thank you for your help.

1 Like