Koenkk / zigbee2mqtt

Zigbee 🐝 to MQTT bridge 🌉, get rid of your proprietary Zigbee bridges 🔨
https://www.zigbee2mqtt.io
GNU General Public License v3.0
12.07k stars 1.68k forks source link

Zigbee2MQTT fails to start install docker-compose #13555

Closed gurues closed 2 years ago

gurues commented 2 years ago

What happened?

Hi, I try to install zigbee2mqtt with docker but it won't start. I have read and applied Zigbee2MQTT fails to start but still the same. Home assistant autodetect sonoff zigbee 3.0 usb in /dev/ttyUSB0 to install ZHA. I have not installed ZHA.

Thanks for your help I'm desperate, I've read everything I've found about this problem but I'm not able to fix it

Path Adapter: gurues@domo-HA:~/domotica/zigbee2mqtt$ ls -l /dev/serial/by-id total 0 lrwxrwxrwx 1 root root 13 ago 14 19:56 usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_28471632d69cec11a6d4614d73138bba-if00-port0 -> ../../ttyUSB0

gurues@domo-HA:/dev$ ls -ls ttyUSB0 0 crw-rw---- 1 gurues dialout 188, 0 ago 14 19:56 ttyUSB0

Zigbee2MQTT fails to start (response -> success): gurues@domo-HA:~/domotica/zigbee2mqtt$ test -w /dev/ttyUSB0 && echo success || echo failure success

Permissions and user groups "gurues": gurues@domo-HA:~/domotica/zigbee2mqtt$ id uid=1000(gurues) gid=1000(gurues) grupos=1000(gurues),5(tty),10(uucp),20(dialout),24(cdrom),25(floppy),27(sudo),29(audio),30(dip),44(video),46(plugdev),101(systemd-journal),108(netdev),113(bluetooth),118(lpadmin),121(scanner),998(docker)

Pach install: gurues@domo-HA:~/domotica/zigbee2mqtt$ ls data gurues@domo-HA:~/domotica/zigbee2mqtt$ cd data gurues@domo-HA:~/domotica/zigbee2mqtt/data$ ls configuration.yaml log

configuratiión.yaml: homeassistant: true permit_join: true mqtt: base_topic: zigbee2mqtt user: ***** password: ****** server: mqtt://192.168.1.xxx:1883 version: 5 serial: port: /dev/ttyUSB0 frontend: port: 8099

docker-compose `version: '3.8' services: zigbee2mqtt: container_name: zigbee2mqtt image: koenkk/zigbee2mqtt restart: unless-stopped group_add:

What did you expect to happen?

No response

How to reproduce it (minimal and precise)

No response

Zigbee2MQTT version

1.27.0

Adapter firmware version

CC1352P2_CC2652P_launchpad_coordinator_20220219

Adapter

usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus

Debug log

Zigbee2MQTT:error 2022-08-15 16:56:54: Error: Error while opening serialport 'Error: Error: No such file or directory, cannot open /dev/ttyUSB0' at SerialPort. (/app/node_modules/zigbee-herdsman/src/adapter/z-stack/znp/znp.ts:146:28) at SerialPort._error (/app/node_modules/@serialport/stream/lib/index.js:198:14) at /app/node_modules/@serialport/stream/lib/index.js:242:12 Using '/app/data' as data directory Zigbee2MQTT:info 2022-08-15 16:57:55: Logging to console and directory: '/app/data/log/2022-08-15.16-57-55' filename: log.txt Zigbee2MQTT:info 2022-08-15 16:57:55: Starting Zigbee2MQTT version 1.27.0 (commit #a9b8808) Zigbee2MQTT:info 2022-08-15 16:57:55: Starting zigbee-herdsman (0.14.46) Zigbee2MQTT:error 2022-08-15 16:57:55: Error while starting zigbee-herdsman Zigbee2MQTT:error 2022-08-15 16:57:55: Failed to start zigbee Zigbee2MQTT:error 2022-08-15 16:57:55: Check https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start.html for possible solutions Zigbee2MQTT:error 2022-08-15 16:57:55: Exiting... Zigbee2MQTT:error 2022-08-15 16:57:55: Error: Error while opening serialport 'Error: Error: No such file or directory, cannot open /dev/ttyUSB0' at SerialPort. (/app/node_modules/zigbee-herdsman/src/adapter/z-stack/znp/znp.ts:146:28) at SerialPort._error (/app/node_modules/@serialport/stream/lib/index.js:198:14) at /app/node_modules/@serialport/stream/lib/index.js:242:12 Using '/app/data' as data directory Zigbee2MQTT:info 2022-08-15 16:58:57: Logging to console and directory: '/app/data/log/2022-08-15.16-58-57' filename: log.txt Zigbee2MQTT:info 2022-08-15 16:58:57: Starting Zigbee2MQTT version 1.27.0 (commit #a9b8808) Zigbee2MQTT:info 2022-08-15 16:58:57: Starting zigbee-herdsman (0.14.46) Zigbee2MQTT:error 2022-08-15 16:58:57: Error while starting zigbee-herdsman Zigbee2MQTT:error 2022-08-15 16:58:57: Failed to start zigbee Zigbee2MQTT:error 2022-08-15 16:58:57: Check https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start.html for possible solutions Zigbee2MQTT:error 2022-08-15 16:58:57: Exiting... Zigbee2MQTT:error 2022-08-15 16:58:57: Error: Error while opening serialport 'Error: Error: No such file or directory, cannot open /dev/ttyUSB0' at SerialPort. (/app/node_modules/zigbee-herdsman/src/adapter/z-stack/znp/znp.ts:146:28) at SerialPort._error (/app/node_modules/@serialport/stream/lib/index.js:198:14) at /app/node_modules/@serialport/stream/lib/index.js:242:12 Using '/app/data' as data directory Zigbee2MQTT:info 2022-08-15 16:59:58: Logging to console and directory: '/app/data/log/2022-08-15.16-59-58' filename: log.txt Zigbee2MQTT:info 2022-08-15 16:59:58: Starting Zigbee2MQTT version 1.27.0 (commit #a9b8808) Zigbee2MQTT:info 2022-08-15 16:59:58: Starting zigbee-herdsman (0.14.46) Zigbee2MQTT:error 2022-08-15 16:59:59: Error while starting zigbee-herdsman Zigbee2MQTT:error 2022-08-15 16:59:59: Failed to start zigbee Zigbee2MQTT:error 2022-08-15 16:59:59: Check https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start.html for possible solutions Zigbee2MQTT:error 2022-08-15 16:59:59: Exiting... Zigbee2MQTT:error 2022-08-15 16:59:59: Error: Error while opening serialport 'Error: Error: No such file or directory, cannot open /dev/ttyUSB0' at SerialPort. (/app/node_modules/zigbee-herdsman/src/adapter/z-stack/znp/znp.ts:146:28) at SerialPort._error (/app/node_modules/@serialport/stream/lib/index.js:198:14) at /app/node_modules/@serialport/stream/lib/index.js:242:12 Using '/app/data' as data directory Zigbee2MQTT:info 2022-08-15 17:01:00: Logging to console and directory: '/app/data/log/2022-08-15.17-01-00' filename: log.txt Zigbee2MQTT:info 2022-08-15 17:01:00: Starting Zigbee2MQTT version 1.27.0 (commit #a9b8808) Zigbee2MQTT:info 2022-08-15 17:01:00: Starting zigbee-herdsman (0.14.46) Zigbee2MQTT:error 2022-08-15 17:01:00: Error while starting zigbee-herdsman Zigbee2MQTT:error 2022-08-15 17:01:00: Failed to start zigbee Zigbee2MQTT:error 2022-08-15 17:01:00: Check https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start.html for possible solutions Zigbee2MQTT:error 2022-08-15 17:01:00: Exiting... Zigbee2MQTT:error 2022-08-15 17:01:00: Error: Error while opening serialport 'Error: Error: No such file or directory, cannot open /dev/ttyUSB0' at SerialPort. (/app/node_modules/zigbee-herdsman/src/adapter/z-stack/znp/znp.ts:146:28) at SerialPort._error (/app/node_modules/@serialport/stream/lib/index.js:198:14) at /app/node_modules/@serialport/stream/lib/index.js:242:12 Using '/app/data' as data directory Zigbee2MQTT:info 2022-08-15 17:02:02: Logging to console and directory: '/app/data/log/2022-08-15.17-02-02' filename: log.txt Zigbee2MQTT:info 2022-08-15 17:02:02: Starting Zigbee2MQTT version 1.27.0 (commit #a9b8808) Zigbee2MQTT:info 2022-08-15 17:02:02: Starting zigbee-herdsman (0.14.46) Zigbee2MQTT:error 2022-08-15 17:02:02: Error while starting zigbee-herdsman Zigbee2MQTT:error 2022-08-15 17:02:02: Failed to start zigbee Zigbee2MQTT:error 2022-08-15 17:02:02: Check https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start.html for possible solutions Zigbee2MQTT:error 2022-08-15 17:02:02: Exiting... Zigbee2MQTT:error 2022-08-15 17:02:02: Error: Error while opening serialport 'Error: Error: No such file or directory, cannot open /dev/ttyUSB0' at SerialPort. (/app/node_modules/zigbee-herdsman/src/adapter/z-stack/znp/znp.ts:146:28) at SerialPort._error (/app/node_modules/@serialport/stream/lib/index.js:198:14) at /app/node_modules/@serialport/stream/lib/index.js:242:12 Using '/app/data' as data directory Zigbee2MQTT:info 2022-08-15 17:03:04: Logging to console and directory: '/app/data/log/2022-08-15.17-03-04' filename: log.txt Zigbee2MQTT:info 2022-08-15 17:03:04: Starting Zigbee2MQTT version 1.27.0 (commit #a9b8808) Zigbee2MQTT:info 2022-08-15 17:03:04: Starting zigbee-herdsman (0.14.46) Zigbee2MQTT:error 2022-08-15 17:03:04: Error while starting zigbee-herdsman Zigbee2MQTT:error 2022-08-15 17:03:04: Failed to start zigbee Zigbee2MQTT:error 2022-08-15 17:03:04: Check https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start.html for possible solutions Zigbee2MQTT:error 2022-08-15 17:03:04: Exiting... Zigbee2MQTT:error 2022-08-15 17:03:04: Error: Error while opening serialport 'Error: Error: No such file or directory, cannot open /dev/ttyUSB0' at SerialPort. (/app/node_modules/zigbee-herdsman/src/adapter/z-stack/znp/znp.ts:146:28) at SerialPort._error (/app/node_modules/@serialport/stream/lib/index.js:198:14) at /app/node_modules/@serialport/stream/lib/index.js:242:12 Using '/app/data' as data directory Zigbee2MQTT:info 2022-08-15 17:04:05: Logging to console and directory: '/app/data/log/2022-08-15.17-04-05' filename: log.txt Zigbee2MQTT:info 2022-08-15 17:04:05: Starting Zigbee2MQTT version 1.27.0 (commit #a9b8808) Zigbee2MQTT:info 2022-08-15 17:04:05: Starting zigbee-herdsman (0.14.46) Zigbee2MQTT:error 2022-08-15 17:04:06: Error while starting zigbee-herdsman Zigbee2MQTT:error 2022-08-15 17:04:06: Failed to start zigbee Zigbee2MQTT:error 2022-08-15 17:04:06: Check https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start.html for possible solutions Zigbee2MQTT:error 2022-08-15 17:04:06: Exiting... Zigbee2MQTT:error 2022-08-15 17:04:06: Error: Error while opening serialport 'Error: Error: No such file or directory, cannot open /dev/ttyUSB0' at SerialPort. (/app/node_modules/zigbee-herdsman/src/adapter/z-stack/znp/znp.ts:146:28) at SerialPort._error (/app/node_modules/@serialport/stream/lib/index.js:198:14) at /app/node_modules/@serialport/stream/lib/index.js:242:12 Using '/app/data' as data directory Zigbee2MQTT:info 2022-08-15 17:05:07: Logging to console and directory: '/app/data/log/2022-08-15.17-05-07' filename: log.txt Zigbee2MQTT:info 2022-08-15 17:05:07: Starting Zigbee2MQTT version 1.27.0 (commit #a9b8808) Zigbee2MQTT:info 2022-08-15 17:05:07: Starting zigbee-herdsman (0.14.46) Zigbee2MQTT:error 2022-08-15 17:05:07: Error while starting zigbee-herdsman Zigbee2MQTT:error 2022-08-15 17:05:07: Failed to start zigbee Zigbee2MQTT:error 2022-08-15 17:05:07: Check https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start.html for possible solutions Zigbee2MQTT:error 2022-08-15 17:05:07: Exiting... Zigbee2MQTT:error 2022-08-15 17:05:07: Error: Error while opening serialport 'Error: Error: No such file or directory, cannot open /dev/ttyUSB0' at SerialPort. (/app/node_modules/zigbee-herdsman/src/adapter/z-stack/znp/znp.ts:146:28) at SerialPort._error (/app/node_modules/@serialport/stream/lib/index.js:198:14) at /app/node_modules/@serialport/stream/lib/index.js:242:12

comleoita commented 2 years ago

I've got the same problem.

peteh commented 2 years ago

Your debug log says it cannot find ttyUSB0 which is mapped to ttyACM0 in the container.

So what your docker compose does is the following: /dev/ttyUSB0 (host) -> /dev/ttyACM0 (Container)

Your configuration.yaml says your adapter is /dev/ttyUSB0. However in the container it's /dev/ttyACM0. So you can either set /dev/ttyACM0 in the configuration.yaml or you fix the docker compose file to also map to /dev/ttyUSB0 instead of /dev/ttyACM0.

Fixing your docker compose file for the device mapping like this should work:

    devices:
      # Make sure this matched your adapter location
      - /dev/ttyUSB0:/dev/ttyUSB0
gurues commented 2 years ago

Thanks a million peteh, it is solved and zigbee2mqtt is working.