Koenkk / zigbee2mqtt

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

CC2652RB Error Network Commissioning Timeout (panID or extendedPanID already exists nearby) #10858

Closed rubenkr closed 2 years ago

rubenkr commented 2 years ago

What happened?

Hey! First of all let me say this project is awesome. Started with eszp chip now wanted to try it with better supported chip of slae.sh CC2652RB. Flashed it according to slaeh.sh flashing documentation. Carefully read the issues here on github here and here. I tried it on Windows with TI SmartFlash Program Ti2 and on Linux with cc2538 pyton script. I flashed the latest ZSTACK Firmware from here CC2652RB_coordinator_20211217.zip

Here are my outputs: ┌Logs [zigbee2mqtt]───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ Using '/app/data' as data directory │ │ [32mZigbee2MQTT:info [39m 2022-01-17 15:13:21: Logging to console and directory: '/app/data/log/2022-01-17.15-13-20' filename: log.txt │ │ [32mZigbee2MQTT:info [39m 2022-01-17 15:13:21: Starting Zigbee2MQTT version 1.22.2-dev (commit #8e53d74) │ │ [32mZigbee2MQTT:info [39m 2022-01-17 15:13:21: Starting zigbee-herdsman (0.14.1) │ │ [31mZigbee2MQTT:error[39m 2022-01-17 15:14:35: Error while starting zigbee-herdsman │ │ [31mZigbee2MQTT:error[39m 2022-01-17 15:14:35: Failed to start zigbee │ │ [31mZigbee2MQTT:error[39m 2022-01-17 15:14:35: Check https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start.html for possible solutions │ │ [31mZigbee2MQTT:error[39m 2022-01-17 15:14:35: Exiting... │ │ [31mZigbee2MQTT:error[39m 2022-01-17 15:14:36: Error: network commissioning timed out - most likely network with the same panId or extendedPanId already exists nearby │ │ at ZnpAdapterManager.beginCommissioning (/app/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/manager.ts:347:23) │ │ at ZnpAdapterManager.start (/app/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/manager.ts:92:17) │ │ at Controller.start (/app/node_modules/zigbee-herdsman/src/controller/controller.ts:123:29) │ │ at Zigbee.start (/app/lib/zigbee.ts:58:27) │ │ at Controller.start (/app/lib/controller.ts:100:27) │ │ at start (/app/index.js:101:5)

Docker Command with SUDO gets error - without SUDO is waiting forever without error/starting ➜ ~ sudo docker run -d \ --name zigbee2mqtt \ --device=/dev/ttyUSB0 \ --restart always \ -v /var/lib/docker/volumes/zigbee2mqtt:/app/data \ -v /run/udev:/run/udev:ro \ -e TZ=Europe/Berlin \ --user 1000:1000 \ --network host \ koenkk/zigbee2mqtt:latest-dev lsusb [519831.462557] cp210x 2-2:1.0: cp210x converter detected [519831.465460] usb 2-2: cp210x converter now attached to ttyUSB0

configuration.yaml homeassistant: false permit_join: true mqtt: base_topic: zigbee2mqtt server: mqtt://10.0.0.52 serial: port: /dev/ttyUSB0 frontend: port: 8080 host: 0.0.0.0:w

THANK YOU SO MUCH !!!

What did you expect to happen?

No response

How to reproduce it (minimal and precise)

No response

Zigbee2MQTT version

1.22.2-dev

Adapter firmware version

CC2652RB_coordinator_20211217.zip

Adapter

Slaeshs CC2652RB

Debug log

│ Using '/app/data' as data directory │ │ [32mZigbee2MQTT:info [39m 2022-01-17 15:23:16: Logging to console and directory: '/app/data/log/2022-01-17.15-23-15' filename: log.txt │ │ [32mZigbee2MQTT:info [39m 2022-01-17 15:23:16: Starting Zigbee2MQTT version 1.22.2-dev (commit #8e53d74) │ │ [32mZigbee2MQTT:info [39m 2022-01-17 15:23:16: Starting zigbee-herdsman (0.14.1) │ │ [31mZigbee2MQTT:error[39m 2022-01-17 15:24:29: Error while starting zigbee-herdsman │ │ [31mZigbee2MQTT:error[39m 2022-01-17 15:24:29: Failed to start zigbee │ │ [31mZigbee2MQTT:error[39m 2022-01-17 15:24:29: Check https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start.html for possible solutions │ │ [31mZigbee2MQTT:error[39m 2022-01-17 15:24:29: Exiting... │ │ [31mZigbee2MQTT:error[39m 2022-01-17 15:24:29: Error: network commissioning timed out - most likely network with the same panId or extendedPanId already exists nearby │ │ at ZnpAdapterManager.beginCommissioning (/app/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/manager.ts:347:23) │ │ at ZnpAdapterManager.start (/app/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/manager.ts:92:17) │ │ at Controller.start (/app/node_modules/zigbee-herdsman/src/controller/controller.ts:123:29) │ │ at Zigbee.start (/app/lib/zigbee.ts:58:27) │ │ at Controller.start (/app/lib/controller.ts:100:27) │ │ at start (/app/index.js:101:5)

See here that the Coordinator Firnware was correctly flashed. I tried even the Firmware of Slae.sh himself. SlaeshStickWebserver

Koenkk commented 2 years ago

This means a network is already running with the same pan_id/extended_pan_id, using a different zigbee channel should fix the issue: https://www.zigbee2mqtt.io/guide/configuration/zigbee-network.html

If it doesn't, see https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start.html#error-coordinator-failed-to-start-probably-the-panid-is-already-in-use-try-a-different-panid-or-channel

rubenkr commented 2 years ago

@Koenkk thank you so much! It's starting up now. I dont know what I did right (or wrong).

However I cannot pair any devices because Z2M does not find any devices. I want to re-pair every device. Before I was using another coordinator (eszp chip). In the eszp Coordinator i deleted every paired devices and blocked it from repairing the old coordinator. Could this be the problem? I already tried to GENERATE a new pan_id but still cannot find ZB-devices.

THANK YOU!! for any idea what the heck I am doing wrong.

Koenkk commented 2 years ago

Try to shutdown your old network (remove all routers from mains power)

rubenkr commented 2 years ago

@Koenkk awesome ! that was it?! Its now working. I could not follow why Z2M FE was not showing anything nor logs. But now I re-paired every device and so far the docker z2m:dev version looks stable. YAY!!

3 coffee for you! Again, thank you very much! https://www.buymeacoffee.com/koenkk

icovada commented 1 year ago

For those who have lost hours or possibly days behind this: The problem is that zigbee2mqtt will always use the same, default extendedPanId unless you set it to something else in the config file.

Add this to your configuration.yaml file:

advanced:
  pan_id: GENERATE
  ext_pan_id: [0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08]
  network_key: GENERATE

Of course change the values to something random

063405 commented 1 year ago

pan_id: GENERATE ext_pan_id: [0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08] network_key: GENERATE

Thank you @icovada, I tried your solution and I get the following

`pi@rpi01:/opt/zigbee2mqtt $ npm start

zigbee2mqtt@1.30.1 start node index.js

/opt/zigbee2mqtt/node_modules/js-yaml/lib/loader.js:183 return new YAMLException(message, mark); ^ YAMLException: duplicated mapping key (29:1)

26 | frontend: 27 | port: 8082 28 | host: 192.168.0.172 29 | advanced: ------^ 30 | pan_id: GENERATE 31 | ext_pan_id: [0x01, 0x02, 0x ... at generateError (/opt/zigbee2mqtt/node_modules/js-yaml/lib/loader.js:183:10) at throwError (/opt/zigbee2mqtt/node_modules/js-yaml/lib/loader.js:187:9) at storeMappingPair (/opt/zigbee2mqtt/node_modules/js-yaml/lib/loader.js:358:7) at readBlockMapping (/opt/zigbee2mqtt/node_modules/js-yaml/lib/loader.js:1173:9) at composeNode (/opt/zigbee2mqtt/node_modules/js-yaml/lib/loader.js:1441:12) at readDocument (/opt/zigbee2mqtt/node_modules/js-yaml/lib/loader.js:1625:3) at loadDocuments (/opt/zigbee2mqtt/node_modules/js-yaml/lib/loader.js:1688:5) at Object.load (/opt/zigbee2mqtt/node_modules/js-yaml/lib/loader.js:1714:19) at Object.read (/opt/zigbee2mqtt/lib/util/yaml.ts:7:21) at read (/opt/zigbee2mqtt/lib/util/settings.ts:328:20)`

my configuration.yaml file is as follows:

`homeassistant: false permit_join: true mqtt: base_topic: zigbee2mqtt server: mqtt://192.168.0.172:1883 serial: port: /dev/ttyUSB0 advanced: network_key:

`

Any ideas?

icovada commented 1 year ago

Hi, you have a "YAMLException: duplicated mapping key" error, this means you have two rows in the dictionary with the same name.

Indeed in your example you have two "network_key" lines, one GENERATE and the other 102,164 ecc

Remove one of the two

lucas-guido commented 7 months ago

For those who have lost hours or possibly days behind this: The problem is that zigbee2mqtt will always use the same, default extendedPanId unless you set it to something else in the config file.

Add this to your configuration.yaml file:

advanced:
  pan_id: GENERATE
  ext_pan_id: [0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08]
  network_key: GENERATE

Of course change the values to something random

Worked for me, thanks! I just did it a little simpler after inspecting the docs.

advanced:
  pan_id: GENERATE
  ext_pan_id: GENERATE
  network_key: GENERATE
loulou91 commented 5 months ago

For me (windows 11) was not working with: advanced: pan_id: GENERATE ext_pan_id: [0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08] network_key: GENERATE

but IS working with: advanced: pan_id: GENERATE ext_pan_id: GENERATE network_key: GENERATE

raschy commented 5 months ago

I also need a little support. The plan is to replace the Conbee stick with a Sonoff stick. This should run under Proxmox with the ioB adapter 'zigbee'. My simple assumption, just change com port and connection name fails. I would like to avoid changing the PAN ID or similar, as otherwise I would have to re-learn all the devices. I have also ruled out that there are any rights involved. Both sticks are currently running in parallel as a test. Where is my mistake, what can I do?

iceland12 commented 4 months ago

hi all, I have my system working for 3 years without any big issue. I got this error after a simple restart of raspberry and, after my several attempts, I still not able to solve. Already tried to:

Any other ideas ? I am also resigned to having to pairing everything again, I would just have to solve... For information my ZB dongle is based on CC2538+CC2592 and I have about 50 devices .

iceland12 commented 4 months ago

hi all, I have my system working for 3 years without any big issue. I got this error after a simple restart of raspberry and, after my several attempts, I still not able to solve. Already tried to:

  • put pan_id, ext_pan_id and network_key to GENERATE
  • poweroff all ZB routers
  • changed the channel

Any other ideas ? I am also resigned to having to pairing everything again, I would just have to solve... For information my ZB dongle is based on CC2538+CC2592 and I have about 50 devices .

Please any ideas? I'm near to give up... Only to add some other information. I tried to move Raspberry+dongle to another place far from any old zigbee device and the zigbee2mqtt started without issues. Seems as some zigbee devices (not the routers that I shutdown as suggested) still create some interference or similar. But I have only endpoints still active, no routers at all. It can be possible ?

RShufan commented 3 months ago

hi all, I have my system working for 3 years without any big issue. I got this error after a simple restart of raspberry and, after my several attempts, I still not able to solve. Already tried to:

  • put pan_id, ext_pan_id and network_key to GENERATE
  • poweroff all ZB routers
  • changed the channel

Any other ideas ? I am also resigned to having to pairing everything again, I would just have to solve... For information my ZB dongle is based on CC2538+CC2592 and I have about 50 devices .

Please any ideas? I'm near to give up... Only to add some other information. I tried to move Raspberry+dongle to another place far from any old zigbee device and the zigbee2mqtt started without issues. Seems as some zigbee devices (not the routers that I shutdown as suggested) still create some interference or similar. But I have only endpoints still active, no routers at all. It can be possible ?

Using a USB Hub to connect the stick worked! I spent several days trying to solve this problem. I reflashed the stick on several different computers and endlessly reconfigured containers. It frustrates me that I spent so much time looking for a logical solution to the problem, and the solution turned out to be the least likely and one that defies logical explanation.

iceland12 commented 3 months ago

hi all, I have my system working for 3 years without any big issue. I got this error after a simple restart of raspberry and, after my several attempts, I still not able to solve. Already tried to:

  • put pan_id, ext_pan_id and network_key to GENERATE
  • poweroff all ZB routers
  • changed the channel

Any other ideas ? I am also resigned to having to pairing everything again, I would just have to solve... For information my ZB dongle is based on CC2538+CC2592 and I have about 50 devices .

Please any ideas? I'm near to give up... Only to add some other information. I tried to move Raspberry+dongle to another place far from any old zigbee device and the zigbee2mqtt started without issues. Seems as some zigbee devices (not the routers that I shutdown as suggested) still create some interference or similar. But I have only endpoints still active, no routers at all. It can be possible ?

Using a USB Hub to connect the stick worked! I spent several days trying to solve this problem. I reflashed the stick on several different computers and endlessly reconfigured containers. It frustrates me that I spent so much time looking for a logical solution to the problem, and the solution turned out to be the least likely and one that defies logical explanation.

Thanks @RShufan for your hint, I'll try. Do you use powered hub or a passive one?

ignas2526 commented 3 months ago

I had this error and nothing mentioned was helping. Turns out the issue was RF interference caused by the server. As a temp fix, I put a piece of foil between the server and the Zigbee transceiver and it solved the issue. A proper fix is to connect the Zigbee transceiver through a USB extension cord to have it physically away from the device causing the interference. Try placing your Zigbee transceiver away from all other electronic devices and cables. Especially cables that transmit any kind of data.

davidmjj commented 2 months ago

I had this error and nothing mentioned was helping. Turns out the issue was RF interference caused by the server. As a temp fix, I put a piece of foil between the server and the Zigbee transceiver and it solved the issue. A proper fix is to connect the Zigbee transceiver through a USB extension cord to have it physically away from the device causing the interference. Try placing your Zigbee transceiver away from all other electronic devices and cables. Especially cables that transmit any kind of data.

@ignas2526 I cannot express my gratitude with words, mate... I've been going in circles for hours with this and by doing what you described in your message everything started to work... THANKS!!!

AndreasFlies commented 1 month ago

pan_id: GENERATE \ ext_pan_id: GENERATE \ network_key: GENERATE

worked for me.

Will zigbee2mqtt generate new IDs on every start? The lines above were not removed from the configuration yaml.