Skip to content Link Search Menu Expand Document
ModalAI DOCS
Store

voxl-mavlink-server

Table of contents

  1. Overview
  2. Configuration
    1. udp_mtu
  3. Pipes
    1. rc_active source selection
    2. MANUAL_CONTROL channel mapping

Overview

voxl-mavlink-server manages MAVLink routing between network interfaces, MPA applications, and the flight controller such as PX4.

Configuration

voxl-mavlink-server reads its configuration from /etc/modalai/voxl-mavlink-server.conf. The available fields and their defaults (as of v1.4.20) are:

FieldDefaultDescription
primary_static_gcs_ip"192.168.8.10"Static GCS IP that voxl-mavlink-server automatically tries to connect to. 192.168.8.10 is the first IP that VOXL DHCP serves when connecting in WiFi SoftAP mode. Set to empty or NULL to let the GCS initialize the connection instead.
primary_static_gcs_ip_port14550UDP port number for the primary static GCS IP.
secondary_static_gcs_ip"192.168.8.11"Second static GCS IP to automatically try to connect to.
secondary_static_gcs_ip_port14550UDP port number for the secondary static GCS IP.
onboard_port_to_autopilot14556UDP port to send high-rate onboard data to SLPI when running voxl-px4.
onboard_port_from_autopilot14557UDP port to receive high-rate onboard data from SLPI.
gcs_port_to_autopilot14558UDP port to send normal-rate GCS data to SLPI.
gcs_port_from_autopilot14559UDP port to receive normal-rate GCS data from SLPI.
en_external_uart_apfalseQRB5165 only. Set to true to enable UART communication to an external flight controller, otherwise a UDP interface is started to talk to voxl-px4 on localhost.
autopilot_uart_bus1UART bus for the external autopilot. Bus 1 goes through the legacy B2B connector (exposed by the M0125 and M0141 accessory boards); bus 12 goes through the ESC port (J18).
autopilot_uart_baudrate921600UART baudrate for the external autopilot.
autopilot_mission_delay_start-1-1 is off; a value >0 delays mission start by that many seconds.
autopilot_mission_delay_soundfalsePlay the ESC chime tone/behavior during the mission delay.
autopilot_mission_force_restart0Force mission restart.
autopilot_mission_notif_dur0.1Visual notification using motor spin, duration in seconds.
en_external_ap_timesync1Enable responding to timesync messages.
en_external_ap_heartbeat1Enable automatic sending of heartbeat.
en_elrs_rc_muxfalse(v1.4.18 and newer) RC-source mux for the rc_active pipe with ELRS failsafe awareness. When set, a live ELRS link takes priority over RC arriving over IP.
udp_mtu512Maximum transfer unit for aggregated UDP packets back to the GCS. Set to 0 to disable aggregation. See below.
gcs_timeout_s4.5Time without a heartbeat before a GCS is considered disconnected.

Never set primary_static_gcs_ip or secondary_static_gcs_ip to localhost, these are meant for external ground control stations. For local MAVSDK and MAVROS communication, set the en_localhost_mavlink_udp flag in voxl-vision-hub’s /etc/modalai/voxl-vision-hub.conf file instead.

udp_mtu

For radios, such as Doodle Labs, that utilize larger packet sizes with increased latency, voxl-mavlink-server can bundle mavlink messages headed to the GCS into larger UDP packets. Since v1.4.14 this aggregation is on by default with a udp_mtu of 512 bytes. Set udp_mtu to 0 to disable aggregation and send one UDP packet per message. The config file contains the following description of the field:

 * udp_mtu - maximum transfer unit for UDP packets back to GCS. voxl-mavlink-server
 *           will bundle up backets for the GCS into a single UDP packet with 
 *           a maxium size of this. This saves network traffic drastically.
 *           Set to 0 to disable this feature and send one UDP packet per msg.

Try a few different values such as 100, 200, 300 etc to find an optimal value for your setup.

Pipes

voxl-mavlink-server publishes the following 14 pipes into MPA.

Data from the high-rate onboard stream:

  • mavlink_onboard: full high-rate ‘onboard mode’ mavlink stream from the autopilot
  • mavlink_ap_heartbeat: autopilot heartbeat messages
  • mavlink_sys_status: sys_status messages
  • mavlink_gps_raw_int: gps_raw_int messages
  • mavlink_attitude: attitude messages
  • mavlink_local_position_ned: local_position_ned messages
  • imu_mavlink: IMU data from the autopilot
  • px4_baro: barometer data from the autopilot
  • rc_channels: RC channel data
  • rc_active: active RC source, muxing rc_channels, manual_control and (v1.4.20 and newer) RC_CHANNELS_OVERRIDE. See rc_active source selection.

GCS-related pipes:

  • mavlink_to_gcs: normal-rate stream from the autopilot to the GCS
  • mavlink_from_gcs: data coming from the GCS
  • gcs_ip_list: list of IP addresses of connected GCS
  • mission: mission data

Up to 16 simultaneous GCS connections can be established over UDP port 14550. See the Mavlink Routing feature guide for the routing paths and how to inspect these pipes with voxl-inspect-mavlink.

rc_active source selection

The rc_active pipe publishes RC from one source at a time:

  • MANUAL_CONTROL from a GCS joystick, and RC_CHANNELS_OVERRIDE from a GCS or from an onboard application writing to the control channel of the mavlink_onboard pipe, are both RC arriving over IP and share one priority tier. RC_CHANNELS_OVERRIDE needs v1.4.20 or newer.
  • RC_CHANNELS_OVERRIDE channels pass through unchanged, up to 18 channels.
  • An over-IP source stays fresh for 5 s after the last MANUAL_CONTROL message and 1 s after the last RC_CHANNELS_OVERRIDE message.
  • Whichever over-IP source is active keeps the pipe while it stays fresh, so two senders never interleave. The other source takes over once the active one goes stale.
  • With en_elrs_rc_mux set, a live ELRS link outranks both over-IP sources. If no source is available the pipe publishes nothing instead of stale failsafe values.
  • Without en_elrs_rc_mux, rc_channels is used when neither over-IP source is fresh.
  • manual_control_active is 1 when the published data is RC over IP (MANUAL_CONTROL or RC_CHANNELS_OVERRIDE).

MANUAL_CONTROL channel mapping

MANUAL_CONTROL carries stick axes and button bits rather than RC channels. voxl-mavlink-server turns them into channels 1-12 on rc_active, so a joystick over IP drives the same channels as the ELRS link. The layout is the one the Zorro Blue produces as a USB joystick, sent by voxl-rc-server or QGroundControl. Channels 11 and 12 need v1.4.23 or newer.

FunctionZorro BlueChannelButtonLinux coderc_active value (µs)
RollAileron stick1X axisABS_X1000-2000
PitchElevator stick2Y axisABS_Y1000-2000
ThrottleThrottle stick3Z axisABS_Z1000-2000
YawRudder stick4rotX axisABS_RX1000-2000
ARMSA502880 pressed: 2000, otherwise 1000
MODESB61, 2289, 2901: 1000, 2: 2000, neither: 1500
LIG (lights)SC73, 4291, 2923: 1000, 4: 2000, neither: 1500
GP0 (payload GPIO)SF852935 pressed: 2000, otherwise 1000
GP1 (payload GPIO)SD962946 pressed: 2000, otherwise 1000
RECVRY (recovery)SE1072957 pressed: 2000, otherwise 1000
Stream selectP1 knob118-13296-3011000, 1200, 1400, 1600, 1800, 2000
ZoomP2 knob1214-19302, 303, 704-7071000, 1200, 1400, 1600, 1800, 2000
  • Button numbers are the MANUAL_CONTROL button bits, which match the button numbers in the EdgeTX USB Joystick settings.
  • Linux numbers buttons 0-15 from 288 (BTN_JOYSTICK) and buttons 16 and up from 704 (BTN_TRIGGER_HAPPY1). These are the codes voxl-rc-server joystick presets use, and evtest shows them.
  • The Function column uses the Zorro Blue channel names. What each channel does on the vehicle is set by that vehicle’s own configuration, the same as over ELRS.
  • The Zorro Blue also sends buttons 20-22 (BIND, VRXSCAN, UNBIND, Linux codes 708-710) for voxl-rc-server. They are not RC channels and are not mapped.

To use another EdgeTX radio, open its model’s USB Joystick settings, set Mode to Advanced and Interface mode to Joystick, then set each channel:

  • Channels 1-4: Mode Axis with the axis in the table.
  • Channels 5-12: Mode Btn, Button Mode Companion, the button number from the table (the first one for a range), and Positions 2POS for one button, 3POS for two and 6POS for six.

The mixer decides which switch drives each channel, so any switch can be used. With Interface mode set to Gamepad instead of Joystick, Linux reports buttons 0-15 as 304-319, and voxl-rc-server presets written for 288-303 no longer match.