# MAVLink

[MAVLink](https://mavlink.io/en/) is a communication protocol supported on a variety of UAV systems. The Micro VPS uses MAVLink for two-way communication with the flight controller. This allows us to send MAVLink packets over the same serial link that receives important information from the flight controller. By using MAVLink, we only need one serial connection between the flight controller and the Micro VPS.

Below is a list of the messages we use. If your flight controller does *not* support these message types, or only allows for one-way communication over MAVLink, contact the Theseus team for help integrating on your system. /

## Messages Sent

We send a number of packets aside from just the GPS Input packets.

* [STATUSTEXT (253)](https://mavlink.io/en/messages/common.html#STATUSTEXT)
* [MAV\_CMD\_USER\_2 (31011)](https://mavlink.io/en/messages/common.html#MAV_CMD_USER_2)
  * crosstrack start command
* [GPS\_INPUT (232)](https://mavlink.io/en/messages/common.html#GPS_INPUT)
* [SYSTEM\_TIME (2)](https://mavlink.io/en/messages/common.html#SYSTEM_TIME)
* [TIMESYNC (111)](https://mavlink.io/en/messages/common.html#TIMESYNC)
* [MAV\_CMD\_SET\_MESSAGE\_INTERVAL (511)](https://mavlink.io/en/messages/common.html#MAV_CMD_SET_MESSAGE_INTERVAL)

## Messages Received

* [LOCAL\_POSITION\_NED (32)](https://mavlink.io/en/messages/common.html#LOCAL_POSITION_NED)
* [ATTITUDE\_QUATERNION (31)](https://mavlink.io/en/messages/common.html#ATTITUDE_QUATERNION)
* [GPS\_RAW\_INT (24)](https://mavlink.io/en/messages/common.html#GPS_RAW_INT)
* [NAV\_CONTROLLER\_OUTPUT (62)](https://mavlink.io/en/messages/common.html#NAV_CONTROLLER_OUTPUT)
* [VFR\_HUD (74)](https://mavlink.io/en/messages/common.html#VFR_HUD)
* [SYSTEM\_TIME (2)](https://mavlink.io/en/messages/common.html#SYSTEM_TIME)
* [TIMESYNC (111)](https://mavlink.io/en/messages/common.html#TIMESYNC)
* [EXTENDED\_SYS\_STATE (245)](https://mavlink.io/en/messages/common.html#EXTENDED_SYS_STATE)

## System ID (sysid)

If you want to connect to multiple systems over MAVLink, you'll need to use different sysids for each flight controller. The default sysid is 1 so the Micro VPS automatically looks to connect with sysid 1. If the flight controller has a different sysid than the default, the Micro VPS will report no MAV heartbeat.

To configure your Micro VPS to connect with a flight controller with some other sysid, you'll need to edit the vehicle config. Take a look at [Vehicle Configuration](/gcs-software/legacy-software/theseus-gcs-app/feature-list/vehicle-configuration.md#changing-the-sysid) for more information.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.theseus.us/micro-vps/autopilot-integration/mavlink.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
