# MAVLink Forwarding

### Overview

MAVLink forwarding is a feature in Auterion Mission Control that allows you to forward all received MAVLink telemetry data to an external application or service. This enables you to share real-time vehicle telemetry with other ground control stations, logging systems, or analysis tools while Auterion Mission Control maintains the primary connection to your vehicle.

### Use Cases

* **Multiple Ground Control Stations**: Allow other users to monitor your vehicle in real-time using their own Auterion Mission Control instances
* **Data Logging**: Forward telemetry to a dedicated logging server for analysis and archiving
* **Custom Applications**: Stream MAVLink data to custom monitoring dashboards, analytics tools, or mission control centers
* **Development & Testing**: Forward data to development tools for testing and debugging MAVLink-based applications
* **Remote Operations**: Share telemetry with remote team members or supervisors

### How It Works

When MAVLink forwarding is enabled, Auterion Mission Control creates a transmit-only UDP connection that forwards all received MAVLink messages to the specified destination.

The forwarding happens in real-time as messages are received from the vehicle, ensuring minimal latency for downstream applications.

***

### Configuration

#### Prerequisites

* Auterion Mission Control must be in **Advanced Mode** to access MAVLink forwarding settings

#### Enabling MAVLink Forwarding

1. Open **Settings**
2. Select **MAVLink** from the left sidebar
3. Check the box **"Enable MAVLink forwarding"**
4. Enter the destination in the **"Host name"** field

<figure><img src="https://3329189600-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFW1Ge1p1f6WHyiYCb146%2Fuploads%2FkyQEOhRDbZmTFnGMnNZh%2Fimage.png?alt=media&#x26;token=e246e5a7-cc66-41bd-9cd2-f8de4ba51e26" alt=""><figcaption></figcaption></figure>

#### Host Name Format

The host name field accepts the following formats:

* `localhost:14445` - Forward to a local application on port 14445 (default)
* `127.0.0.1:14445` - Same as localhost, using IP address
* `hostname:14445` - Forward to a computer by hostname

{% hint style="info" %}
The format is always `host:port` with a colon separating the hostname/IP and port number.
{% endhint %}

{% hint style="warning" %}
Changing the hostname requires a restart of the application for changes to take effect.
{% endhint %}

***

### Using with MAVLink Router

For scenarios where multiple users need to access the MAVLink data, we recommend using `mavlink-router` as an intermediary. MAVLink Router is a lightweight tool that can receive data from Auterion Mission Control and distribute it to multiple clients simultaneously.

### Setup Instructions

{% stepper %}
{% step %}

#### **Install MAVLink Router**

For detailed instructions on building from source or downloading the prebuilt executable, please refer to the official [MAVLink Router GitHub repository](https://github.com/mavlink-router/mavlink-router).
{% endstep %}

{% step %}

#### **Configure Auterion Mission Control**

1. Enable **Advanced Mode** in AMC
2. Go to **Settings** → **MAVLink**
3. Enable **"Enable MAVLink forwarding"**
4. Set **Host name** to: `localhost:14445`
   {% endstep %}

{% step %}

#### **Run mavlink-routerd**

For simple use, you can start `mavlink-routerd` directly from the command line with the following command:

```bash
mavlink-routerd 127.0.0.1:14445
```

This command:

* `127.0.0.1:14445`: Listens for UDP packets from Auterion Mission Control
* Creates a TCP server on port **5760** for clients (default)

This basic command is suitable for straightforward scenarios where only minimal configuration is needed to collect MAVLink data.
{% endstep %}

{% step %}

#### **Configure Firewall (for remote access)**

If you want remote users to connect, ensure the exposed port is accessible.
{% endstep %}

{% step %}

#### **Connect Remote Clients**

Remote users can now connect to your MAVLink Router:

**In Auterion Mission Control:**

1. Go to **Settings** → **Comm Links**
2. Add a new link with type **TCP**
3. Enter the IP address of the computer where mavlink-router is running, and port **5760**.
   * Example: `192.168.1.100:5760`
4. Connect to the link

<details>

<summary><strong>Finding the IP address</strong></summary>

```bash
ip addr show  # Linux
ipconfig      # Windows
ifconfig      # macOS
```

</details>
{% endstep %}
{% endstepper %}

#### Advanced mavlink-router Configuration

For more advanced scenarios, where multiple clients or more complex routing setups are required, it is advisable to use a configuration file as shown in the example below. This allows precise control over the endpoints and additional features like debug logging.

Create a file `~/mavlink-router.conf`:

```ini
[General]
# Optional: Enable debug logging
#Log=debug

# TCP server that remote clients can connect to
[TcpEndpoint server]
Mode = Server
Address = 0.0.0.0
Port = 5760

# UDP endpoint to receive forwarded data from Auterion Mission Control
[UdpEndpoint amc]
Mode = Server
Address = 127.0.0.1
Port = 14445
```

**Configuration Details:**

* **TcpEndpoint server**: Creates a TCP server on port 5760 that remote clients can connect to
* **Address = 0.0.0.0**: Allows connections from any network interface (local and remote)
* **UdpEndpoint amc**: Listens for UDP packets from AMC on `localhost` port 14445

**Start MAVLink Router**

```bash
mavlink-routerd -c ~/mavlink-router.conf
```

Keep this running in a terminal or set it up as a system service.

***

### Troubleshooting

#### MAVLink Forwarding Option Not Visible

* Ensure **Advanced Mode** is enabled.

#### No Data Received at Destination

1. Verify Auterion Mission Control is receiving data from the vehicle
2. Check that MAVLink forwarding is enabled
3. Verify the host name format is correct (e.g., `localhost:14445`)
4. Check firewall settings on both computers
5. Ensure the destination application is listening on the specified port
6. Test connectivity with `netcat` or `telnet`:

   ```bash
   nc -ul 14445  # Listen on port to verify AMC is sending data
   ```

#### MAVLink Router Not Receiving Data

1. Verify MAVLink Router process is running
2. Check the port matches AMC configuration (default: 14445)
3. Review MAVLink Router logs for errors

#### Remote Clients Cannot Connect

1. Verify your computer's IP address is correct
2. Check firewall rules allow incoming connections on port 5760
3. Ensure MAVLink Router is bound to `0.0.0.0` not `127.0.0.1`

### Security Considerations

* **Local Network**: MAVLink data is transmitted unencrypted. Only use on trusted networks.
* **Internet**: Do not expose MAVLink Router directly to the internet without proper security measures
* **VPN**: For remote access, use VPN or SSH tunneling to secure the connection

***

### Alternative: Direct Forwarding

If you don't want to use MAVLink Router, you can forward directly to another application:

**To forward to a remote AMC instance:**

* Set host name to: `<remote-ip>:14550`
* Note: The remote AMC must have a UDP link configured to listen on that port

{% hint style="info" %}
**Limitation**: Direct forwarding only supports **one** destination. Use MAVLink Router for multiple clients.
{% endhint %}

### See Also

* [MAVLink Router Documentation](https://github.com/mavlink-router/mavlink-router)
* [AMC Link Settings](https://docs.auterion.com/vehicle-operation/ui-breakdown/application-settings#rtk_gps)
