Koenkk / zigbee2mqtt

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

npm ERR! Failed at the zigbee2mqtt@1.22.2 build script "Allow new Zigbee Devices to join" not present #10877

Closed McGyver64 closed 2 years ago

McGyver64 commented 2 years ago

What happened?

ZigBee2MQTT is recognized by Domoticz and added to devices Custom Button is present, Zigbee2mqtt Button is Present "Allow new Zigbee Devices to join" is not present

Did a full clean install according " https://contactkring.nl/phpbb/viewtopic.php?t=941&start=40 " PI OS = Buster (incl update&upgrade) Mosquitto 1.5.7 zigbee2mqtt=1.22.2 firmware=20211217 node=v12.22.9 npm=6.14.15 python 3.7.3 Domoticz=2021.1 python zigbee plugin= 3.0.0 (downgrade https://github.com/stas-demydiuk/domoticz-zigbee2mqtt-plugin )

ls -l /dev/serial/by-id total 0 lrwxrwxrwx 1 root root 13 Jan 18 16:45 usb-Silicon_Labs_slae.sh_cc2652rbstick-_slaesh_s_iot_stuff_00_12_4B_00_21_CC_37_E9-if00-port0 -> ../../ttyUSB0

Schermafbeelding 2022-01-14 om 12 22 08

What did you expect to happen?

" Allow new Zigbee Devices to join "

Below picture is an illustration of what is missing (top Right corner) Versions are not correct here

Schermafbeelding 2022-01-18 om 17 16 29

e

How to reproduce it (minimal and precise)

default installatie according https://contactkring.nl/phpbb/viewtopic.php?t=941&start=40

Zigbee2MQTT version

1.22.2

Adapter firmware version

20211210

Adapter

Sleassh's CC2625RB

Debug log

pi@raspberrypi:~ $ sudo journalctl -u zigbee2mqtt.service -f

-- Logs begin at Tue 2022-01-18 16:45:34 CET. -- Jan 18 16:49:56 raspberrypi npm[3560]: npm ERR! /home/pi/.npm/_logs/2022-01-18T15_49_56_158Z-debug.log Jan 18 16:49:56 raspberrypi npm[3560]: at ChildProcess.exithandler (child_process.js:308:12) Jan 18 16:49:56 raspberrypi npm[3560]: at ChildProcess.emit (events.js:314:20) Jan 18 16:49:56 raspberrypi npm[3560]: at maybeClose (internal/child_process.js:1022:16) Jan 18 16:49:56 raspberrypi npm[3560]: at Socket. (internal/child_process.js:444:11) Jan 18 16:49:56 raspberrypi npm[3560]: at Socket.emit (events.js:314:20) Jan 18 16:49:56 raspberrypi npm[3560]: at Pipe. (net.js:675:12) Jan 18 16:49:56 raspberrypi npm[3560]: (node:3572) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) Jan 18 16:49:56 raspberrypi npm[3560]: (node:3572) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. Jan 18 16:49:56 raspberrypi systemd[1]: zigbee2mqtt.service: Succeeded. Jan 18 16:49:56 raspberrypi systemd[1]: zigbee2mqtt.service: Service RestartSec=100ms expired, scheduling restart. Jan 18 16:49:56 raspberrypi systemd[1]: zigbee2mqtt.service: Scheduled restart job, restart counter is at 92. Jan 18 16:49:56 raspberrypi systemd[1]: Stopped zigbee2mqtt. Jan 18 16:49:56 raspberrypi systemd[1]: Started zigbee2mqtt. Jan 18 16:49:57 raspberrypi npm[3594]: > zigbee2mqtt@1.22.2 start /opt/zigbee2mqtt Jan 18 16:49:57 raspberrypi npm[3594]: > node index.js Jan 18 16:49:58 raspberrypi npm[3594]: Building Zigbee2MQTT... (initial build), failed Jan 18 16:49:58 raspberrypi npm[3594]: (node:3606) UnhandledPromiseRejectionWarning: Error: Command failed: npm run build Jan 18 16:49:58 raspberrypi npm[3594]: sh: 1: tsc: not found Jan 18 16:49:58 raspberrypi npm[3594]: npm ERR! code ELIFECYCLE Jan 18 16:49:58 raspberrypi npm[3594]: npm ERR! syscall spawn Jan 18 16:49:58 raspberrypi npm[3594]: npm ERR! file sh Jan 18 16:49:58 raspberrypi npm[3594]: npm ERR! errno ENOENT Jan 18 16:49:58 raspberrypi npm[3594]: npm ERR! zigbee2mqtt@1.22.2 build: tsc && node index.js writehash Jan 18 16:49:58 raspberrypi npm[3594]: npm ERR! spawn ENOENT Jan 18 16:49:58 raspberrypi npm[3594]: npm ERR! Jan 18 16:49:58 raspberrypi npm[3594]: npm ERR! Failed at the zigbee2mqtt@1.22.2 build script. Jan 18 16:49:58 raspberrypi npm[3594]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above. Jan 18 16:49:58 raspberrypi npm[3594]: npm ERR! A complete log of this run can be found in: Jan 18 16:49:58 raspberrypi npm[3594]: npm ERR! /home/pi/.npm/_logs/2022-01-18T15_49_58_415Z-debug.log Jan 18 16:49:58 raspberrypi npm[3594]: at ChildProcess.exithandler (child_process.js:308:12) Jan 18 16:49:58 raspberrypi npm[3594]: at ChildProcess.emit (events.js:314:20) Jan 18 16:49:58 raspberrypi npm[3594]: at maybeClose (internal/child_process.js:1022:16) Jan 18 16:49:58 raspberrypi npm[3594]: at Socket. (internal/child_process.js:444:11) Jan 18 16:49:58 raspberrypi npm[3594]: at Socket.emit (events.js:314:20) Jan 18 16:49:58 raspberrypi npm[3594]: at Pipe. (net.js:675:12)

pi@raspberrypi:/opt/zigbee2mqtt $ npm start

zigbee2mqtt@1.22.2 start /opt/zigbee2mqtt node index.js

Building Zigbee2MQTT... (initial build), finished Zigbee2MQTT:info 2022-01-18 17:34:07: Logging to console and directory: '/opt/zigbee2mqtt/data/log/2022-01-18.17-34-06' filename: log.txt Zigbee2MQTT:info 2022-01-18 17:34:08: Starting Zigbee2MQTT version 1.22.2 (commit #1a0a9a6e) Zigbee2MQTT:info 2022-01-18 17:34:08: Starting zigbee-herdsman (0.13.188) Zigbee2MQTT:info 2022-01-18 17:34:32: zigbee-herdsman started (reset) Zigbee2MQTT:info 2022-01-18 17:34:32: Coordinator firmware version: '{"meta":{"maintrel":1,"majorrel":2,"minorrel":7,"product":1,"revision":20211217,"transportrev":2},"type":"zStack3x0"}' Zigbee2MQTT:info 2022-01-18 17:34:32: Currently 0 devices are joined: Zigbee2MQTT:warn 2022-01-18 17:34:32: permit_join set to true in configuration.yaml. Zigbee2MQTT:warn 2022-01-18 17:34:32: Allowing new devices to join. Zigbee2MQTT:warn 2022-01-18 17:34:32: Set permit_join to false once you joined all devices. Zigbee2MQTT:info 2022-01-18 17:34:32: Zigbee: allowing new devices to join. Zigbee2MQTT:info 2022-01-18 17:34:33: Connecting to MQTT server at mqtt://localhost Zigbee2MQTT:info 2022-01-18 17:34:33: Connected to MQTT server Zigbee2MQTT:info 2022-01-18 17:34:33: MQTT publish: topic 'zigbee2mqtt/bridge/state', payload 'online'

Koenkk commented 2 years ago

The instructions on https://contactkring.nl/phpbb/viewtopic.php?t=941&start=40 are outdated:

# Install dependencies (as user "pi")
cd /opt/zigbee2mqtt
npm ci --production

should be

# Install dependencies (as user "pi")
cd /opt/zigbee2mqtt
npm ci
McGyver64 commented 2 years ago

I did different new installs with both options. and my last was with "npm ci" Zigbee2Mqtt is running correct, but still the option "allow new devices to join" is not present

pi@raspberrypi:~ $ sudo journalctl -u zigbee2mqtt.service -f

-- Logs begin at Tue 2022-01-18 18:27:27 CET. -- Jan 18 18:28:33 raspberrypi npm[574]: Zigbee2MQTT:info 2022-01-18 18:28:33: zigbee-herdsman started (resumed) Jan 18 18:28:33 raspberrypi npm[574]: Zigbee2MQTT:info 2022-01-18 18:28:33: Coordinator firmware version: '{"meta":{"maintrel":1,"majorrel":2,"minorrel":7,"product":1,"revision":20211217,"transportrev":2},"type":"zStack3x0"}' Jan 18 18:28:33 raspberrypi npm[574]: Zigbee2MQTT:info 2022-01-18 18:28:33: Currently 0 devices are joined: Jan 18 18:28:33 raspberrypi npm[574]: Zigbee2MQTT:warn 2022-01-18 18:28:33: permit_join set to true in configuration.yaml. Jan 18 18:28:33 raspberrypi npm[574]: Zigbee2MQTT:warn 2022-01-18 18:28:33: Allowing new devices to join. Jan 18 18:28:33 raspberrypi npm[574]: Zigbee2MQTT:warn 2022-01-18 18:28:33: Set permit_join to false once you joined all devices. Jan 18 18:28:33 raspberrypi npm[574]: Zigbee2MQTT:info 2022-01-18 18:28:33: Zigbee: allowing new devices to join. Jan 18 18:28:33 raspberrypi npm[574]: Zigbee2MQTT:info 2022-01-18 18:28:33: Connecting to MQTT server at mqtt://localhost Jan 18 18:28:33 raspberrypi npm[574]: Zigbee2MQTT:info 2022-01-18 18:28:33: Connected to MQTT server Jan 18 18:28:33 raspberrypi npm[574]: Zigbee2MQTT:info 2022-01-18 18:28:33: MQTT publish: topic 'zigbee2mqtt/bridge/state', payload 'online'

pi@raspberrypi:/opt/zigbee2mqtt $ npm start

zigbee2mqtt@1.22.2 start /opt/zigbee2mqtt node index.js

Zigbee2MQTT:info 2022-01-19 09:26:45: Logging to console and directory: '/opt/zigbee2mqtt/data/log/2022-01-19.09-26-44' filename: log.txt Zigbee2MQTT:info 2022-01-19 09:26:45: Starting Zigbee2MQTT version 1.22.2 (commit #1a0a9a6e) Zigbee2MQTT:info 2022-01-19 09:26:45: Starting zigbee-herdsman (0.13.188) Zigbee2MQTT:info 2022-01-19 09:26:57: zigbee-herdsman started (resumed) Zigbee2MQTT:info 2022-01-19 09:26:57: Coordinator firmware version: '{"meta":{"maintrel":1,"majorrel":2,"minorrel":7,"product":1,"revision":20211217,"transportrev":2},"type":"zStack3x0"}' Zigbee2MQTT:info 2022-01-19 09:26:57: Currently 0 devices are joined: Zigbee2MQTT:warn 2022-01-19 09:26:57: permit_join set to true in configuration.yaml. Zigbee2MQTT:warn 2022-01-19 09:26:57: Allowing new devices to join. Zigbee2MQTT:warn 2022-01-19 09:26:57: Set permit_join to false once you joined all devices. Zigbee2MQTT:info 2022-01-19 09:26:57: Zigbee: allowing new devices to join. Zigbee2MQTT:info 2022-01-19 09:26:57: Connecting to MQTT server at mqtt://localhost Zigbee2MQTT:info 2022-01-19 09:26:57: Connected to MQTT server Zigbee2MQTT:info 2022-01-19 09:26:57: MQTT publish: topic 'zigbee2mqtt/bridge/state', payload 'online'

LOG Domoticz shows Zigbee2MQTT bridge running

2022-01-19 09:28:15.556 Status: Incoming connection from: 172.16.10.200 2022-01-19 09:30:04.069 Zigbee2MQTT: (Zigbee2MQTT) Zigbee2mqtt bridge is offline 2022-01-19 09:30:31.269 Active notification Subsystems: fcm, http (2/13) 2022-01-19 09:30:31.275 Starting shared server on: :::6144 2022-01-19 09:30:31.182 Status: Domoticz V2021.1 (c)2012-2021 GizMoCuz 2022-01-19 09:30:31.183 Status: Build Hash: 8547c5b7e, Date: 2021-04-17 17:29:11 2022-01-19 09:30:31.183 Status: Startup Path: /home/pi/domoticz/ 2022-01-19 09:30:31.266 Status: PluginSystem: Started, Python version '3.7.3'. 2022-01-19 09:30:31.270 Status: WebServer(HTTP) started on address: :: with port 8080 2022-01-19 09:30:31.274 Status: WebServer(SSL) started on address: :: with port 443 2022-01-19 09:30:31.275 Status: TCPServer: shared server started... 2022-01-19 09:30:31.276 Status: RxQueue: queue worker started... 2022-01-19 09:30:33.276 Zigbee2MQTT hardware started. 2022-01-19 09:30:33.524 Zigbee2MQTT: (Zigbee2MQTT) Installing plugin custom page... 2022-01-19 09:30:33.541 Zigbee2MQTT: (Zigbee2MQTT) Installing plugin custom page completed. 2022-01-19 09:30:33.773 Zigbee2MQTT: (Zigbee2MQTT) Connected to MQTT Server: 127.0.0.1:1883 2022-01-19 09:30:33.874 Zigbee2MQTT: (Zigbee2MQTT) Zigbee2mqtt bridge is offline 2022-01-19 09:30:33.875 Zigbee2MQTT: (Zigbee2MQTT) Received available devices list from bridge 2022-01-19 09:30:33.276 Status: Zigbee2MQTT: (Zigbee2MQTT) Entering work loop. 2022-01-19 09:30:33.276 Status: Zigbee2MQTT: (Zigbee2MQTT) Started. 2022-01-19 09:30:33.277 Status: NotificationSystem: thread started... 2022-01-19 09:30:33.277 Status: EventSystem: reset all events... 2022-01-19 09:30:33.278 Status: EventSystem: reset all device statuses... 2022-01-19 09:30:33.338 Status: Python EventSystem: Initalizing event module. 2022-01-19 09:30:33.338 Status: EventSystem: Started 2022-01-19 09:30:33.338 Status: EventSystem: Queue thread started... 2022-01-19 09:30:33.523 Status: Zigbee2MQTT: (Zigbee2MQTT) Initialized version 3.0.0 2022-01-19 09:30:33.729 Status: PluginSystem: 1 plugins started.

Koenkk commented 2 years ago

If buttons are missing from Domitcz this is an issue related to the domitcz plugin (I see you already opened an issue for that: https://github.com/stas-demydiuk/domoticz-zigbee2mqtt-plugin/issues/770). You should be able to allow joining via the z2m frontend: https://www.zigbee2mqtt.io/guide/configuration/frontend.html

McGyver64 commented 2 years ago

I did a fresh install of RPI OS buster (incl update/upgrade) I follow the default Domoticz install, mosquitto install (gives me 1.5.7 although 2.x.x is latest) and Zigbee2Mqtt install (sudo apt-get install -y nodejs npm git make g++ gcc) and gives me node 10.24.0 and npm 5.8.0 , while it should be 12.x and 6.x with the default install

If I do everything according the specific procedure, why does the plugin fail every time? If in install the default plugin, it installs beta 3.1.0 but only works with Domoticz beta. this shows me the "allow new zigbee devices to join" but does not show the extra menu where you see the actual device being paired end after pairing , available ad device.

I am at my 5th install today and wil try to add the extra frontend info in configuration.yaml and see what it brings

Koenkk commented 2 years ago

I don't know, I don't maintain the Domitcz plugin

McGyver64 commented 2 years ago

I got it all working again, but don't know what the final solution was, or what the final problem was why it was a not working the previous days.

https://github.com/stas-demydiuk/domoticz-zigbee2mqtt-plugin/issues/770