Skip to content

Support connecting to an RCP over a raw TCP socket#39

Draft
tube0013 wants to merge 2 commits into
zigpy:devfrom
tube0013:tcp-adaptor-support
Draft

Support connecting to an RCP over a raw TCP socket#39
tube0013 wants to merge 2 commits into
zigpy:devfrom
tube0013:tcp-adaptor-support

Conversation

@tube0013

@tube0013 tube0013 commented Jul 9, 2026

Copy link
Copy Markdown

ziggurat-spinel's SpinelClient was hard-coded to tokio_serial::SerialStream. Generalize it to a boxed RcpTransport (any AsyncRead + AsyncWrite), and teach ziggurat-server to open a TcpStream when --device is given as tcp://host:port, falling back to the existing serial-port path otherwise.

@tube0013 tube0013 force-pushed the tcp-adaptor-support branch from ced1a31 to a48851e Compare July 9, 2026 18:42
ziggurat-spinel's SpinelClient was hard-coded to tokio_serial::SerialStream.
Generalize it to a boxed RcpTransport (any AsyncRead + AsyncWrite), and teach
ziggurat-server to open a TcpStream when --device is given as tcp://host:port,
falling back to the existing serial-port path otherwise.

Rebased onto dev (through zigpy#46, "Granular network state events for
backup/restore"). The wire protocol was rewritten from JSON-over-WebSocket to
a COBS-framed binary protocol (zigpy#38, ziggurat-protocol) since this was last
rebased; only ziggurat-spinel/src/client.rs and the transport-opening half of
ziggurat-server/src/main.rs (SerialConfig, open_transport, fn phy and its
callers) needed re-applying — the request/response dispatch layer itself
was untouched by this change and is left as upstream has it.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@tube0013 tube0013 force-pushed the tcp-adaptor-support branch from a48851e to 0a52be7 Compare July 15, 2026 15:41

@puddly puddly left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Have you gotten it to run with a live device?

Comment thread crates/ziggurat-server/src/main.rs Outdated
Co-authored-by: puddly <32534428+puddly@users.noreply.github.com>
@tube0013

Copy link
Copy Markdown
Author

Looks good to me. Have you gotten it to run with a live device?

Yes, it was on a version based on the code before the esp32 support was committed. I had issues with dev at the time - which leads me to: what version of HA is dev working with?

Stuck in the office today - I can test this last change at some point ›later tonight.

Hardware flow between on the uart line between the esp32 and the rcp is essential though. without I think it won't be nearly as stable as I've seen it (across this and my thread network on another tcp connected rcp) .

@puddly

puddly commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

what version of HA is dev working with?

HA Core hasn't been updated yet to work with any of the recent changes. You will need to manually upgrade zigpy-ziggurat (zigpy/zigpy-ziggurat#3) within the HA Core container to get things running.

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