Cynic is a simple command-line tool for inspecting and exercising Cyphal networks.
Cynic is built for use with Cyphal v1.1, which introduces named topics.
It is fully interoperable with Cyphal/CAN v1.0 via pinned topics, where the topic name is constructed from its
subject-ID, like 1234#1234.
Usage
Install:
pip install cyphal-cynic
Run cn --help for full usage info, or read the code -- it is simple and compact. Some basic examples are shown below.
List topics visible in the network
cn ls
cn --can=can0 ls
cn --can=COM8 --bitrate=125000 ls
Publish/subscribe
printf '\x01\x02' | cn pub topic/foo
cn sub -o raw topic/foo > messages.bin
Set defaults per directory in cynic.toml, or use environment variables:
can = "/dev/serial/by-id/usb-Zubax*Babel*if00" # or SocketCAN iface name
bitrate = 1_000_000
dsdl_root = ["/home/user/public_regulated_data_types/uavcan", "/home/user/zubax_dsdl"]
RPC/streaming
Send a request, print response(s):
cn req topic/foo/bar --io=zubax/primitive/String1K.1.0.dsdl -- 'Hello world!'
Showcase
Firmware update via Cyphal/CAN
Put this in ./cynic.toml so that you don't have to say --can=slcan0 with every command (optional):
can = "slcan0" # Can also be a file wildcard for SLCAN
Run the file server in the background (or in a second terminal); the topic name here is arbitrarily chosen as fwupd:
cn fs fwupd &
Command the remote node to download the specified firmware file from topic fwupd:
echo 'upd com.zubax.fluxgrip-1-1.0.41c608fbec4f54d9.16c6d0fc4c1e972a.app.release.bin fwupd' | \
cn pub -i ~/zubax/zubax_dsdl/zubax/primitive/String256.1.0.dsdl command
Release files for cyphal-cynic 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cyphal_cynic-0.2.0.tar.gz | 28.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cyphal_cynic-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 42.6 kB
Release files / cyphal_cynic-0.2.0.tar.gz
| Download URL | cyphal_cynic-0.2.0.tar.gz |
|---|---|
| Size | 28.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f6b3fe0756643f74a15fd14da791f92531ccd6c4055654d55d478fd4ef31da48
|
|
BLAKE2b-256 checksum How to use checksums |
079c0f6efcbb9a53e9e57f182dd67150630396f2f0c2575fcd9e302d706844db
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / cyphal_cynic-0.2.0-py3-none-any.whl
| Download URL | cyphal_cynic-0.2.0-py3-none-any.whl |
|---|---|
| Size | 14.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dcf97a04c8e5bf098887142c5d44f85d5946070697fc79a419a3fd7d241ef315
|
|
BLAKE2b-256 checksum How to use checksums |
db269687b4fc82cc56e587eb1738cc1cfc9009ab025a1b3740aa6c6509432e91
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|