Multiple simultaneous functions with Yakut

I’ll be integrating libcanard (v1.0) on an embedded microcontroller, and I’d like to set up a test environment running on a Windows PC. I have a Zubax Babel interface connected to the Windows PC, and connected via CAN bus to the microcontroller. I’d like to simulate multiple nodes, monitor traffic, and spawn a fileserver for firmware updates. Preferably, all of these functions will be running simultaneously.

At this point, it appears the graphical tool (Yukon) is still under development, so I’m guessing I’ll need to use the command-line tool, Yakut (please confirm).

I’ve successfully run a single instance of Yakut to communicate with the microcontroller. However, when attempting to run a second instance of Yakut, I see a failure when attempting to open the Babel adapter.

Does Yakut support running multiple simultaneous functions?

If not, I’m considering implementing a CAN-to-UDP bridge using pyuavcan, so that I can have multiple instances of Yakut performing different functions, and communicating with the microcontroller over CAN. In fact, I’ve already started down this path using the Sniffing/Spoofing/Tracing example in the documentation, but I’m having some difficultly adapting the LoopbackTransport based example to use UDPTransport. Despite having NPCAP installed, I’m not receiving any captured data from UDP. I can share code if needed to troubleshoot this area. It’s probably just a silly mistake, but it would be helpful to have someone confirm correct usage of the capture API.

Hi Steve! :wave:

terrific

ugh

excellent choice

This is totally possible, but Windows might not be the best platform out there for this kind of endeavor (more below).

affirmative

Yes, of course it does. Your problem is not with Yakut but with the fact that you are attempting to do I/O on the same port from multiple processes concurrently. That won’t do, Steve.

You need some kind of IO aggregator to sit between your Yakuts (or whatever other CAN software you feel like running) and the Babel. If you are feeling adventurous, you can code one up yourself just like you described. If you are feeling pragmatic, you should ditch Windows and grab yourself a GNU/Linux, which offers the required functionality out of the box via SocketCAN (similar API is also available in Zephyr and maybe also NuttX, btw).

SocketCAN on GNU/Linux comes with native support for the SLCAN tunneling protocol, which is used by Babel. You run slcand, it connects to your Babel, then you get a network interface like slcan0, which you can connect to from multiple processes simultaneously. You can use this helper script to simplify setting up slcand for use with Babel:

Pavel, thanks for all of the feedback. I’ll investigate using Linux/SocketCAN for development and testing. In the meantime, I’ll continue working toward a CAN-to-UDP bridge using pyuavcan. I’ll create a separate topic in the forum if I can’t get UDP capture working.

Okay Steve. While battling UDP, remember that verbose logging is your friend.