zigbee2mqtt icon indicating copy to clipboard operation
zigbee2mqtt copied to clipboard

Crash after re-plugging CC2531

Open Bruceforce opened this issue 7 years ago • 44 comments

Hi,

I'm using zigbee2mqtt in a docker container with latest-dev tag from today. If I re-plug my CC2531 stick with coordinator firmware 20190109 and then restart the zigbee2mqtt container, the app crashes. If I wait the 60 seconds and restart the container again it's working, but I think it should try to self repair in a loop instead of crashing.

zigbee2mqtt logs: https://pastebin.com/Mc29fRuY /root/.npm/_logs/2019-01-30T14_51_11_830Z-debug.log: https://pastebin.com/kKpyubkZ

Bruceforce avatar Jan 30 '19 14:01 Bruceforce

After replugging, before starting zigbee2mqtt, please press the reset button (the one close to the usb port). The green light should go off and you can now start zigbee2mqtt.

Koenkk avatar Jan 30 '19 18:01 Koenkk

Is this behavior expected? If yes, then the message Error while starting zigbee-shepherd, attemping to fix... (takes 60 seconds) is a bit confusing / misleading.

Is there a place where this can be documented or is it already documented and I just haven't seen it?

Bruceforce avatar Jan 30 '19 19:01 Bruceforce

@Koenkk I've fixed this bug in my last pull request to zigbee-shepherd

ptvoinfo avatar Jan 31 '19 10:01 ptvoinfo

@ptvoinfo thanks, should be solved in the latest dev branch.

Koenkk avatar Jan 31 '19 19:01 Koenkk

@Koenkk Could you indicate how to switch from master to dev branch? I think I have the exact same issue (error at npm start). Switching to dev does not require any re-pairing process, right? And finally, how to switch back to master eventually?

sylvarg avatar Jan 31 '19 20:01 sylvarg

This doesn't require repairing devices.

git fetch
git checkout dev

should do it.

Koenkk avatar Jan 31 '19 20:01 Koenkk

After replugging, before starting zigbee2mqtt, please press the reset button (the one close to the usb port). The green light should go off and you can now start zigbee2mqtt.

I have the same problem, pressing the button doesn't turn off the green light however

sultanakaneel avatar Feb 02 '19 23:02 sultanakaneel

@sultanakaneel did you also replug it?

Koenkk avatar Feb 03 '19 13:02 Koenkk

@sultanakaneel did you also replug it?

Yep. I stopped zigbee2mqtt, pulled the usb, put it back in, pressed button closest to usb (green light didn't change) and started zigbee2mqtt

sultanakaneel avatar Feb 03 '19 15:02 sultanakaneel

@sultanakaneel strange, anyway, can you check if this has been fixed in zigbee2mqtt? Hassio 1.1.1 update is on it's way (should be available within an hour).

Koenkk avatar Feb 03 '19 15:02 Koenkk

@Koenkk still experiencing the same problem, sort of. It now gets stuck on the following:

[Info] Configuration file found: /share/zigbee2mqtt/configuration.yaml [Info] Configuration written to /share/zigbee2mqtt/configuration.yaml 2019-02-03T17:43:48: PM2 log: Launching in no daemon mode 2019-02-03T17:43:48: PM2 log: App [npm:0] starting in -fork mode- 2019-02-03T17:43:48: PM2 log: App [npm:0] online

[email protected] start /zigbee2mqtt-1.1.1 node index.js zigbee2mqtt:info 2019-2-3 17:43:51 Logging to directory: '/share/zigbee2mqtt/log/2019-02-03.17-43-51' zigbee2mqtt:info 2019-2-3 17:43:52 Starting zigbee2mqtt version 1.1.1 (commit #unknown) zigbee2mqtt:info 2019-2-3 17:43:52 Starting zigbee-shepherd zigbee2mqtt:info 2019-2-3 17:43:56 Error while starting zigbee-shepherd, attemping to fix... (takes 60 seconds)

It never moves past this bit. And the longer I let it run the slower my pi becomes, which I can only solve by pulling the power

sultanakaneel avatar Feb 03 '19 16:02 sultanakaneel

@sultanakaneel is it fixed by reflashing the stick?

Koenkk avatar Feb 03 '19 17:02 Koenkk

@Koenkk I'm afraid I don't have the hardware to flash it, bought it preflashed

sultanakaneel avatar Feb 03 '19 17:02 sultanakaneel

@sultanakaneel do you know what firmware was flashed on it? Maybe that's the reason of: https://github.com/Koenkk/zigbee2mqtt/issues/971#issuecomment-460009215 ?

Koenkk avatar Feb 03 '19 17:02 Koenkk

@Koenkk I'm pretty sure it was flashed 2-3 days ago, so I assume it is the latest version. Is there any way I can check?

sultanakaneel avatar Feb 03 '19 17:02 sultanakaneel

@sultanakaneel not if you cant get zigbee2mqtt to start (it's logged on startup). Could you perhaps try if it works on a different computer?

Koenkk avatar Feb 03 '19 18:02 Koenkk

@Koenkk I have the same problem as @sultanakaneel. I just upgraded to 1.1.1 and I have the latest firmware flashed on my 2531. I tried flashing the newest firmware again on a new unused 2531 and I am still getting the same problem.

roygbiv856 avatar Feb 03 '19 18:02 roygbiv856

@roygbiv856 can you post the complete log? Does it also hang in your case?

Koenkk avatar Feb 03 '19 18:02 Koenkk

@Koenkk Yes, sir. It just hangs. When I first updated to 1.1.1 today, it would tell me to press the reset button on the 2531 then hang. Now, it just says error while starting shepherd and hangs. I am not sure if this is completely related, but ever since I updated to 1.1.1, my entire hassio freezes up and I need to unplug and plug my pi. This has already happened twice today and it has never happened before in the 3 months I've used hassio.

https://pastebin.com/wQduw7aV

roygbiv856 avatar Feb 03 '19 18:02 roygbiv856

Can you post the debug log (zigbee_shepherd_debug options https://github.com/danielwelch/hassio-zigbee2mqtt)

Koenkk avatar Feb 03 '19 19:02 Koenkk