Zigbee2mqtt help: Error while opening serial port

Any suggestions, please?

zigbee2mqtt was behaving very well until recently. Then, various devices started disappearing and, finally, it seems that the add-on cannot find the CC2531 stick.
I had auto update on (won’t do that again) while traveling a lot, so I’m not sure when/ with which versions the problems really started.

I have tried reflashing the CC2531 firmware with CC2531_DEFAULT_20190608 and uninstalling/reinstalling the add on. I have also rebooted the host system, resetting the stick, restarting HA, etc., many times.

HA Hassio 102.1
zigbee2mqtt add-on 1.7.1

Host system info

root@homeauto:~# dmesg | grep tty
[    0.000000] console [tty0] enabled
[   92.074357] usb 1-3: FTDI USB Serial Device converter now attached to ttyUSB0
[ 1255.121788] cdc_acm 1-2:1.0: ttyACM0: USB ACM device
root@homeauto:~# ls -l /dev/serial/by-id
total 0
lrwxrwxrwx 1 root root 13 Nov 23 16:17 usb-RFXCOM_RFXtrx433_A11I9D34-if00-port0 -> ../../ttyUSB0
lrwxrwxrwx 1 root root 13 Nov 23 16:17 usb-Texas_Instruments_TI_CC2531_USB_CDC___0X00124B00193695D0-if00 -> ../../ttyACM0

config

{
  "data_path": "/share/zigbee2mqtt",
  "devices": "devices.yaml",
  "groups": "groups.yaml",
  "homeassistant": true,
  "permit_join": false,
  "mqtt": {
    "base_topic": "zigbee2mqtt",
    "server": "mqtt://192.168.86.111:8883",
    "user": "xxxx",
    "password": "xxxx"
  },
  "serial": {
    "port": "ttyACM0"
  },
  "advanced": {
    "pan_id": 6754,
    "channel": 11,
    "network_key": [
      2,
      59,
      56,
      29,
      34,
      35,
      74,
      67,
      90,
      9,
      45,
      62,
      74,
      65,
      8,
      34
    ],
    "availability_blacklist": []
  },
  "ban": [],
  "whitelist": [],
  "queue": {},
  "socat": {
    "enabled": false,
    "master": "pty,raw,echo=0,link=/dev/ttyZ2M,mode=777",
    "slave": "tcp-listen:8485,keepalive,nodelay,reuseaddr,keepidle=1,keepintvl=1,keepcnt=5",
    "restartdelay": 1,
    "initialdelay": 1,
    "options": "-d -d",
    "log": false
  }
}

log

./run.sh: line 16: [Info] Configuration backup found in /share/zigbee2mqtt/.configuration.yaml.bk. Skipping config backup.: No such file or directory
[Info] Socat is DISABLED and not started
2019-11-23T16:25:24: PM2 log: Launching in no daemon mode
2019-11-23T16:25:24: PM2 log: App [npm:0] starting in -fork mode-
2019-11-23T16:25:24: PM2 log: App [npm:0] online
> [email protected] start /zigbee2mqtt-1.7.1
> node index.js
zigbee2mqtt:info  2019-11-23T16:25:25: Logging to directory: '/share/zigbee2mqtt/log/2019-11-23.16-25-24'
zigbee2mqtt:info  2019-11-23T16:25:25: Starting zigbee2mqtt version 1.7.1 (commit #unknown)
zigbee2mqtt:info  2019-11-23T16:25:25: Starting zigbee-herdsman...
zigbee2mqtt:error 2019-11-23T16:25:25: Error while starting zigbee-herdsman
zigbee2mqtt:error 2019-11-23T16:25:25: Failed to start zigbee
zigbee2mqtt:error 2019-11-23T16:25:25: Exiting...
zigbee2mqtt:error 2019-11-23T16:25:25: Error: Error while opening serialport 'Error: Error: No such file or directory, cannot open ttyACM0'
    at Znp.<anonymous> (/zigbee2mqtt-1.7.1/node_modules/zigbee-herdsman/dist/adapter/z-stack/znp/znp.js:109:32)
    at Generator.next (<anonymous>)
    at /zigbee2mqtt-1.7.1/node_modules/zigbee-herdsman/dist/adapter/z-stack/znp/znp.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (/zigbee2mqtt-1.7.1/node_modules/zigbee-herdsman/dist/adapter/z-stack/znp/znp.js:4:12)
    at SerialPort.serialPort.open (/zigbee2mqtt-1.7.1/node_modules/zigbee-herdsman/dist/adapter/z-stack/znp/znp.js:107:49)
    at SerialPort._error (/zigbee2mqtt-1.7.1/node_modules/zigbee-herdsman/node_modules/@serialport/stream/stream.js:197:14)
    at binding.open.then.err (/zigbee2mqtt-1.7.1/node_modules/zigbee-herdsman/node_modules/@serialport/stream/stream.js:241:12)
npm ERR!
 code ELIFECYCLE
npm ERR! errno 1
npm ERR!
 [email protected] start: `node index.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] start script.
npm
 ERR! This is probably not a problem with npm. There is likely additional logging output above.

Hassio “Hardware” report

Hardware
serial:
/dev/ttyS13
/dev/ttyS12
/dev/ttyS4
/dev/ttyS1
/dev/ttyS28
/dev/ttyS6
/dev/ttyS27
/dev/ttyS21
/dev/ttyACM0
/dev/ttyS7
/dev/ttyS30
/dev/serial/by-id/usb-RFXCOM_RFXtrx433_A11I9D34-if00-port0
/dev/ttyS11
/dev/ttyS26
/dev/ttyS20
/dev/ttyS25
/dev/serial/by-id/usb-Texas_Instruments_TI_CC2531_USB_CDC___0X00124B00193695D0-if00
/dev/ttyS22
/dev/ttyS2
/dev/ttyS23
/dev/ttyUSB0
/dev/ttyS18
/dev/ttyS16
/dev/ttyS14
/dev/ttyS17
/dev/ttyS10
/dev/ttyS15
/dev/ttyS3
/dev/ttyS31
/dev/ttyS24
/dev/ttyS9
/dev/ttyS8
/dev/ttyS5
/dev/ttyS29
/dev/ttyS19
/dev/ttyS0
input:
HDA Intel PCH HDMI/DP,pcm=8
HDA Intel PCH HDMI/DP,pcm=3
HDA Intel PCH Front Headphone
Power Button
HDA Intel PCH HDMI/DP,pcm=9
HDA Intel PCH Mic
Video Bus
Sleep Button
HDA Intel PCH HDMI/DP,pcm=10
HDA Intel PCH HDMI/DP,pcm=7
disk:
gpio:
gpiochip200
audio:

This looks incomplete.

I belive it should be :

}, 
"serial": {
"port": "/dev/ttyACM0"
},

Just need to put the “/dev/” in front of ttyACM0.

hope it helps.

1 Like

THANK YOU. This had been driving me crazy. I must have lost the “/dev/” when I was experimenting with various config edits to get z2m running. I completely overlooked the incorrect path.

It’s now working again. Fingers crossed.