Repository navigation
EZSP protocol 8: EmberZNet 6.7 to 6.10 and the EM35x - #5
Merged
Merged
Conversation
Protocol 8 predates the security manager, so the adapter's five key operations go through getKey, getKeyTableEntry, setKeyTableEntry and addTransientLinkKey there (new Command/Response variants and types::KeyStruct; ProtocolVersion::sec_man picks the API). startScan answers with a one-byte EmberStatus before 13. Versions 9 to 12 stay refused. The simulator plays protocol 8 and refuses the other side's key commands, and the host's simulator suite runs against it, including an EM357 network restored onto a protocol 16 dongle. Tested on an EM357 on EmberZNet 6.7.10 (a Control4 CA-1's onboard radio): probe, resuming its existing network, backup, energy scan and permit join. Two fixes the hardware turned up: - probe waits ASH's full reset time with one reset; a second RST at 1.1 s cut off the EM357's RSTACK (it takes ~1.5 s to answer). - port::open waits up to 3 s for a just-closed serial port to be released instead of failing on its exclusive lock, which probe hit when reopening the port for the next coordinator family. Signed-off-by: Joseph Telaak <jttelaak@hotmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Adds EZSP protocol 8: EmberZNet 6.7 to 6.10. That is the last firmware for the EM35x (EM357, EM3581) and what the Sonoff ZBDongle-E ships with. Versions 9 to 12 are still refused.
Every Control4 controller's built-in radio is an EM357, which is why this is wanted: it lets the bridge drive those radios.
getKey,getKeyTableEntry,setKeyTableEntryandaddTransientLinkKeyinstead: the network key and its counters, the trust center root, link key backup and restore, and transient join keys. This adds newCommand/Responsevariants andtypes::KeyStruct.ProtocolVersion::sec_man()picks the API. A wildcard transient key is spelled all-ones on 6.x.startScananswers with a one-byteEmberStatusbefore protocol 13.--protocol 8) and refuses the other side's key commands, so the legacy paths really are exercised. The host's simulator suite runs against it, including an EM357 network restored onto a protocol 16 dongle.Fixes the hardware turned up:
probesends one reset and waits ASH's full T_RSTACK_MAX. It used to send a second RST at 1.1 s. The EM357 takes about 1.5 s to answer, so that second RST landed mid-reboot and cut its RSTACK off, and the coordinator was reported as missing.PROBE_TIMEOUTis now 4 s.port::openwaits up to 3 s for a serial port its last user just closed. The kernel holds the exclusive lock through the tty's close delay. Before,probefailed with "Unable to acquire exclusive lock" when it reopened the port for the next family, which hid what the port had answered.How it was tested
KeyStructlayout, thegetKeywire format,startScan's status width and the supported-version set.An EM357 on EmberZNet 6.7.10: the onboard radio of a Control4 CA-1, on its native UART at 115200.
probe: 6 runs back to back, all identified (protocol 8,6.7.10.0).network.jsonmatched.Not yet tested on hardware: pairing a real device, and restoring onto protocol 8.
Checklist
cargo fmt --all --check,cargo clippy --workspace --all-targets -- -D warningsandcargo test --workspacepassCHANGELOG.mdunder[Unreleased]docs/, rustdoc) if behavior, config keys or MQTT topics changedgit commit -s, see CONTRIBUTING.md)