Hello, I’m interested in using OpenCyphal where I work and for side projects. I’d like to create a native Go implementation of OpenCyphal with the purpose of using it on low level micro-controllers such as the RP2040 and in linux machines. The starting point I want to reach is having sufficient functionality so as to have two nodes: one that requests data and the other that sends it over wire. What are some useful pointers to get me up and running?
I suggest working through the PyCyphal demo here to get a feel of the protocol in practice: Demo — PyCyphal 1.8.5 documentation
Which transports do you want to support in your implementation? Cyphal/UDP, Cyphal/serial (which also works over TCP), or Cyphal/CAN? If you are aiming for multi-transport library, then you will likely need some form of abstraction over the transport, kind of like it is done in PyCyphal with pycyphal.transport.Transport
.
Be sure to read the Guide also as it will help you understand why Cyphal is designed the way it is: The Cyphal Guide - Applications & Usage - OpenCyphal Forum
Well, if at all possible I’d like to not differ between protocols and instead depend on a io.Reader
, io.Writer
interfaces. These are serial-like and don’t have intrinsic support for frames but are well known in the Go language and facilitate interoperability with pretty much any byte-stream interface out there.
Thanks for the pointers, I’ll take a look at the Demo program and read through the Cyphal Guide
I suspect they may not be usable for abstracting the transport because they are too low-level for that. Consider defining a custom interface using pycyphal.transport.Transport
as a reference. Keep in mind though that PyCyphal is complex as far as Cyphal implementations go because it incorporates many diagnostic features (like spoofing/snooping, statistics, etc.). For a bare-bones semi-embedded implementation you can simplify things a lot.