danielwelch / hassio-zigbee2mqtt

Hass.io add-on for zigbee2mqtt
Apache License 2.0
566 stars 189 forks source link

Error starting up the add-on after recent 1.5.1 update #183

Closed saicrazyfire closed 5 years ago

saicrazyfire commented 5 years ago

zigbee2mqtt add-on version (if edge, please report commit hash): 1.5.1

Operating environment (HassOS, Virtual Machine, Device/platform running Hass.io):

Running HassIO v0.95.4 on a Ubuntu 18.04.2 LTS VM.

Description of problem:

Error starting up the addon with error TypeError: net.precfgkey should be an array with 16 uint8 integers. This configuration used to work before the update to 1.5.1. The json data below was also tweaked to support the new format (with nested objects instead of one flat json).

Note - I have not added devices yet (since I've recreated my VM recently and haven't gotten around to doing so).

Your entire configuration from the frontend (with sensitive fields redacted):

{
  "data_path": "/share/zigbee2mqtt",
  "devices": "[]",
  "groups": "groups.yaml",
  "homeassistant": true,
  "permit_join": false,
  "mqtt": {
    "base_topic": "zigbee2mqtt",
    "server": "mqtt://127.0.0.1:1883",
    "user": "~REDACTED~",
    "password": "~REDACTED~"
  },
  "serial": {
    "port": "/dev/ttyACM0"
  },
  "advanced": {
    "pan_id": "~REDACTED MAYBE?~",
    "channel": 11,
    "network_key": []
  }
}

Your logs from Hass.io

./run.sh: line 13: [Info] Configuration backup found in /share/zigbee2mqtt/.configuration.yaml.bk. Skipping config backup.: No such file or directory
2019-07-20T18:35:43: PM2 log: Launching in no daemon mode
2019-07-20T18:35:43: PM2 log: App [npm:0] starting in -fork mode-
2019-07-20T18:35:43: PM2 log: App [npm:0] online
> zigbee2mqtt@1.5.1 start /zigbee2mqtt-1.5.1
> node index.js
  zigbee2mqtt:info 7/20/2019, 6:35:44 PM Logging to directory: '/share/zigbee2mqtt/log/2019-07-20.18-35-44'
  zigbee2mqtt:info 7/20/2019, 6:35:45 PM Starting zigbee2mqtt version 1.5.1 (commit #unknown)
  zigbee2mqtt:info 7/20/2019, 6:35:45 PM Starting zigbee-shepherd
/zigbee2mqtt-1.5.1/node_modules/zigbee-herdsman/dist/lib/components/controller.js:429
                    throw new TypeError('net.precfgkey should be an array with 16 uint8 integers.');
                    ^
TypeError: net.precfgkey should be an array with 16 uint8 integers.
    at /zigbee2mqtt-1.5.1/node_modules/zigbee-herdsman/dist/lib/components/controller.js:429:27
    at Object._.forOwn (/zigbee2mqtt-1.5.1/node_modules/zigbee-herdsman/node_modules/busyman/index.js:242:27)
    at Object._.forEach (/zigbee2mqtt-1.5.1/node_modules/zigbee-herdsman/node_modules/busyman/index.js:415:18)
    at Controller.setNvParams (/zigbee2mqtt-1.5.1/node_modules/zigbee-herdsman/dist/lib/components/controller.js:414:7)
    at new ZShepherd (/zigbee2mqtt-1.5.1/node_modules/zigbee-herdsman/dist/lib/shepherd.js:28:21)
    at Zigbee.start (/zigbee2mqtt-1.5.1/lib/zigbee.js:57:25)
    at startupLogVersion (/zigbee2mqtt-1.5.1/lib/controller.js:167:25)
    at utils.getZigbee2mqttVersion (/zigbee2mqtt-1.5.1/lib/controller.js:193:13)
    at git.getLastCommit (/zigbee2mqtt-1.5.1/lib/util/utils.js:102:9)
    at /zigbee2mqtt-1.5.1/node_modules/git-last-commit/source/index.js:44:5
npm
 ERR! code ELIFECYCLE
npm ERR! errno
 1
npm
 ERR! zigbee2mqtt@1.5.1 start: `node index.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the zigbee2mqtt@1.5.1 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-07-20T22_35_45_028Z-debug.log
2019-07-20T18:35:49: PM2 log: App [npm:0] exited with code [1] via signal [SIGINT]
2019-07-20T18:35:49: PM2 log: App [npm:0] starting in -fork mode-
2019-07-20T18:35:49: PM2 log: App [npm:0] online
> zigbee2mqtt@1.5.1 start /zigbee2mqtt-1.5.1
> node index.js
  zigbee2mqtt:info 7/20/2019, 6:35:50 PM Logging to directory: '/share/zigbee2mqtt/log/2019-07-20.18-35-49'
  zigbee2mqtt:info 7/20/2019, 6:35:50 PM Starting zigbee2mqtt version 1.5.1 (commit #unknown)
  zigbee2mqtt:info 7/20/2019, 6:35:50 PM Starting zigbee-shepherd
/zigbee2mqtt-1.5.1/node_modules/zigbee-herdsman/dist/lib/components/controller.js:429
                    throw new TypeError('net.precfgkey should be an array with 16 uint8 integers.');
                    ^
TypeError: net.precfgkey should be an array with 16 uint8 integers.
    at /zigbee2mqtt-1.5.1/node_modules/zigbee-herdsman/dist/lib/components/controller.js:429:27
    at Object._.forOwn (/zigbee2mqtt-1.5.1/node_modules/zigbee-herdsman/node_modules/busyman/index.js:242:27)
    at Object._.forEach (/zigbee2mqtt-1.5.1/node_modules/zigbee-herdsman/node_modules/busyman/index.js:415:18)
    at Controller.setNvParams (/zigbee2mqtt-1.5.1/node_modules/zigbee-herdsman/dist/lib/components/controller.js:414:7)
    at new ZShepherd (/zigbee2mqtt-1.5.1/node_modules/zigbee-herdsman/dist/lib/shepherd.js:28:21)
    at Zigbee.start (/zigbee2mqtt-1.5.1/lib/zigbee.js:57:25)
    at startupLogVersion (/zigbee2mqtt-1.5.1/lib/controller.js:167:25)
    at utils.getZigbee2mqttVersion (/zigbee2mqtt-1.5.1/lib/controller.js:193:13)
    at git.getLastCommit (/zigbee2mqtt-1.5.1/lib/util/utils.js:102:9)
    at /zigbee2mqtt-1.5.1/node_modules/git-last-commit/source/index.js:44:5
npm
 ERR! code ELIFECYCLE
npm ERR! 
errno 1
npm 
ERR! zigbee2mqtt@1.5.1 start: `node index.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the zigbee2mqtt@1.5.1 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

It's difficult to get the logs from /share/zigbee2mqtt/log/2019-07-20.18-35-44 since they keep getting deleted while the add-on is enabled, and file is empty when the add-on is disabled.

imathijs commented 5 years ago

I upgraded to 1.5.1.1 yesterday. I can run the addon. Except that all of my Xiaomi sensors are not giving me new record updates. Also I attempt to re-pair some devices but no feedback in the logs that this is working or that the device is trying to connect. Before I had no network_key configured in my config file, so I use the default key. Also tried all of the above given options, but for now no luck.

imathijs commented 5 years ago

Got it working after I reflashed CC2531 USB stick with CC2531_DEFAULT_20190608. I was running 20190223. Re-pairing was pretty simple after that. Only caused me 2 days to solve this problem.

Rafik89 commented 5 years ago

Hello, I have a similar problem, earlier it worked without problems, now I don't want to start properly:

My specifications are RPi3+, Home Assistant 0.96.5, System HassOS 2.12, zigbee2mqtt-armhf with version 1.5.1.1.


{
  "data_path": "/share/zigbee2mqtt",
  "devices": "devices.yaml",
  "groups": "groups.yaml",
  "homeassistant": true,
  "permit_join": false,
  "mqtt": {
    "base_topic": "zigbee2mqtt",
    "server": "mqtt://127.0.0.1",
    "user": "mqqt",
    "password": "PASS"
  },
  "serial": {
    "port": "/dev/serial/by-id/usb-Texas_Instruments_TI_CC2531_USB_CDC___0X00124B001936DD4F-if00"
  },
  "advanced": {
    "pan_id": 6724,
    "channel": 11,
    "network_key": [
      176,
      148,
      195,
      196,
      118,
      210,
      210,
      127,
      21,
      37,
      61,
      100,
      106,
      29,
      200,
      153
    ],
    "availability_blacklist": []
  },
  "ban": [],
  "whitelist": [],
  "queue": {}
}
[Info] Configuration backup found in /share/zigbee2mqtt/.configuration.yaml.bk. Skipping config backup.: No such file or directory
2019-08-04T01:33:33: PM2 log: Launching in no daemon mode
2019-08-04T01:33:33: PM2 log: App [npm:0] starting in -fork mode-
2019-08-04T01:33:33: PM2 log: App [npm:0] online
> zigbee2mqtt@1.5.1 start /zigbee2mqtt-1.5.1
> node index.js
  zigbee2mqtt:info 8/4/2019, 1:33:38 AM Logging to directory: '/share/zigbee2mqtt/log/2019-08-04.01-33-36'
  zigbee2mqtt:info 8/4/2019, 1:33:38 AM Starting zigbee2mqtt version 1.5.1 (commit #unknown)
  zigbee2mqtt:info 8/4/2019, 1:33:38 AM Starting zigbee-shepherd
  zigbee2mqtt:info 8/4/2019, 1:33:50 AM Error while starting zigbee-shepherd, attempting to fix... (takes 60 seconds) (Error: request timeout)
  zigbee2mqtt:info 8/4/2019, 1:34:50 AM Starting zigbee-shepherd
  zigbee2mqtt:error 8/4/2019, 1:35:02 AM Error while starting zigbee-shepherd! (Error: request timeout)
  zigbee2mqtt:error 8/4/2019, 1:35:02 AM Press the reset button on the stick (the one closest to the USB) and start again
  zigbee2mqtt:error 8/4/2019, 1:35:02 AM Failed to start
    {"message":"request timeout","stack":"Error: request timeout\n    at CcZnp.<anonymous> (/zigbee2mqtt-1.5.1/node_modules/zigbee-herdsman/dist/cc-znp/index.js:208:22)\n    at Object.onceWrapper (events.js:286:20)\n    at CcZnp.emit (events.js:198:13)\n    at Timeout.<anonymous> (/zigbee2mqtt-1.5.1/node_modules/zigbee-herdsman/dist/cc-znp/index.js:192:18)\n    at ontimeout (timers.js:436:11)\n    at tryOnTimeout (timers.js:300:5)\n    at listOnTimeout (timers.js:263:5)\n    at Timer.processTimers (timers.js:223:10)"}
  zigbee2mqtt:error 8/4/2019, 1:35:02 AM Exiting...
npm

ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! zigbee2mqtt@1.5.1 start: `node index.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the zigbee2mqtt@1.5.1 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-08-03T23_35_37_938Z-debug.log
2019-08-04T01:35:39: PM2 log: App [npm:0] exited with code [1] via signal [SIGINT]
2019-08-04T01:35:39: PM2 log: App [npm:0] starting in -fork mode-
2019-08-04T01:35:39: PM2 log: App [npm:0] online
> zigbee2mqtt@1.5.1 start /zigbee2mqtt-1.5.1
> node index.js
ls -l /dev/serial/by-id
lrwxrwxrwx    1 root     root            13 Aug  3 23:20 usb-Texas_Instruments_TI_CC2531_USB_CDC___0X00124B001936DD4F-if00 -> ../../ttyACM0

test -w /dev/serial/by-id/usb-Texas_Instruments_TI_CC2531_USB_CDC___0X00124B001936DD4F-if00 && ech
o success || echo failure
success
# test -w /dev/ttyACM0 && echo success || echo failure
success

I also pressed the reset button on the USB stick, the green LED lights up for about a minute and then goes out.

Rafik89 commented 5 years ago

https://github.com/Koenkk/zigbee2mqtt/issues/1795#issuecomment-517994305

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.