Skip to content

Answer coordinator node descriptor requests during Zigbee 3.0 commissioning - #60

Open
danielstena wants to merge 3 commits into
zigpy:devfrom
danielstena:fix/proactive-tclk-update
Open

Answer coordinator node descriptor requests during Zigbee 3.0 commissioning#60
danielstena wants to merge 3 commits into
zigpy:devfrom
danielstena:fix/proactive-tclk-update

Conversation

@danielstena

@danielstena danielstena commented Sep 1, 2026

Copy link
Copy Markdown

Zigbee 3.0 end devices query the coordinator Node Descriptor before requesting a fresh Trust Center link key. Ziggurat previously forwarded Node_Desc_req to the client without answering it, so joining devices could time out key establishment and leave the network.

This change:

  • adds typed Node_Desc_req and Node_Desc_rsp ZDP structures
  • answers requests for the local coordinator with a 2.4 GHz coordinator descriptor
  • advertises the primary Trust Center and stack-compliance revision 22
  • keeps the standards-driven device Request-Key, Transport-Key, Verify-Key, and Confirm-Key flow
  • removes the earlier proactive Trust Center key push from this PR
  • retains pending-key reuse so a repeated Request-Key cannot invalidate an in-flight verification
  • ignores a looped-back Parent_annce whose source is the coordinator own NWK address, so the coordinator cannot delete a restored sleepy child from its own announcement

Hardware evidence:

  • reproduced the original commissioning failure with a Tuya TS0041 and SONOFF SNZB-01P when no coordinator Node Descriptor response was sent
  • with the response enabled, both completed the Trust Center link-key exchange and remained joined beyond 60 seconds
  • production then exposed a second failure after restart: the coordinator received its own Parent_annce from NWK 0x0000 after the 10 to 20 second startup delay and removed the restored unconfirmed TS0041 child
  • with the self-source guard enabled on an isolated local network, an SNZB-01P remained joined for 78 seconds, survived a full client and sidecar restart, remained present after the parent-announcement window, and delivered a physical post-restart frame from the same NWK address without an unknown-device leave or route discovery

Verification:

  • cargo test -p ziggurat-zigbee -p ziggurat-driver
  • cargo fmt --all -- --check
  • cargo clippy -p ziggurat-zigbee -p ziggurat-driver --all-targets -- -D warnings -A clippy::needless-late-init -A clippy::chunks-exact-to-as-chunks

The two allowed Clippy lints are pre-existing under the current Rust toolchain.

@puddly

puddly commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Thanks! What device are you using that requires this change?

@danielstena danielstena changed the title Initiate trust center link key updates after join Answer coordinator node descriptor requests during Zigbee 3.0 commissioning Sep 2, 2026
@puddly

puddly commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

I noticed this PR has changed drastically since it was opened. Ziggurat expects the radio library to handle node descriptor requests, as in zigpy-ziggurat: https://github.com/zigpy/zigpy-ziggurat/blob/c92f7356f9cc2ace2d563578ab69b9e5270ae80b/zigpy_ziggurat/zigbee/application.py#L617

How are you running Ziggurat to require this change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants