zigbee2mqtt icon indicating copy to clipboard operation
zigbee2mqtt copied to clipboard

Last HA upgrade(0.77.3) broke Zigbee2Mqtt

Open marcgarciamarti opened this issue 8 years ago • 14 comments

Edit: by ciotlosm

Update: This was fixed by:
- unplug the stick
- plug the stick back in
- press reset button on stick (button closest to the usb)
- reboot hassio

Hello,

I just upgraded to the latest version of HA (0.77.3) and zigbee2mqtt has stopped working. I've tried to reboot hassio (hassos) and the add-on several times already, swapped the tty devices, etc., to no avail. This is what I see in the logfile:

core-ssh:/share/zigbee2mqtt/log/2018-09-11.16:15:51# cat log.txt 
2018-9-11 16:15:51 - info: Logging to directory: '/share/zigbee2mqtt/log/2018-09-11.16:15:51'
2018-9-11 16:15:53 - info: Starting zigbee2mqtt version 0.1.3 (commit #unknown)
2018-9-11 16:15:53 - info: Starting zigbee-shepherd
2018-9-11 16:16:02 - info: Error while starting zigbee-shepherd, attemping to fix... (takes 60 seconds)
2018-9-11 16:17:02 - info: Starting zigbee-shepherd
2018-9-11 16:17:11 - error: Error while starting zigbee-shepherd!
2018-9-11 16:17:11 - error: Press the reset button on the stick (the one closest to the USB) and start again
2018-9-11 16:17:11 - error: Failed to start Error: request timeout
    at CcZnp.<anonymous> (/zigbee2mqtt-0.1.3/node_modules/cc-znp/lib/ccznp.js:255:22)
    at Object.onceWrapper (events.js:315:30)
    at emitOne (events.js:116:13)
    at CcZnp.emit (events.js:211:7)
    at Timeout.<anonymous> (/zigbee2mqtt-0.1.3/node_modules/cc-znp/lib/ccznp.js:234:18)
    at ontimeout (timers.js:498:11)
    at tryOnTimeout (timers.js:323:5)
    at Timer.listOnTimeout (timers.js:290:5)

Could you please advise what to do?

marcgarciamarti avatar Sep 11 '18 14:09 marcgarciamarti

zigbee2mqtt works with 0.77.3 well Try reboot the system where USB stick physically located or replug USB. But better not do "Press the reset button on the stick (the one closest to the USB)" - befor check my #359

MikeVRT avatar Sep 11 '18 17:09 MikeVRT

@MikeVRT , thanks for your response. I've already tried to reboot the system, unplug and plug back the usb dongle... nothing.

I've noticed the add-on takes much longer when I now click on Stop or Restart. There is definitely something fishy to it...

marcgarciamarti avatar Sep 11 '18 17:09 marcgarciamarti

Guys, I really don't understand a thing. I feel dumb. For the thousand time today I fumbled with the RPI and now it seems to work. It is very strange and I can't pinpoint what I did that solved the issue other than swapping the USB port of the USB dongle (again).

marcgarciamarti avatar Sep 11 '18 18:09 marcgarciamarti

Hello, it is happening again and with the level of detail provided by the logfile I can't really put my finger on the problem. I had a working configuration but one of my ikea bulbs was irresponsive and I decided to reboot the add-on and now it won't come up:

[Info] Configuration file found. Will overwrite configurable               fields with values from add-on configuration
[Info] Configuration written to /share/zigbee2mqtt/configuration.yaml
[2018-09-16T10:57:04.777Z] PM2 log: Launching in no daemon mode
[2018-09-16T10:57:05.722Z] PM2 log: Starting execution sequence in -fork mode- for app name:npm id:0
[2018-09-16T10:57:05.806Z] PM2 log: App name:npm id:0 online
> [email protected] start /zigbee2mqtt-0.1.3
> node index.js
  zigbee2mqtt:info 2018-9-16 10:57:14 Logging to directory: '/share/zigbee2mqtt/log/2018-09-16.10:57:13'
  zigbee2mqtt:info 2018-9-16 10:57:16 Starting zigbee2mqtt version 0.1.3 (commit #unknown)
  zigbee2mqtt:info 2018-9-16 10:57:16 Starting zigbee-shepherd
  zigbee2mqtt:info 2018-9-16 10:57:24 Error while starting zigbee-shepherd, attemping to fix... (takes 60 seconds)
  zigbee2mqtt:info 2018-9-16 10:58:24 Starting zigbee-shepherd
  zigbee2mqtt:error 2018-9-16 10:58:33 Error while starting zigbee-shepherd!
  zigbee2mqtt:error 2018-9-16 10:58:33 Press the reset button on the stick (the one closest to the USB) and start again
  zigbee2mqtt:error 2018-9-16 10:58:33 Failed to start
	{"message":"request timeout","stack":"Error: request timeout\n    at CcZnp.<anonymous> (/zigbee2mqtt-0.1.3/node_modules/cc-znp/lib/ccznp.js:255:22)\n    at Object.onceWrapper (events.js:315:30)\n    at emitOne (events.js:116:13)\n    at CcZnp.emit (events.js:211:7)\n    at Timeout.<anonymous> (/zigbee2mqtt-0.1.3/node_modules/cc-znp/lib/ccznp.js:234:18)\n    at ontimeout (timers.js:498:11)\n    at tryOnTimeout (timers.js:323:5)\n    at Timer.listOnTimeout (timers.js:290:5)"}

@Koenkk I believe there must be something worth analysing because I really have not changed a single line of code.

marcgarciamarti avatar Sep 16 '18 09:09 marcgarciamarti

Hi again,

after rebooting the add-on several times, rebooting hassio, shuffling my zwave usb stick and the 2531 usb stick around, zigbee2mqtt is back up. I have not changed a single line of code. There must be something weird and my gut is pointing me to the USB stick. How can I check it for consistency? Here the output that I see

[Info] Configuration file found. Will overwrite configurable               fields with values from add-on configuration
[Info] Configuration written to /share/zigbee2mqtt/configuration.yaml
[2018-09-16T11:31:40.640Z] PM2 log: Launching in no daemon mode
[2018-09-16T11:31:41.537Z] PM2 log: Starting execution sequence in -fork mode- for app name:npm id:0
[2018-09-16T11:31:41.621Z] PM2 log: App name:npm id:0 online
> [email protected] start /zigbee2mqtt-0.1.3
> node index.js
  zigbee2mqtt:info 2018-9-16 11:31:49 Logging to directory: '/share/zigbee2mqtt/log/2018-09-16.11:31:49'
  zigbee2mqtt:info 2018-9-16 11:31:51 Starting zigbee2mqtt version 0.1.3 (commit #unknown)
  zigbee2mqtt:info 2018-9-16 11:31:51 Starting zigbee-shepherd
  zigbee2mqtt:info 2018-9-16 11:31:55 Error while starting zigbee-shepherd, attemping to fix... (takes 60 seconds)
  zigbee2mqtt:info 2018-9-16 11:32:55 Starting zigbee-shepherd
  zigbee2mqtt:info 2018-9-16 11:33:01 zigbee-shepherd started
  zigbee2mqtt:info 2018-9-16 11:33:01 Coordinator firmware version: 'undefined'
  zigbee2mqtt:info 2018-9-16 11:33:01 Currently 5 devices are joined:
  zigbee2mqtt:info 2018-9-16 11:33:01 switchw1xiaomi (0x00158d000252b7a5): WXKG01LM - Xiaomi MiJia wireless switch (EndDevice)
  zigbee2mqtt:info 2018-9-16 11:33:01 occupancys1xiaomi (0x00158d000251f830): RTCGQ01LM - Xiaomi MiJia human body movement sensor (EndDevice)
  zigbee2mqtt:info 2018-9-16 11:33:01 doors1xiaomi (0x00158d00026765c4): MCCGQ01LM - Xiaomi MiJia door & window contact sensor (EndDevice)
  zigbee2mqtt:info 2018-9-16 11:33:01 plug1xiaomi (0x00158d00022f35ca): ZNCZ02LM - Xiaomi Mi power plug ZigBee (Router)
  zigbee2mqtt:info 2018-9-16 11:33:01 light11000lmikea (0x000b57fffeda5dae): LED1623G12 - IKEA TRADFRI LED bulb E27 1000 lumen, dimmable, opal white (Router)
  zigbee2mqtt:info 2018-9-16 11:33:01 Connecting to MQTT server at mqtt://core-mosquitto:1883
  zigbee2mqtt:info 2018-9-16 11:33:02 zigbee-shepherd ready
  zigbee2mqtt:info 2018-9-16 11:33:02 Connected to MQTT server
  zigbee2mqtt:info 2018-9-16 11:33:02 MQTT publish, topic: 'zigbee2mqtt/bridge/state', payload: 'online'
  zigbee2mqtt:info 2018-9-16 11:33:02 MQTT publish, topic: 'homeassistant/sensor/0x00158d000252b7a5/click/config', payload: '{"icon":"mdi:toggle-switch","value_template":"{{ value_json.click }}","json_attributes":["battery","voltage","action","duration"],"state_topic":"zigbee2mqtt/switchw1xiaomi","availability_topic":"zigbee2mqtt/bridge/state","name":"switchw1xiaomi"}'
  zigbee2mqtt:info 2018-9-16 11:33:02 MQTT publish, topic: 'homeassistant/binary_sensor/0x00158d000251f830/occupancy/config', payload: '{"payload_on":true,"payload_off":false,"value_template":"{{ value_json.occupancy }}","device_class":"motion","json_attributes":["battery","voltage"],"state_topic":"zigbee2mqtt/occupancys1xiaomi","availability_topic":"zigbee2mqtt/bridge/state","name":"occupancys1xiaomi"}'
  zigbee2mqtt:info 2018-9-16 11:33:02 MQTT publish, topic: 'homeassistant/binary_sensor/0x00158d00026765c4/contact/config', payload: '{"payload_on":false,"payload_off":true,"value_template":"{{ value_json.contact }}","device_class":"door","json_attributes":["battery","voltage"],"state_topic":"zigbee2mqtt/doors1xiaomi","availability_topic":"zigbee2mqtt/bridge/state","name":"doors1xiaomi"}'
  zigbee2mqtt:info 2018-9-16 11:33:02 MQTT publish, topic: 'homeassistant/switch/0x00158d00022f35ca/switch/config', payload: '{"payload_off":"OFF","payload_on":"ON","value_template":"{{ value_json.state }}","command_topic":"zigbee2mqtt/plug1xiaomi/set","state_topic":"zigbee2mqtt/plug1xiaomi","availability_topic":"zigbee2mqtt/bridge/state","name":"plug1xiaomi_switch"}'
  zigbee2mqtt:info 2018-9-16 11:33:02 MQTT publish, topic: 'homeassistant/sensor/0x00158d00022f35ca/power/config', payload: '{"unit_of_measurement":"Watt","icon":"mdi:flash","value_template":"{{ value_json.power }}","json_attributes":["voltage","temperature","consumption","current","power_factor"],"state_topic":"zigbee2mqtt/plug1xiaomi","availability_topic":"zigbee2mqtt/bridge/state","name":"plug1xiaomi_power"}'
  zigbee2mqtt:info 2018-9-16 11:33:02 MQTT publish, topic: 'homeassistant/light/0x000b57fffeda5dae/light/config', payload: '{"brightness":true,"platform":"mqtt_json","command_topic":"zigbee2mqtt/light11000lmikea/set","state_topic":"zigbee2mqtt/light11000lmikea","availability_topic":"zigbee2mqtt/bridge/state","name":"light11000lmikea"}'
  zigbee2mqtt:info 2018-9-16 11:33:02 MQTT publish, topic: 'zigbee2mqtt/switchw1xiaomi', payload: '{"battery":"100.00","voltage":3032,"linkquality":184}'
  zigbee2mqtt:info 2018-9-16 11:33:02 MQTT publish, topic: 'zigbee2mqtt/occupancys1xiaomi', payload: '{"occupancy":false,"linkquality":126,"battery":"100.00","voltage":3045}'
  zigbee2mqtt:info 2018-9-16 11:33:02 MQTT publish, topic: 'zigbee2mqtt/doors1xiaomi', payload: '{"contact":true,"linkquality":118,"battery":"100.00","voltage":3085}'
  zigbee2mqtt:info 2018-9-16 11:33:02 MQTT publish, topic: 'zigbee2mqtt/plug1xiaomi', payload: '{"state":"OFF","power":0,"voltage":231,"consumption":0.21,"temperature":25,"linkquality":126}'
  zigbee2mqtt:info 2018-9-16 11:33:02 MQTT publish, topic: 'zigbee2mqtt/light11000lmikea', payload: '{"state":"OFF","brightness":7}'
  zigbee2mqtt:info 2018-9-16 11:33:02 Zigbee publish to '0x00158d00022f35ca', genOnOff - off - {} - null
  zigbee2mqtt:info 2018-9-16 11:33:03 MQTT publish, topic: 'zigbee2mqtt/plug1xiaomi', payload: '{"state":"OFF","power":0,"voltage":231,"consumption":0.21,"temperature":25,"linkquality":126}'
  zigbee2mqtt:info 2018-9-16 11:33:03 MQTT publish, topic: 'zigbee2mqtt/plug1xiaomi', payload: '{"state":"OFF","power":0,"voltage":231,"consumption":0.21,"temperature":25,"linkquality":107}'
  zigbee2mqtt:info 2018-9-16 11:33:09 MQTT publish, topic: 'zigbee2mqtt/plug1xiaomi', payload: '{"state":"OFF","power":0,"voltage":231,"consumption":0.21,"temperature":34,"linkquality":105}' 

it looks like it magically healed itself right???? I'm pretty lost :(

marcgarciamarti avatar Sep 16 '18 09:09 marcgarciamarti

This error happens due to the cc2531 not being in the correct state, which can be fixed by unplugging and pressing the reset button (button closest to the usb).

Koenkk avatar Sep 16 '18 19:09 Koenkk

@Koenkk thanks for your answer. Now that you mention that, it sort of clicks in my head... I would say that the two times when I felt the system was acting up on me, I tried countless combinations but it could very well be that it got fixed when I unplugged the device and plugged it back in. May I ask: you say we should press the button when the device is already unplugged??

marcgarciamarti avatar Sep 16 '18 20:09 marcgarciamarti

@Koenkk one other thing: is it normal that the log file states

  Starting zigbee2mqtt version 0.1.3 (commit #unknown)
  zigbee2mqtt:info 2018-9-16 11:33:01 Coordinator firmware version: 'undefined'

does it look ok? the unknown and undefined made me a bit suspicious too

marcgarciamarti avatar Sep 16 '18 20:09 marcgarciamarti

it's normal due to old firmware, see: #178

AnhDuc85 avatar Sep 17 '18 07:09 AnhDuc85

@AnhDuc85 for firmware yes but the commit should be known for 0.1.3.

@marcgarciamarti you might like to copy your config for the add on and then remove and readd it

Sent with GitHawk

ryanbeaton avatar Sep 17 '18 10:09 ryanbeaton

unplugging and pressing the reset button

Are you sure? :)

MikeVRT avatar Sep 17 '18 16:09 MikeVRT

@MikeVRT that was my question too... the order sounds odd :)

marcgarciamarti avatar Sep 17 '18 16:09 marcgarciamarti

@marcgarciamarti @MikeVRT The text it out of context. It was not supposed to be a sequence, but just a pool of actions that must be done.

Do you need any more support on this? Maybe one of you can suggest edits to the troubleshooting section and then close the issue down?

ciotlosm avatar Sep 27 '18 13:09 ciotlosm

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.

stale[bot] avatar Nov 26 '18 13:11 stale[bot]