Myxa with Ardupilot

Something is broken in your Python installation.

I’ve installed an Ubuntu virtual machine on my Windows machine (Ubuntu 20.04).

Following your screencast, I’ve installed Yakut correctly (it gives an output when yakut --help). However, I can’t seem to run the transport. I tried the sourcing method, but it returns:

sudo: setup_slcan: command not found
OSError: [Errno 19] No such device
Auto-selected node-ID for this session: 

When I try setting the environment variables manually, I’ve found my Babel as tty/ACM0:

user@ubuntu:/sys$ export UAVCAN__CAN__IFACE="slcan:ttyACM0"
user@ubuntu:/sys$ export UAVCAN__NODE__ID=$(yakut accommodate) 
InvalidMediaConfigurationError: Interface does not support CAN FD: slcan

How do I fix this?
Sorry for being a pain :sweat_smile: :sweat_smile:

The first command failed because you need to install setup_slcan, as suggested by the error message. If you google the name, you will find it in the first search result: setup_slcan -- a simple script for managing SocketCAN SLCAN interfaces on GNU/Linux · GitHub

To fix the “interface does not support CAN FD” error, you need to set the bit rate and the MTU manually. This is because by default, PyCyphal assumes that you want CAN FD, but it is not supported by the SLCAN protocol. Here’s how you can do it:

export UAVCAN__CAN__BITRATE="1000000 1000000"
export UAVCAN__CAN__MTU="8"

So I’ve done a fair level of digging and I’m up to this point:

user@ubuntu:~/Desktop$ python3 update_bootloader.py
Install PyCyphal: pip install pycyphal[transport-can-pythoncan,transport-serial]; also configure the CYPHAL_PATH environment variable; see PyCyphal or Yakut docs for details.

But I know that my env path is installed correctly (following the screencast). In the actual python updatebootloader file, I see that error is returned when the program can’t:

import pycyphal
import uavcan
import zubax

Manually running python and checking sees that I can indeed import PyCyphal, but I can’t import uavcan (even after installing it (pip3 install uavcan/pip install pyuavcan_v0) and I can’t import zubax. However, I can’t seem to find an package for that.
How do I solve this?

Thank you once again for your patience Pavel!!

This is because PyCyphal cannot find the DSDL files. Your CYPHAL_PATH variable needs to contain a list of directories that contain DSDL namespaces. For example, if you clone GitHub - OpenCyphal/public_regulated_data_types: Regulated DSDL definitions for Cyphal (standard and third-party) into your home directory, then you should export CYPHAL_PATH=$HOME/public_regulated_data_types.

Please uninstall these, they are not needed.

Done.
When I run echo $CYPHAL_PATH I get: /home/usr/public_regulated_data_types/, and running cd $CYPHAL PATH, throws me into the right folder. When I set the variable correctly, I got a compiling DSDL .... (can’t recall fully), and then the shell gives me the same error as earlier:

Install PyCyphal: pip install pycyphal[transport-can-pythoncan,transport-serial]; also configure the CYPHAL_PATH environment variable; see PyCyphal or Yakut docs for details.

The DSDL files are correct now, yet the error is the same.

Weird. Please export PYCYPHAL_LOGLEVEL="DEBUG" and re-run, then share the output.

This is the result. Not too sure what to make of it.

user@ubuntu:~/Desktop$ python3 update_bootloader.py 
2024-11-20 05:32:35,987  8569 INFO     pycyphal: Log config from env var; level: 'DEBUG'
2024-11-20 05:32:36,136  8569 DEBUG    pycyphal.dsdl._import_hook: Installing default import hook.
2024-11-20 05:32:36,136  8569 DEBUG    pycyphal.dsdl._import_hook: lookup dirs: ['/home/usr/public_regulated_data_types/']
2024-11-20 05:32:36,136  8569 DEBUG    pycyphal.dsdl._import_hook: output dir: /home/usr/.pycyphal
2024-11-20 05:32:36,137  8569 DEBUG    pycyphal.dsdl._import_hook: Using root namespace uavcan at /home/usr/public_regulated_data_types/uavcan
2024-11-20 05:32:36,137  8569 DEBUG    pycyphal.dsdl._import_hook: Using root namespace reg at /home/usr/public_regulated_data_types/reg
2024-11-20 05:32:36,192  8569 DEBUG    pycyphal.dsdl._import_hook: Attempting to load module uavcan as DSDL
2024-11-20 05:32:36,193  8569 DEBUG    pycyphal.dsdl._import_hook: Found root namespace uavcan in DSDL source directory /home/usr/public_regulated_data_types/uavcan
2024-11-20 05:32:36,193  8569 DEBUG    pycyphal.dsdl._import_hook: Attempting to load module zubax as DSDL
Install PyCyphal: pip install pycyphal[transport-can-pythoncan,transport-serial]; also configure the CYPHAL_PATH environment variable; see PyCyphal or Yakut docs for details.

Ah it’s easy. According to the last two lines of the log, you just need to download this and store it similarly to your public_regulated_data_types:

Be sure it is listed in CYPHAL_PATH.