Skip to content

EZSP protocol 8: EmberZNet 6.7 to 6.10 and the EM35x - #5

Merged
The1TrueJoe merged 1 commit into
mainfrom
ezsp-v8
Nov 20, 2026
Merged

The1TrueJoe merged 1 commit into
mainfrom
ezsp-v8

Conversation

@The1TrueJoe

@The1TrueJoe The1TrueJoe commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

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.

  • Keys. Protocol 8 predates the security manager. On it, the adapter's five key operations use getKey, getKeyTableEntry, setKeyTableEntry and addTransientLinkKey instead: the network key and its counters, the trust center root, link key backup and restore, and transient join keys. This adds new Command/Response variants and types::KeyStruct. ProtocolVersion::sec_man() picks the API. A wildcard transient key is spelled all-ones on 6.x.
  • startScan answers with a one-byte EmberStatus before protocol 13.
  • Simulator. It plays protocol 8 (--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:

  • probe sends 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_TIMEOUT is now 4 s.
  • port::open waits 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, probe failed 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

  • The whole host suite runs against the protocol 8 simulator, and there are unit tests for the KeyStruct layout, the getKey wire format, startScan's status width and the supported-version set.
  • Real hardware:

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).
  • Resumed the network already on the NCP, after first refusing it until network.json matched.
  • Backup: a valid open-coordinator backup with the real network frame counter.
  • Energy scan: all 16 channels.
  • Permit join, open and close, over MQTT. No warnings in the log, about 6.4 MB RSS.

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 warnings and cargo test --workspace pass
  • New behavior has a test (simulator, recorded session or unit test)
  • User-visible changes are in CHANGELOG.md under [Unreleased]
  • Docs updated (README, docs/, rustdoc) if behavior, config keys or MQTT topics changed
  • Every commit is signed off (git commit -s, see CONTRIBUTING.md)

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>
@The1TrueJoe
The1TrueJoe enabled auto-merge (squash) November 20, 2026 08:25
@The1TrueJoe
The1TrueJoe merged commit 6c76e10 into main Nov 20, 2026
13 checks passed
@The1TrueJoe
The1TrueJoe deleted the ezsp-v8 branch November 20, 2026 08:40
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.

1 participant