Virtual serial ports over CAN Nodes

Hi all, I’m trying to install 2 can nodes like the diagram below :

The respective can firmware on nodes is the latest AP-Periph v1.9.A627D377
And configured with static nodes ID (Matek 1 - 27, Matek 2 - 30)

I have managed to make it work with serial 1, but somehow, the raspi isn’t seeing the virtual serial port over the second matek.

All the matek and FC are connected with CAN cables.

The first serial is on Virtual serial one with node 27 and the second serial is on the virtual serial 2 parameter with node id 30. (params below)

Is the function serial over the second can not supported?

Am i missing something?

Unless something has changed recently it is my understanding that MavLink is not available over CAN.

Serial port for your telemetry yes, mavlink, no….

What you have drawn does not work.

While looking into this topic made by the developer, I noticed that he is actually using MAVLink 2 over DroneCAN.

I tried connecting the Raspberry Pi directly to the first Matek board, and in that configuration the connection works correctly.

However, when I connect the system as shown in the diagram in the first picture, the connection no longer works and the Raspberry Pi is not able to connect.

Has anyone experienced something similar or can explain why this setup behaves differently?

Ok, problem solved,

I can confirm that Serial passthrough over DroneCAN is supported (it’s not “MAVLink over CAN”, it’s raw serial bytes tunneled via the FC to the DroneCAN node). ArduPilot supports mapping up to 3 serial ports per CAN driverto DroneCAN peripherals.

In my case, the second Matek node looked “invisible” from the companion, but the root cause was configuration, not a limitation:

Fix if someone have the same problem: I had too many SERIALx ports set to MAVLink2 at the same time. After disabling MAVLink on the extra/unneeded serial ports (set those SERIALx_PROTOCOL to None/Disabled), both DroneCAN virtual serial links started working immediately.

So if your second DroneCAN virtual serial doesn’t come up:

  • Make sure only the ports that truly need MAVLink are set to MAVLink2

  • Disable MAVLink on all other SERIALx ports

  • Keep your DroneCAN serial mapping pointed at the correct node IDs / serial indexes

After reducing the number of MAVLink instances, the FC routed the DroneCAN serial tunnel correctly and everything worked.

1 Like

Mavlink2 over DroneCAN is not only doable, I rely on it for remote telemetry. I can even switch between RCIN and MAVLINK2 on the DroneCAN “UART”. I had it on MAVLINK2 during setup for WiFi telemetry. Then I switched it back to RCIN so I can use Yaapu on my TX. I’m using ELRS

1 Like