voxl-mavlink-server
Table of contents
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:
| Field | Default | Description |
|---|---|---|
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_port | 14550 | UDP 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_port | 14550 | UDP port number for the secondary static GCS IP. |
onboard_port_to_autopilot | 14556 | UDP port to send high-rate onboard data to SLPI when running voxl-px4. |
onboard_port_from_autopilot | 14557 | UDP port to receive high-rate onboard data from SLPI. |
gcs_port_to_autopilot | 14558 | UDP port to send normal-rate GCS data to SLPI. |
gcs_port_from_autopilot | 14559 | UDP port to receive normal-rate GCS data from SLPI. |
en_external_uart_ap | false | QRB5165 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_bus | 1 | UART 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_baudrate | 921600 | UART 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_sound | false | Play the ESC chime tone/behavior during the mission delay. |
autopilot_mission_force_restart | 0 | Force mission restart. |
autopilot_mission_notif_dur | 0.1 | Visual notification using motor spin, duration in seconds. |
en_external_ap_timesync | 1 | Enable responding to timesync messages. |
en_external_ap_heartbeat | 1 | Enable automatic sending of heartbeat. |
en_elrs_rc_mux | false | (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_mtu | 512 | Maximum transfer unit for aggregated UDP packets back to the GCS. Set to 0 to disable aggregation. See below. |
gcs_timeout_s | 4.5 | Time without a heartbeat before a GCS is considered disconnected. |
Never set
primary_static_gcs_iporsecondary_static_gcs_ipto localhost, these are meant for external ground control stations. For local MAVSDK and MAVROS communication, set theen_localhost_mavlink_udpflag in voxl-vision-hub’s/etc/modalai/voxl-vision-hub.conffile 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 autopilotmavlink_ap_heartbeat: autopilot heartbeat messagesmavlink_sys_status: sys_status messagesmavlink_gps_raw_int: gps_raw_int messagesmavlink_attitude: attitude messagesmavlink_local_position_ned: local_position_ned messagesimu_mavlink: IMU data from the autopilotpx4_baro: barometer data from the autopilotrc_channels: RC channel datarc_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 GCSmavlink_from_gcs: data coming from the GCSgcs_ip_list: list of IP addresses of connected GCSmission: 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_onboardpipe, 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_muxset, 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_channelsis used when neither over-IP source is fresh. manual_control_activeis 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.
| Function | Zorro Blue | Channel | Button | Linux code | rc_active value (µs) |
|---|---|---|---|---|---|
| Roll | Aileron stick | 1 | X axis | ABS_X | 1000-2000 |
| Pitch | Elevator stick | 2 | Y axis | ABS_Y | 1000-2000 |
| Throttle | Throttle stick | 3 | Z axis | ABS_Z | 1000-2000 |
| Yaw | Rudder stick | 4 | rotX axis | ABS_RX | 1000-2000 |
| ARM | SA | 5 | 0 | 288 | 0 pressed: 2000, otherwise 1000 |
| MODE | SB | 6 | 1, 2 | 289, 290 | 1: 1000, 2: 2000, neither: 1500 |
| LIG (lights) | SC | 7 | 3, 4 | 291, 292 | 3: 1000, 4: 2000, neither: 1500 |
| GP0 (payload GPIO) | SF | 8 | 5 | 293 | 5 pressed: 2000, otherwise 1000 |
| GP1 (payload GPIO) | SD | 9 | 6 | 294 | 6 pressed: 2000, otherwise 1000 |
| RECVRY (recovery) | SE | 10 | 7 | 295 | 7 pressed: 2000, otherwise 1000 |
| Stream select | P1 knob | 11 | 8-13 | 296-301 | 1000, 1200, 1400, 1600, 1800, 2000 |
| Zoom | P2 knob | 12 | 14-19 | 302, 303, 704-707 | 1000, 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 codesvoxl-rc-serverjoystick presets use, andevtestshows 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.