MAVLink Router: Message Routing Application
MAVLink Router is an application designed to distribute MAVLink messages across multiple endpoints (connections). It distributes packets to a single port or multiple endpoints based on the target address. Connections can be established via UART, UDP, or TCP.

1. Compilation and Installation
To compile the application, the following packages are required:
- GCC or Clang compiler
- meson >= 0.57 and ninja-build
- C and C++ standard libraries
Getting Dependencies
MAVLink Router currently depends on the MAVLink C library. You must fetch the corresponding submodules:
$ git clone https://github.com/mavlink-router/mavlink-router.git
$ cd mavlink-router
$ git submodule update --init --recursiveAdditional packages are required as build dependencies. For Debian/Ubuntu distributions:
$ sudo apt install git meson ninja-build pkg-config gcc g++ systemdThe meson package must be version 0.55 or higher. If your package manager does not provide this version, you can download the latest version via pip:
$ sudo pip3 install meson2. Build
The build system follows the standard Configure / Build / Install sequence. Configuration only needs to be performed once.
Configuration:
For a typical x86-64 system, use the following commands:
$ meson setup build .
$ ninja -C build
$ sudo ninja -C build install3. Execution
There are two ways to run mavlink-routerd: using a configuration (.conf) file or using command-line interface (CLI) parameters.
Using a Configuration File
By default, mavlink-routerd looks for the file located at /etc/mavlink-router/main.conf.
You can override the file location using the MAVLINK_ROUTERD_CONF_FILE environment variable or the -c option when executing mavlink-routerd. Detailed descriptions of the configuration syntax and parameters can be found in the examples/config.sample file.
In addition to the main .conf file, you can use a directory to store additional configuration files. Files in this directory are read in alphabetical order and can add to or override configurations found in previous files. The default directory is /etc/mavlink-router/config.d.
.conf File Example
The following example routes traffic between the local PC’s UDP port 14541 and another PC’s (192.168.111.222) UDP port 14542.
# test.conf
[UartEndpoint UAVTelemetry] # Connection string for FC
Device = /dev/ttyUSB0
Baud = 921600
[UdpEndpoint localDesktop] # Routing Endpoint #1
Mode = Normal
Address = 127.0.0.1
Port = 14541
[UdpEndpoint remotePC] # Routing Endpoint #2
Mode = Normal
Address = 192.168.111.222
Port = 14542Running with Config File:
cd ~/mavlink-router
mavlink-routerd -c test.confCLI Parameters
For a full list of command-line options, refer to the output of mavlink-routerd --help. Key points include:
- The TCP server is enabled by default.
- TCP and UDP endpoints can be added multiple times.
- UDP endpoints added with the
-eoption start innormalmode (sending data to the specified address and port). - The last parameter (without an option key) can be a UART device or a UDP connection. This UDP endpoint will start in
servermode (waiting for incoming connections).
Example command to route MAVLink packets from ttyS1 UART to two other UDP endpoints:
$ mavlink-routerd -e 192.168.7.1:14550 -e 127.0.0.1:14550 /dev/ttyS1:1500000Note: 1500000 after the colon sets the UART baudrate for /dev/ttyS1.
Routing packets from an incoming UDP connection instead of UART is also possible:
$ mavlink-routerd -e 192.168.7.1:14550 -e 127.0.0.1:14550 0.0.0.0:24550Note: By default, MAVLink Router listens on port 5760 for TCP connections. Any client connected to that port can send and receive MAVLink data.
Logging
Flight Stack Logging MAVLink Router can collect flight stack logs from both PX4 and ArduPilot. To enable logging, set the directory in the Log key within the [General] section of the config file (or use the corresponding argument). The MAVLink dialect is auto-detected by default but can be explicitly set using the MavlinkDialect key.
[General]
Log=/var/log/flight-stack
MavlinkDialect=ardupilotmegaTelemetry Logging Similar to flight stack logging, you can write raw telemetry data to .tlog files using the LogTelemetry key in the [General] section (or the -T argument). This only works if a path for flight stack logging is already configured.
For more detailed information, please refer to the official MAVLink Router GitHub page: https://github.com/mavlink-router/mavlink-router

Author: maponarooo, Pixhawk Drone Mania.
Date: February 7, 2026
