Zigbee2MQTT serial port issue

maddog74

New Member
Dec 15, 2022
6
0
1
just installed and configured configuration.yaml.
I've got this error starting the service zigbee2mqtt with the command:

zigbee2mqtt && npm start

this is the output of my error:

> zigbee2mqtt@1.28.4 start
> node index.js

Zigbee2MQTT:info 2022-12-15 20:55:20: Logging to console and directory: '/opt/zigbee2mqtt/data/log/2022-12-15.20-55-20' filename: log.txt
Zigbee2MQTT:info 2022-12-15 20:55:20: Starting Zigbee2MQTT version 1.28.4 (commit #52e545f9)
Zigbee2MQTT:info 2022-12-15 20:55:20: Starting zigbee-herdsman (0.14.76)
lsusb -t -vZigbee2MQTT:error 2022-12-15 20:55:41: Error while starting zigbee-herdsman
Zigbee2MQTT:error 2022-12-15 20:55:41: Failed to start zigbee
Zigbee2MQTT:error 2022-12-15 20:55:41: Check https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start.html for possible solutions
Zigbee2MQTT:error 2022-12-15 20:55:41: Exiting...
Zigbee2MQTT:error 2022-12-15 20:55:41: Error: Failed to connect to the adapter (Error: SRSP - SYS - ping after 6000ms)
at ZStackAdapter.start (/opt/zigbee2mqtt/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/zStackAdapter.ts:103:27)
at Controller.start (/opt/zigbee2mqtt/node_modules/zigbee-herdsman/src/controller/controller.ts:132:29)
at Zigbee.start (/opt/zigbee2mqtt/lib/zigbee.ts:58:27)
at Controller.start (/opt/zigbee2mqtt/lib/controller.ts:101:27)
at start (/opt/zigbee2mqtt/index.js:107:5)

I'm using a Sonoff Zigbee 3.0 USB dongle plus mapped on this port:

lrwxrwxrwx 1 root root 13 Dec 15 17:58 usb-ITEAD_SONOFF_Zigbee_3.0_USB_Dongle_Plus_V2_20220811193407-if00 -> ../../ttyACM0
any suggestions?

thanks in advance
 
Virtual Environment 7.3-3

Zigbee2MQTT LXC​

Sonoff zigbee ZBDongle-P on Lenovo Thinkcentre 645p

this is the error:

root@zigbee2mqtt:~# cd /opt/zigbee2mqtt && npm start

> zigbee2mqtt@1.28.4 start
> node index.js

Zigbee2MQTT:info 2022-12-17 21:53:03: Logging to console and directory: '/opt/zigbee2mqtt/data/log/2022-12-17.21-53-03' filename: log.txt
Zigbee2MQTT:info 2022-12-17 21:53:03: Starting Zigbee2MQTT version 1.28.4 (commit #52e545f9)
Zigbee2MQTT:info 2022-12-17 21:53:03: Starting zigbee-herdsman (0.14.76)
Zigbee2MQTT:error 2022-12-17 21:53:04: Error while starting zigbee-herdsman
Zigbee2MQTT:error 2022-12-17 21:53:04: Failed to start zigbee
Zigbee2MQTT:error 2022-12-17 21:53:04: Check https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start.html for possible solutions
Zigbee2MQTT:error 2022-12-17 21:53:04: Exiting...
Zigbee2MQTT:error 2022-12-17 21:53:04: Error: Error while opening serialport 'Error: Error Resource temporarily unavailable Cannot lock port'
at SerialPort.<anonymous> (/opt/zigbee2mqtt/node_modules/zigbee-herdsman/src/adapter/z-stack/znp/znp.ts:146:28)
at SerialPort._error (/opt/zigbee2mqtt/node_modules/@serialport/stream/lib/index.js:198:14)
at /opt/zigbee2mqtt/node_modules/@serialport/stream/lib/index.js:242:12
 
That is more, but still insufficient information. Please provide your LX(C) container configuration, especially how you did the serial port binding.
 
thanks! this is the configuration file... I hope, i'm a newbie sorry
lxc.cgroup.relative = 0
lxc.cgroup.dir.monitor = lxc.monitor/101
lxc.cgroup.dir.container = lxc/101
lxc.cgroup.dir.container.inner = ns
lxc.arch = amd64
lxc.include = /usr/share/lxc/config/debian.common.conf
lxc.apparmor.profile = generated
lxc.apparmor.allow_nesting = 1
lxc.monitor.unshare = 1
lxc.tty.max = 2
lxc.environment = TERM=linux
lxc.uts.name = zigbee2mqtt
lxc.cgroup2.memory.max = 1073741824
lxc.cgroup2.memory.swap.max = 536870912
lxc.rootfs.path = /var/lib/lxc/101/rootfs
lxc.net.0.type = veth
lxc.net.0.veth.pair = veth101i0
lxc.net.0.hwaddr = 2A:96:8A:A1:74:2B
lxc.net.0.name = eth0
lxc.net.0.script.up = /usr/share/lxc/lxcnetaddbr
lxc.cgroup2.devices.allow = a
lxc.cap.drop =
lxc.cgroup2.devices.allow = c 188:* rwm
lxc.cgroup2.devices.allow = c 189:* rwm
lxc.mount.entry = /dev/serial/by-id dev/serial/by-id none bind,optional,create=dir
lxc.mount.entry = /dev/ttyUSB0 dev/ttyUSB0 none bind,optional,create=file
lxc.mount.entry = /dev/ttyUSB1 dev/ttyUSB1 none bind,optional,create=file
lxc.mount.entry = /dev/ttyACM0 dev/ttyACM0 none bind,optional,create=file
lxc.mount.entry = /dev/ttyACM1 dev/ttyACM1 none bind,optional,create=file
lxc.cgroup2.cpuset.cpus = 0-1
 
What about the PVE part of the container?

Code:
cat /etc/pve/lxc/101.conf

What about the permissions inside of your container?

Code:
ls -l /dev/tty*
 
root@zigbee2mqtt:/etc# ls -l /dev/tty*
crw-rw-rw- 1 root root 5, 0 Dec 18 00:34 /dev/tty
crw------- 1 root tty 136, 1 Dec 18 18:00 /dev/tty1
crw--w---- 1 root tty 136, 2 Dec 18 00:34 /dev/tty2
---------- 1 root root 0 Dec 18 00:34 /dev/ttyACM0
---------- 1 root root 0 Dec 18 00:34 /dev/ttyACM1
---------- 1 root root 0 Dec 18 00:34 /dev/ttyUSB0
---------- 1 root root 0 Dec 18 00:34 /dev/ttyUSB1

root@pve:~# cat /etc/pve/lxc/101.conf
## Zigbee2MQTT LXC
#### https%3A//tteck.github.io/Proxmox/
#<a href='https%3A//ko-fi.com/D1D7EP4GF'><img src='https%3A//img.shields.io/badge/%E2%98%95-Buy me a coffee-red' /></a>
arch: amd64
cores: 2
features: nesting=1
hostname: zigbee2mqtt
memory: 1024
net0: name=eth0,bridge=vmbr0,hwaddr=2A:96:8A:A1:74:2B,ip=dhcp,type=veth
onboot: 1
ostype: debian
rootfs: local-lvm:vm-101-disk-0,size=4G
swap: 512
lxc.cgroup2.devices.allow: a
lxc.cap.drop:
lxc.cgroup2.devices.allow: c 188:* rwm
lxc.cgroup2.devices.allow: c 189:* rwm
lxc.mount.entry: /dev/serial/by-id dev/serial/by-id none bind,optional,create=dir
lxc.mount.entry: /dev/ttyUSB0 dev/ttyUSB0 none bind,optional,create=file
lxc.mount.entry: /dev/ttyUSB1 dev/ttyUSB1 none bind,optional,create=file
lxc.mount.entry: /dev/ttyACM0 dev/ttyACM0 none bind,optional,create=file
lxc.mount.entry: /dev/ttyACM1 dev/ttyACM1 none bind,optional,create=file
 
Okay, that looks like wild copy & paste from different sources in order to get it working.

Please post also the output of ls -l /dev/tty* from the PVE host in order to see the actual TTY devices.
 
Zigbee2MQTT:error 2022-12-17 21:53:04: Error: Error while opening serialport 'Error: Error Resource temporarily unavailable Cannot lock port'

Something else is using your Sonoff Dongle. Make sure Z2M isn't already running (IP:9442) I've seen it happen before.
 
Okay, that looks like wild copy & paste from different sources in order to get it working.

Please post also the output of ls -l /dev/tty* from the PVE host in order to see the actual TTY devices.
root@pve:~# ls -l /dev/tty*
crw-rw-rw- 1 root tty 5, 0 Dec 18 01:32 /dev/tty
crw--w---- 1 root tty 4, 0 Dec 18 01:32 /dev/tty0
crw--w---- 1 root tty 4, 1 Dec 18 01:32 /dev/tty1
crw--w---- 1 root tty 4, 10 Dec 18 01:32 /dev/tty10
crw--w---- 1 root tty 4, 11 Dec 18 01:32 /dev/tty11
crw--w---- 1 root tty 4, 12 Dec 18 01:32 /dev/tty12
crw--w---- 1 root tty 4, 13 Dec 18 01:32 /dev/tty13
crw--w---- 1 root tty 4, 14 Dec 18 01:32 /dev/tty14
crw--w---- 1 root tty 4, 15 Dec 18 01:32 /dev/tty15
crw--w---- 1 root tty 4, 16 Dec 18 01:32 /dev/tty16
crw--w---- 1 root tty 4, 17 Dec 18 01:32 /dev/tty17
crw--w---- 1 root tty 4, 18 Dec 18 01:32 /dev/tty18
crw--w---- 1 root tty 4, 19 Dec 18 01:32 /dev/tty19
crw--w---- 1 root tty 4, 2 Dec 18 01:32 /dev/tty2
crw--w---- 1 root tty 4, 20 Dec 18 01:32 /dev/tty20
crw--w---- 1 root tty 4, 21 Dec 18 01:32 /dev/tty21
crw--w---- 1 root tty 4, 22 Dec 18 01:32 /dev/tty22
crw--w---- 1 root tty 4, 23 Dec 18 01:32 /dev/tty23
crw--w---- 1 root tty 4, 24 Dec 18 01:32 /dev/tty24
crw--w---- 1 root tty 4, 25 Dec 18 01:32 /dev/tty25
crw--w---- 1 root tty 4, 26 Dec 18 01:32 /dev/tty26
crw--w---- 1 root tty 4, 27 Dec 18 01:32 /dev/tty27
crw--w---- 1 root tty 4, 28 Dec 18 01:32 /dev/tty28
crw--w---- 1 root tty 4, 29 Dec 18 01:32 /dev/tty29
crw--w---- 1 root tty 4, 3 Dec 18 01:32 /dev/tty3
crw--w---- 1 root tty 4, 30 Dec 18 01:32 /dev/tty30
crw--w---- 1 root tty 4, 31 Dec 18 01:32 /dev/tty31
crw--w---- 1 root tty 4, 32 Dec 18 01:32 /dev/tty32
crw--w---- 1 root tty 4, 33 Dec 18 01:32 /dev/tty33
crw--w---- 1 root tty 4, 34 Dec 18 01:32 /dev/tty34
crw--w---- 1 root tty 4, 35 Dec 18 01:32 /dev/tty35
crw--w---- 1 root tty 4, 36 Dec 18 01:32 /dev/tty36
crw--w---- 1 root tty 4, 37 Dec 18 01:32 /dev/tty37
crw--w---- 1 root tty 4, 38 Dec 18 01:32 /dev/tty38
crw--w---- 1 root tty 4, 39 Dec 18 01:32 /dev/tty39
crw--w---- 1 root tty 4, 4 Dec 18 01:32 /dev/tty4
crw--w---- 1 root tty 4, 40 Dec 18 01:32 /dev/tty40
crw--w---- 1 root tty 4, 41 Dec 18 01:32 /dev/tty41
crw--w---- 1 root tty 4, 42 Dec 18 01:32 /dev/tty42
crw--w---- 1 root tty 4, 43 Dec 18 01:32 /dev/tty43
crw--w---- 1 root tty 4, 44 Dec 18 01:32 /dev/tty44
crw--w---- 1 root tty 4, 45 Dec 18 01:32 /dev/tty45
crw--w---- 1 root tty 4, 46 Dec 18 01:32 /dev/tty46
crw--w---- 1 root tty 4, 47 Dec 18 01:32 /dev/tty47
crw--w---- 1 root tty 4, 48 Dec 18 01:32 /dev/tty48
crw--w---- 1 root tty 4, 49 Dec 18 01:32 /dev/tty49
crw--w---- 1 root tty 4, 5 Dec 18 01:32 /dev/tty5
crw--w---- 1 root tty 4, 50 Dec 18 01:32 /dev/tty50
crw--w---- 1 root tty 4, 51 Dec 18 01:32 /dev/tty51
crw--w---- 1 root tty 4, 52 Dec 18 01:32 /dev/tty52
crw--w---- 1 root tty 4, 53 Dec 18 01:32 /dev/tty53
crw--w---- 1 root tty 4, 54 Dec 18 01:32 /dev/tty54
crw--w---- 1 root tty 4, 55 Dec 18 01:32 /dev/tty55
crw--w---- 1 root tty 4, 56 Dec 18 01:32 /dev/tty56
crw--w---- 1 root tty 4, 57 Dec 18 01:32 /dev/tty57
crw--w---- 1 root tty 4, 58 Dec 18 01:32 /dev/tty58
crw--w---- 1 root tty 4, 59 Dec 18 01:32 /dev/tty59
crw--w---- 1 root tty 4, 6 Dec 18 01:32 /dev/tty6
crw--w---- 1 root tty 4, 60 Dec 18 01:32 /dev/tty60
crw--w---- 1 root tty 4, 61 Dec 18 01:32 /dev/tty61
crw--w---- 1 root tty 4, 62 Dec 18 01:32 /dev/tty62
crw--w---- 1 root tty 4, 63 Dec 18 01:32 /dev/tty63
crw--w---- 1 root tty 4, 7 Dec 18 01:32 /dev/tty7
crw--w---- 1 root tty 4, 8 Dec 18 01:32 /dev/tty8
crw--w---- 1 root tty 4, 9 Dec 18 01:32 /dev/tty9
crw------- 1 root root 5, 3 Dec 18 01:32 /dev/ttyprintk
crw-rw---- 1 root dialout 4, 64 Dec 18 01:32 /dev/ttyS0
crw-rw---- 1 root dialout 4, 65 Dec 18 01:32 /dev/ttyS1
crw-rw---- 1 root dialout 4, 74 Dec 18 01:32 /dev/ttyS10
crw-rw---- 1 root dialout 4, 75 Dec 18 01:32 /dev/ttyS11
crw-rw---- 1 root dialout 4, 76 Dec 18 01:32 /dev/ttyS12
crw-rw---- 1 root dialout 4, 77 Dec 18 01:32 /dev/ttyS13
crw-rw---- 1 root dialout 4, 78 Dec 18 01:32 /dev/ttyS14
crw-rw---- 1 root dialout 4, 79 Dec 18 01:32 /dev/ttyS15
crw-rw---- 1 root dialout 4, 80 Dec 18 01:32 /dev/ttyS16
crw-rw---- 1 root dialout 4, 81 Dec 18 01:32 /dev/ttyS17
crw-rw---- 1 root dialout 4, 82 Dec 18 01:32 /dev/ttyS18
crw-rw---- 1 root dialout 4, 83 Dec 18 01:32 /dev/ttyS19
crw-rw---- 1 root dialout 4, 66 Dec 18 01:32 /dev/ttyS2
crw-rw---- 1 root dialout 4, 84 Dec 18 01:32 /dev/ttyS20
crw-rw---- 1 root dialout 4, 85 Dec 18 01:32 /dev/ttyS21
crw-rw---- 1 root dialout 4, 86 Dec 18 01:32 /dev/ttyS22
crw-rw---- 1 root dialout 4, 87 Dec 18 01:32 /dev/ttyS23
crw-rw---- 1 root dialout 4, 88 Dec 18 01:32 /dev/ttyS24
crw-rw---- 1 root dialout 4, 89 Dec 18 01:32 /dev/ttyS25
crw-rw---- 1 root dialout 4, 90 Dec 18 01:32 /dev/ttyS26
crw-rw---- 1 root dialout 4, 91 Dec 18 01:32 /dev/ttyS27
crw-rw---- 1 root dialout 4, 92 Dec 18 01:32 /dev/ttyS28
crw-rw---- 1 root dialout 4, 93 Dec 18 01:32 /dev/ttyS29
crw-rw---- 1 root dialout 4, 67 Dec 18 01:32 /dev/ttyS3
crw-rw---- 1 root dialout 4, 94 Dec 18 01:32 /dev/ttyS30
crw-rw---- 1 root dialout 4, 95 Dec 18 01:32 /dev/ttyS31
crw-rw---- 1 root dialout 4, 68 Dec 18 01:32 /dev/ttyS4
crw-rw---- 1 root dialout 4, 69 Dec 18 01:32 /dev/ttyS5
crw-rw---- 1 root dialout 4, 70 Dec 18 01:32 /dev/ttyS6
crw-rw---- 1 root dialout 4, 71 Dec 18 01:32 /dev/ttyS7
crw-rw---- 1 root dialout 4, 72 Dec 18 01:32 /dev/ttyS8
crw-rw---- 1 root dialout 4, 73 Dec 18 01:32 /dev/ttyS9
 
So, there is no original device present and it can therefore not be bind-mounted.

Where is your USB device /dev/ttyACM0? Please check if it's visible in lsusb.
 
So, there is no original device present and it can therefore not be bind-mounted.

Where is your USB device /dev/ttyACM0? Please check if it's visible in lsusb.

root@pve:~# lsusb
Bus 003 Device 004: ID 046d:c05b Logitech, Inc. M-U0004 810-001317 [B110 Optical USB Mouse]
Bus 003 Device 003: ID 2f68:0082 Hoksi Technology DURGOD Taurus K320
Bus 003 Device 002: ID 0438:7900 Advanced Micro Devices, Inc. Root Hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 1a86:55d4 QinHeng Electronics SONOFF Zigbee 3.0 USB Dongle Plus V2
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub


crw-rw-rw- 1 root root 5, 0 Dec 18 00:34 /dev/tty
crw------- 1 root tty 136, 1 Dec 22 21:05 /dev/tty1
crw--w---- 1 root tty 136, 2 Dec 18 00:34 /dev/tty2
---------- 1 root root 0 Dec 18 00:34 /dev/ttyACM0
---------- 1 root root 0 Dec 18 00:34 /dev/ttyACM1
---------- 1 root root 0 Dec 18 00:34 /dev/ttyUSB0
---------- 1 root root 0 Dec 18 00:34 /dev/ttyUSB1
 
@maddog74 did you ever resolve the Issue? I have the exact same problem with my SONOFF stick.

I moved my Home Assistant installation from a raspberry pie to a Proxmox vm and added the device to the vm. Everything but the stick works as before. Keep getting "Error: Failed to connect to the adapter (Error: SRSP - SYS - ping after 6000ms)" messages.
 
Last edited:
@maddog74 did you ever resolve the Issue? I have the exact same problem with my SONOFF stick.

I moved my Home Assistant installation from a raspberry pie to a Proxmox vm and added the device to the vm. Everything but the stick works as before. Keep getting "Error: Failed to connect to the adapter (Error: SRSP - SYS - ping after 6000ms)" messages.
I had this exact issue - moved my Zigbee2MQTT off Home Assistant and onto a Proxmox container. It was incredibly frustrating but I found the solution that works. It was basically that the adapter was being held 'open' by an existing process. Once I stopped Zigbee2MQTT and restarted it, it found the SONOFF adapter straight away.

systemctl stop zigbee2mqtt
systemctl daemon-reload
systemctl start zigbee2mqtt


Hope this helps you out
 
I had this exact issue - moved my Zigbee2MQTT off Home Assistant and onto a Proxmox container. It was incredibly frustrating but I found the solution that works. It was basically that the adapter was being held 'open' by an existing process. Once I stopped Zigbee2MQTT and restarted it, it found the SONOFF adapter straight away.

systemctl stop zigbee2mqtt
systemctl daemon-reload
systemctl start zigbee2mqtt


Hope this helps you out
Thanks for your reply. I really liked the idea of moving zigbee2mqtt into its own container!

But I had the same problem after moving it.
I then moved it to my old Raspberry Pi but again: "Error: SRSP - SYS - ping after 6000ms"
So i figured it was actually a problem with the stick.

What finally solved the problem: I flashed the stick again.

Info about flashing can be found here: zigbee2mqtt.io/guide/adapters/#notes