# 4. Sniffer usage

You need to connect programmer-sniffer with your UAVCAN node via CAN socket and with your PC via USB.

There are 2 different CAN sockets. You can use any of them.

# Connection example diagram

The example of connection is shown below.


# 4.1. Cyphal usage

# Installing can-utils

apt-get install can-utils

# Tools

There are two main tools for configuration:

  1. Yukon GUI - Download via this link (opens new window), chmod +x ./Downloads/Yukon-linux-x86_64 before run.
  2. Yakut CLI:
pip install yakut

For detailed manuals, refer to the yukon (opens new window) and yakut (opens new window) repositories.

# Downloading DSDL

Retrieve the following:

To utilize a DSDL namespace, place its root namespace directory within the locations specified by CYPHAL_PATH. The following steps can guide you in this process:

# Ensure the directory exists.
mkdir -p ~/.cyphal

# Add namespaces from the public regulated data types repository:
wget https://github.com/OpenCyphal/public_regulated_data_types/archive/refs/heads/master.zip -O dsdl.zip
unzip dsdl.zip -d ~/.cyphal
mv -f ~/.cyphal/public_regulated_data_types*/* ~/.cyphal

# If needed, add vendor-specific namespaces:
wget https://github.com/Zubax/zubax_dsdl/archive/refs/heads/master.zip -O dsdl.zip
unzip dsdl.zip -d ~/.cyphal
mv -f ~/.cyphal/zubax_dsdl*/* ~/.cyphal

wget https://github.com/PonomarevDA/ds015/archive/refs/heads/pr-add-gnss.zip -O ds015.zip
unzip ds015.zip -d ~/.cyphal
mv -f ~/.cyphal/ds015-pr-add-gnss/ds015 ~/.cyphal

# Compile DSDL

export CYPHAL_PATH=~/.cyphal
yakut compile .cyphal/

# Set Up Environment Variables and SLCAN

Start by downloading the necessary scripts:

wget https://github.com/PonomarevDA/tools/raw/main/can/create_slcan_from_serial.sh
wget https://github.com/PonomarevDA/tools/raw/main/can/get_sniffer_symlink.sh
chmod +x create_slcan_from_serial.sh
chmod +x get_sniffer_symlink.sh

Subsequently, run the script below to configure your environment:

if ! [ -e /sys/class/net/slcan0 ]; then
 sudo ./create_slcan_from_serial.sh
export UAVCAN__CAN__IFACE='socketcan:slcan0'
if [ -e /sys/class/net/slcan1 ]; then
 export UAVCAN__CAN__IFACE="$UAVCAN__CAN__IFACE socketcan:slcan1"
export UAVCAN__CAN__MTU=8
export UAVCAN__CAN__BITRATE='1000000 1000000'
export UAVCAN__NODE__ID=$(yakut accommodate)
echo "Auto-selected node-ID for this session: $UAVCAN__NODE__ID"

Consider saving this script as can_setup_script.sh and executing it:

source can_setup_script.sh

You need to run this each time you connect USB CAN sniffer.

On the picture below there is an example of yakut usage.



# 4.2. DroneCAN usage

Alternatively, you can use gui_tool (opens new window) for DroneCAN applications.


In the Application Setup menu you need to set 1000000 to both can bus and adapter baud rates.

After that you will get following window:


# 4.3. Application examples

As an example, this device might be suitable for such applications as Cyphal/DroneCAN UAV HITL simulation (opens new window).

alt text