Support connecting to an RCP over a raw TCP socket#39
Conversation
ced1a31 to
a48851e
Compare
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>
a48851e to
0a52be7
Compare
puddly
left a comment
There was a problem hiding this comment.
Looks good to me. Have you gotten it to run with a live device?
Co-authored-by: puddly <32534428+puddly@users.noreply.github.com>
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) . |
HA Core hasn't been updated yet to work with any of the recent changes. You will need to manually upgrade |
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.