Yakut compile and monitor errors

I’m having trouble installing Yakut on a Raspberry Pi 4, 64-bit (aarch64), Ubuntu 22.04, Python 3.10.12, which has can0 and can1, both CANFD. Two CANFD devices are on the bus, working normally sending only Heartbeats.

Installed versions:

$ nnvg --version
2.3.1

$ yakut --version
yakut, version 0.13.0

Environment:

$ cat env_cyphal.sh 
export PYCYPHAL_PATH="~/.pycyphal"
export YAKUT_PATH="~/.pycyphal/uavcan:~/.pycyphal/reg"
export UAVCAN__CAN__IFACE='can0 can1'
export UAVCAN__CAN__MTU=64
export UAVCAN__CAN__BITRATE='1000000 5000000'   # Arbitration and data segment bit rates.
export UAVCAN__NODE__ID=2			# Yakut node-ID
echo "node-ID for this session: $UAVCAN__NODE__ID"

After unzipping the DSDL files, run:

y -vv compile .cyphal/public_regulated_data_types-master/

There is an error:

2024-01-15 23:47:39 3956066 INF pydsdl._namespace: Reading 241 definitions from the root namespace public_regulated_data_types-master, with 241 lookup definitions located in root namespaces: public_regulated_data_types-master
2024-01-15 23:47:39 3956066 DEB pydsdl._dsdl_definition: public_regulated_data_types-master.reg.udral.physics.acoustics.Note.0.1: Starting processing with 240 lookup definitions located in root namespaces: public_regulated_data_types-master
UndefinedDataTypeError: /home/ares/.cyphal/public_regulated_data_types-master/reg/udral/physics/acoustics/Note.0.1.dsdl:6: Data type uavcan.si.unit.frequency.Scalar.1.0 could not be found in the following root namespaces: {'public_regulated_data_types-master'}.  Please make sure that you specified the directories correctly.
2024-01-15 23:47:39 3956066 DEB yakut: EXCEPTION UndefinedDataTypeError: /home/ares/.cyphal/public_regulated_data_types-master/reg/udral/physics/acoustics/Note.0.1.dsdl:6: Data type uavcan.si.unit.frequency.Scalar.1.0 could not be found in the following root namespaces: {'public_regulated_data_types-master'}.  Please make sure that you specified the directories correctly.

I can run the compiler with success on just the uavcan folder:

y -vv compile .cyphal/public_regulated_data_types-master/uavcan

But not the reg folder:

y -vv compile .cyphal/public_regulated_data_types-master/reg
2024-01-15 23:51:40 3959291 INF pydsdl._namespace: Reading 68 definitions from the root namespace reg, with 68 lookup definitions located in root namespaces: reg
2024-01-15 23:51:40 3959291 DEB pydsdl._dsdl_definition: reg.udral.physics.acoustics.Note.0.1: Starting processing with 67 lookup definitions located in root namespaces: reg
UndefinedDataTypeError: /home/ares/.cyphal/public_regulated_data_types-master/reg/udral/physics/acoustics/Note.0.1.dsdl:6: Data type uavcan.si.unit.frequency.Scalar.1.0 could not be found in the following root namespaces: {'reg'}.  Please make sure that you specified the directories correctly.
2024-01-15 23:51:40 3959291 DEB yakut: EXCEPTION UndefinedDataTypeError: /home/ares/.cyphal/public_regulated_data_types-master/reg/udral/physics/acoustics/Note.0.1.dsdl:6: Data type uavcan.si.unit.frequency.Scalar.1.0 could not be found in the following root namespaces: {'reg'}.  Please make sure that you specified the directories correctly.

But even the compiled uavcan DSDL files will not load, as I get another error, that the compile still needs to be performed:

$ y -vv mon
2024-01-15 23:55:50 3962649 DEB yakut: Path: ('/home/ares/~/.pycyphal/aivs', '/home/ares/~/.pycyphal/uavcan', '/home/ares/~/.pycyphal/reg')
2024-01-15 23:55:50 3962649 DEB asyncio: Using selector: EpollSelector
2024-01-15 23:55:50 3962649 DEB pycyphal.dsdl._import_hook: Attempting to load module scipy.linalg._cblas as DSDL
2024-01-15 23:55:50 3962649 DEB pycyphal.dsdl._import_hook: Attempting to load module scipy.linalg._fblas_64 as DSDL
2024-01-15 23:55:50 3962649 DEB pycyphal.dsdl._import_hook: Attempting to load module scipy.linalg._clapack as DSDL
2024-01-15 23:55:50 3962649 DEB pycyphal.dsdl._import_hook: Attempting to load module scipy.linalg._flapack_64 as DSDL
2024-01-15 23:55:50 3962649 DEB pycyphal.dsdl._import_hook: Attempting to load module scikits as DSDL
2024-01-15 23:55:50 3962649 DEB pycyphal.dsdl._import_hook: Attempting to load module uavcan as DSDL
2024-01-15 23:55:50 3962649 DEB yakut: Event loop finalization with exc=(<class 'click.exceptions.ClickException'>, ClickException("Run `yakut compile <path>/uavcan` to compile DSDL namespace 'uavcan'"), <traceback object at 0xffff8cc75640>)
Error: Run `yakut compile <path>/uavcan` to compile DSDL namespace 'uavcan'
2024-01-15 23:55:50 3962649 DEB yakut: EXIT 1

I tried compiling the DSDLs using nnvg, which completed successfully:

nnvg ~/.cyphal/public_regulated_data_types-master/reg --outdir ~/.pycyphal --target-language py -I ~/.cyphal/public_regulated_data_types-master/uavcan
nnvg ~/.cyphal/public_regulated_data_types-master/uavcan --outdir ~/.pycyphal --target-language py -I ~/.cyphal/public_regulated_data_types-master/reg

But the same error occurs when I invoke monitor:

$ y -vv monitor
2024-01-15 23:36:02 3946596 DEB yakut: Path: ('/home/ares/~/.pycyphal/aivs', '/home/ares/~/.pycyphal/uavcan', '/home/ares/~/.pycyphal/reg')
2024-01-15 23:36:02 3946596 DEB asyncio: Using selector: EpollSelector
2024-01-15 23:36:02 3946596 DEB pycyphal.dsdl._import_hook: Attempting to load module scipy.linalg._cblas as DSDL
2024-01-15 23:36:02 3946596 DEB pycyphal.dsdl._import_hook: Attempting to load module scipy.linalg._fblas_64 as DSDL
2024-01-15 23:36:02 3946596 DEB pycyphal.dsdl._import_hook: Attempting to load module scipy.linalg._clapack as DSDL
2024-01-15 23:36:02 3946596 DEB pycyphal.dsdl._import_hook: Attempting to load module scipy.linalg._flapack_64 as DSDL
2024-01-15 23:36:03 3946596 DEB pycyphal.dsdl._import_hook: Attempting to load module scikits as DSDL
2024-01-15 23:36:03 3946596 DEB pycyphal.dsdl._import_hook: Attempting to load module uavcan as DSDL
2024-01-15 23:36:03 3946596 DEB yakut: Event loop finalization with exc=(<class 'click.exceptions.ClickException'>, ClickException("Run `yakut compile <path>/uavcan` to compile DSDL namespace 'uavcan'"), <traceback object at 0xffffaff6a280>)
Error: Run `yakut compile <path>/uavcan` to compile DSDL namespace 'uavcan'
2024-01-15 23:36:03 3946596 DEB yakut: EXIT 1

There must be some tool incompatibility on my system. How can I make compiled DSDL python files for use with yakut?

yakut compile is no longer needed, should no longer be used, and will be removed soon. Yakut sometimes emits unhelpful suggestions to use this command, but they will be removed as well. The correct approach is to set the CYPHAL_PATH environment variable such that it points where your DSDL definitions are; variables PYCYPHAL_PATH and YAKUT_PATH are not needed and should be unset.

export CYPHAL_PATH="~/.cyphal/public_regulated_data_types-master"
export UAVCAN__CAN__IFACE='can0 can1'
export UAVCAN__CAN__MTU=64
export UAVCAN__CAN__BITRATE='1000000 5000000'   # Arbitration and data segment bit rates.
export UAVCAN__NODE__ID=2			# Yakut node-ID

Thanks for the quick reply. That solved the compile issues.

Based on another Yakut error I set the interface to include channel number:

export UAVCAN__CAN__IFACE="can0:1"

But still get another error:

pycyphal.transport._error.InvalidMediaConfigurationError: Interface not supported yet: can0

On this system:

$ ifconfig
can0: flags=193<UP,RUNNING,NOARP>  mtu 72
        unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 10  (UNSPEC)
        RX packets 1262630  bytes 19694126 (19.6 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 54  

can1: flags=193<UP,RUNNING,NOARP>  mtu 72
        unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 10  (UNSPEC)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 55  

And candump() of two Cyphal nodes on can0:

$ candump can0
  can0  187D5506  [08]  FF FF FF FF 00 00 00 EA
  can0  1864D406  [48]  78 56 CA 0C 1F A2 8A 48 78 CB 47 40 75 B9 56 B5 C3 92 5E C0 AE 47 E1 7A 14 E2 51 40 32 55 BE 40 79 58 0F 41 00 00 00 00 00 00 00 00 00 00 00 E8
  can0  107D5501   [8]  91 00 00 00 00 00 00 F1

How do I set the CAN interface name in Yakut?

Got it working:

export UAVCAN__CAN__IFACE="socketcan:can0"           # Use CAN can0 as transport layer
export UAVCAN__CAN__BITRATE="1000000 5000000"         # 5 Mbps
1 Like

Well done. Next time please use rich formatting for code blocks when posting on the forum.