Skip to main content

Quality Gate Status cyphal_init.sh specification_checker.py

Cyphal/DroneCAN nodes tools

tools is a collection of scripts for testing and configuration of Cyphal/CAN and DroneCAN nodes.

This package is under development.

1. INSTALLATION

1. Install the package from pypi, test.pypi or from sources

pip install raccoonlab-tools
pip install -i https://test.pypi.org/simple/ raccoonlab-tools
git clone https://github.com/PonomarevDA/tools.git
cd tools
pip install .

2. Install dependencies

If you already have a Cyphal in your system, you probably don't need to install anything additional and have your own way of handling the environment variables and DSDL. Just check scripts/ubuntu.sh script in case if you miss something.

But if you use Cyphal for the first time or deploy a project in a new system, consider to run scripts/ubuntu.sh script. This script:

  1. Install all recommended dependencies,
  2. Clone recommended DSDL to ~/.cyphal directory,
  3. Create in ~/.cyphal directory a setup.sh script that configure cyphal related environment variables and append source $HOME/cyphal/setup.sh to the end of your .bashrc file, so your shell will automatically setup the environment variables.
# By default, it installs both Cyphal and DroneCAN dependencies:
./scripts/ubuntu.sh

# Try --help option to get usage details. It allows to perform more precise installation:
./scripts/ubuntu.sh --help
Click here for details about which environment variables are required for a Cyphal application

To start with Cyphal/CAN (pycyphal, yakut, yukon) the following environment variables should be configured:

Environment variable Meaning
CYPHAL_PATH Path to DSDL. Let's use the default:$HOME/.cyphal
UAVCAN__NODE__ID The application node identifier
UAVCAN__CAN__IFACE CAN iface name
UAVCAN__CAN__BITRATE Arbitration/data segment bits per second
UAVCAN__CAN__MTU Maximum transmission unit: 8 for classic CAN

Check pycyphal/yakut/yukon docs for additional details

2. LINUX (SOCKETCAN)

By default, DroneCAN and Cyphal/CAN uses cross-platform transport interface Python-CAN CAN over Serial / SLCAN.

On Linux, the socketcan interface is recommended. Unlike SLCAN, socketcan interface allows to share the same CAN interface with multiple processes, so you can run a few pycyphal scripts, yukon, yakut simultaniously.

You can run the following script:

./scripts/socketcan.sh

If you don't have a real CAN device, you can create a virtual CAN interface:

./scripts/socketcan.sh --virtual-can

Try --help option for more details.

For a Cyphal application after creating socketcan interface, you need to update UAVCAN__CAN__IFACE environment variable. Just call source ~/.bashrc.

3. USAGE

1. Test cyphal specification

rl-test-cyphal-specification
drawing

2. Test dronecan specification

rl-test-dronecan-specification
rl-test-dronecan-gps-mag-baro
drawing

3. Get Node Info (Cyphal / DroneCAN)

rl-get-info

Return:

  • Online CAN-sniffers
  • Detect protocol if any CAN-node is avaliable: cyphal | dronecan | none
  • Show node info of Cyphal/CAN or DroneCAN node if it is avaliable

4. Upload firmware with st-link linux / STM32CubeProgrammer Windows

rl-upload-firmware --config PATH_TO_YAML_CONFIG
rl-upload-firmware --binary PATH_TO_BIN_FILE

There are a few ways how you can specify the path to the binary:

  1. (recommended) Using a GitHub Repository. It will always download the latest released firmware.
# config.yaml
metadata:
    link: RaccoonlabDev/mini_v2_node
  1. Direct Link to the Firmware File
# config.yaml
metadata:
    link: https://github.com/RaccoonlabDev/docs/releases/download/v1.6.5/gnss_v2_cyphal_v1.6.5_c78d47c3.bin
  1. Using a Local Path
# config.yaml
metadata:
    link: /user/home/firmwares/node.bin
  1. Direct .bin path with --binary option

5. Upload config

rl-config --config PATH

Example of yaml config file:

# config.yaml
params:
    uavcan.node_id: 31
    uavcan.node.name: co.rl.mini
drawing

6. Monitor

rl-monitor

This script is used for automated node analysis. Within a single command:

  • detect the protocol (Cyphal or DroneCAN),
  • detect the node type,
  • check the software version and highlight if it is not the latest,
  • configure it if it has not been configured yet,
  • subscribes on all possible topics,
  • provide basic tests and diagnostics, highlight issues,
  • publish some test commands if possible,
  • print all data in real time.

An example of rl-monitor with gnss node:

7. U-center with Cyphal GNSS

rl-ublox-center

For RL GNSS it is possible to run u-center over Cyphal via gps.ubx_tx and gps.ubx_rx topics.

  1. Download u-center (tested with u-center 23.08)
  2. Run the u-center. On ubuntu you can use wine (wine64 u-centersetup_v23.08/u-center_v23.08.exe)
  3. Configure the Cyphal environment
  4. Run the script rl-ublox-center
  5. Press Receiver - > Connection -> Network connection
  6. Add new connection tcp://127.0.0.1:2001

An illustration:

drawing drawing

4. DEVELOPER NOTES

Deploy to TestPyPI:

./scripts/deploy.sh

Deploy to PyPI:

./scripts/deploy.sh --pypi

5. USAGE TERMS

The scripts are distributed under MIT license. In general, you can do with them whatever you want. If you find a bug, please suggest a PR or an issue.

Metadata

Release files for raccoonlab-tools 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for raccoonlab-tools 0.2.0
File Size Uploaded
raccoonlab_tools-0.2.0.tar.gz 47.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for raccoonlab-tools 0.2.0
File Interpreter ABI Platform
raccoonlab_tools-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 116.5 kB

Release files / raccoonlab_tools-0.2.0.tar.gz

Download URL raccoonlab_tools-0.2.0.tar.gz
Size 47.4 kB
Tags Source
SHA-256 checksum
How to use checksums
d1c6a5641ba117ee35fc6af4326580b0dac4ffa8571ca27d02783c576963e41a
BLAKE2b-256 checksum
How to use checksums
0b3bd4874702f62738a14e04abec4795ab2da3dcf0d2dc8ad21e74bbeb0ef66f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.12

Release files / raccoonlab_tools-0.2.0-py3-none-any.whl

Download URL raccoonlab_tools-0.2.0-py3-none-any.whl
Size 69.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
116eef80c81116cfeeaf3fd9dc9ec3cdcdf4271d16864bc68de6c489aac23433
BLAKE2b-256 checksum
How to use checksums
e09608cf3d84095c2d137e274ed09bf5586d8194c8233daf294d7f1405b338e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.12

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

0.0.18

2 release files

0.0.16

2 release files

0.0.10

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page