Can't detect zigbee controller in zigbee2mqtt portainer setup

Hello I am trying to setup my sonoff zigbee 3.0 usb dongle communicate to my home assistant docker image instance using zigbee2mqtt as part of the stack. I am using portainer. I have the zigbee dongle attached to a powered usb hub that is attached to the same raspberry pi that is hosting the home assistant. The error in the log for my zigbee2mqtt image is the following:

[2024-12-31 16:03:29] info:     z2m: Logging to console, file (filename: log.log)
[2024-12-31 16:03:29] info:     z2m: Starting Zigbee2MQTT version 1.42.0 (commit #861cba6)
[2024-12-31 16:03:29] info:     z2m: Starting zigbee-herdsman (2.1.9)
[2024-12-31 16:03:32] info:     zh:zstack:znp: Opening SerialPort with {"path":"/dev/ttyACM0","baudRate":115200,"rtscts":false,"autoOpen":f>
[2024-12-31 16:03:32] info:     zh:zstack:znp: Serialport opened
[2024-12-31 16:03:33] info:     zh:zstack:znp: Writing CC2530/CC2531 skip bootloader payload
[2024-12-31 16:03:34] info:     zh:zstack:znp: Skip bootloader for CC2652/CC1352
[2024-12-31 16:03:52] error:    z2m: Error while starting zigbee-herdsman
[2024-12-31 16:03:52] error:    z2m: Failed to start zigbee
[2024-12-31 16:03:52] error:    z2m: Check https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start.html for possible so>
[2024-12-31 16:03:52] error:    z2m: Exiting...
[2024-12-31 16:03:53] error:    z2m: Error: Failed to connect to the adapter (Error: SRSP - SYS - ping after 6000ms)
    at ZStackAdapter.start (/app/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/zStackAdapter.ts:113:27)
    at Controller.start (/app/node_modules/zigbee-herdsman/src/controller/controller.ts:137:29)
    at Zigbee.start (/app/lib/zigbee.ts:69:27)
    at Controller.start (/app/lib/controller.ts:161:27)
    at start (/app/index.js:154:5)

This is what my docker compose yaml looks like:

version: '3'
services:
  homeassistant:
    container_name: homeassistant
    image: "ghcr.io/home-assistant/home-assistant:stable"

    volumes:
      - "/Docker/homeassistant/config:/config"
      - "/etc/localtime:/etc/localtime:ro"
    restart: unless-stopped
    privileged: true
    network_mode: host
  
  nodered:
    container_name: nodered
    image: nodered/node-red
    ports:
      - 1880:1880
    volumes:
      - "/Docker/homeassistant/nodered:/data"
    depends_on:
      - homeassistant
      - mosquitto
    environment:
      - TZ=America/New_York
    restart: unless-stopped

  zwavejs2mqtt:
    container_name: zwavejs2mqtt
    image: "zwavejs/zwavejs2mqtt:latest"
    restart: unless-stopped
    tty: true
    stop_signal: SIGINT
    environment:
      - SESSION_SECRET=Z5vyvEDm7YCrRH2#DS7z*%Q%Tpckh&
      - ZWAVEJS_EXTERNAL_CONFIG=/usr/src/app/store/.config-db
      - TZ=America/New_York

    devices:
      - '/dev/serial/by-id/usb-Zooz_800_Z-Wave_Stick_533D004242-if00:/dev/zwave'
    volumes:
      - "/Docker/homeassistant/z-wave-js/:/usr/src/app/store"
    ports:
      - "8091:8091" # port for web interface
      - "3000:3000" # port for Z-Wave JS websocket server
  
  zigbee2mqtt:
    image: koenkk/zigbee2mqtt:latest
    container_name: zigbee2mqtt
      #restart: unless-stopped
    volumes:
      - /Docker/homeassistant/zigbee2mqtt/data:/app/data
      - /run/udev:/run/udev:ro
    ports:
      # Frontend port
      - 8080:8080
    environment:
      - TZ=America/New_York
        #user: "1000:1000"
    devices:
      # Make sure this matched your adapter location
      - /dev/serial/by-id/usb-Itead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_V2_72f67c3c9638ef1193fd3c7af3d9b1e5-if00-port0:/dev/ttyACM0
    depends_on:
      - "mosquitto"
      
  mosquitto:
    image: eclipse-mosquitto
    container_name: mosquitto
    restart: unless-stopped
    ports:
      - 1883:1883
      - 9001:9001
    volumes:
      - "/Docker/homeassistant/mosquitto/config:/mosquitto/config"
      - "/Docker/homeassistant/mosquitto/data:/mosquitto/data"
      - "/Docker/homeassistant/mosquitto/log:/mosquitto/log"
    environment:
      - TZ=America/New_York
    user: "${PUID}:${PGID}"
  
  hass-configurator:
    image: "causticlab/hass-configurator-docker:latest"
    restart: unless-stopped
    ports:
      - 3218:3218/tcp
    volumes:
      - "/Docker/homeassistant/configurator-config:/config"
      - "/opt/stacks/hass/hass-config:/hass-config"
volumes:
  zwave-config:
    # name: zwave-config

and this is the configuration yaml for the zigbee2mqtt:

frontend: true
mqtt:
  base_topic: zigbee2mqtt
  server: mqtt://192.168.1.159:1883
serial:
  port: /dev/ttyACM0

I’m pretty sure I have the location of the zigbee controller setup correctly. This is the output for the location:

ls -l /dev/serial/by-id/
total 0
lrwxrwxrwx 1 root root 13 Dec 30 17:02 usb-Itead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_V2_72f67c3c9638ef1193fd3c7af3d9b1e5-if00-port0 -> ../../ttyUSB0
lrwxrwxrwx 1 root root 13 Dec 30 17:02 usb-Zooz_800_Z-Wave_Stick_533D004242-if00 -> ../../ttyACM0

Is there something I am missing? All of the other containers work fine, I just don’t know exactly what is going on with this log. Do I need to change the port in the configuration.yaml to the serial device on my pi? I thought that is referencing the container.

You are mixing up the ports, notice you point to ttyACM0 in the config but it is mapped as ttyUSB0. If you use dev/serial/by-id you avoid this.

Thanks for the reply! To clarify, are you saying I need to update the port with /dev/ttyUSB0? or should I replace it with

/dev/serial/by-id/usb-Itead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_V2_72f67c3c9638ef1193fd3c7af3d9b1e5-if00-port0?

The latter. (/dev/serial/by-id/usb-Itead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_V2_72f67c3c9638ef1193fd3c7af3d9b1e5-if00-port0)

I updated the configuration yaml like so

frontend: true
mqtt:
  base_topic: zigbee2mqtt
  server: mqtt://192.168.1.159:1883
serial:
  port: /dev/serial/by-id/usb-Itead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_V2_72f67c3c9638ef1193fd3c7af3d9b1e5-if00-port0

The container still won’t launch, but now I am getting a different error in the log:

[2025-01-01 20:27:15] info: 	z2m: Logging to console, file (filename: log.log)

[2025-01-01 20:27:15] info: 	z2m: Starting Zigbee2MQTT version 1.42.0 (commit #861cba6)

[2025-01-01 20:27:15] info: 	z2m: Starting zigbee-herdsman (2.1.9)

[2025-01-01 20:27:16] error: 	zh:zstack:znp: Failed to determine if path is valid: 'Error: ENOENT: no such file or directory, lstat '/dev/serial''

[2025-01-01 20:27:16] info: 	zh:zstack:znp: Opening SerialPort with {"path":"/dev/serial/by-id/usb-Itead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_V2_72f67c3c9638ef1193fd3c7af3d9b1e5-if00-port0","baudRate":115200,"rtscts":false,"autoOpen":false}

[2025-01-01 20:27:17] error: 	z2m: Error while starting zigbee-herdsman

[2025-01-01 20:27:17] error: 	z2m: Failed to start zigbee

[2025-01-01 20:27:17] error: 	z2m: Check https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start.html for possible solutions

[2025-01-01 20:27:17] error: 	z2m: Exiting...

[2025-01-01 20:27:17] error: 	z2m: Error: Error: No such file or directory, cannot open /dev/serial/by-id/usb-Itead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_V2_72f67c3c9638ef1193fd3c7af3d9b1e5-if00-port0

So now it seems like that directory path to the zigbee coordinator isn’t recognized.

Then you can always try ttyUSB0 as it is mapped as.

That returned the same error.

Starting Zigbee2MQTT without watchdog.

[2025-01-02 16:24:47] info: 	z2m: Logging to console, file (filename: log.log)

[2025-01-02 16:24:47] info: 	z2m: Starting Zigbee2MQTT version 1.42.0 (commit #861cba6)

[2025-01-02 16:24:47] info: 	z2m: Starting zigbee-herdsman (2.1.9)

[2025-01-02 16:24:48] error: 	zh:zstack:znp: Failed to determine if path is valid: 'Error: ENOENT: no such file or directory, lstat '/dev/ttyUSB0''

[2025-01-02 16:24:49] info: 	zh:zstack:znp: Opening SerialPort with {"path":"/dev/ttyUSB0","baudRate":115200,"rtscts":false,"autoOpen":false}

[2025-01-02 16:24:49] error: 	z2m: Error while starting zigbee-herdsman

[2025-01-02 16:24:49] error: 	z2m: Failed to start zigbee

[2025-01-02 16:24:49] error: 	z2m: Check https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start.html for possible solutions

[2025-01-02 16:24:49] error: 	z2m: Exiting...

[2025-01-02 16:24:49] error: 	z2m: Error: Error: No such file or directory, cannot open /dev/ttyUSB0