Serial Port Configuration
Last updated
Last updated
APX4 provides predefined functions for many flight controller serial ports, allowing for simple plug-and-play operation. For example, you can connect a GPS module to the GPS1 port or a telemetry module to TELEM1, and they will generally work without additional setup.
However, these port functions are fully configurable through parameters.
The configuration makes it easy to (for example):
Assign any unused port to a specific function
Reassign ports to accommodate different hardware
With this flexible configuration, you can:
Run MAVLink on a different port, modify the streamed messages, or configure a TELEM port to use ROS 2/XRCE-DDS
Adjust the baud rate of any port or configure the UDP port settings
Set up dual GPS modules for redundancy or improved accuracy
Enable additional sensors that communicate via serial ports
This versatility allows you to customize the flight controller's communication setup to meet the needs of your specific application.
The serial port configuration parameters allow you to assign a specific function or support for particular hardware to a specific port. Depending on which device you connect (not only depending on the device type/category), you will need to change a different set of parameters. These parameters follow the naming pattern *_CONFIG
or *_CFG.
Examples include:
Generic GPS Module:
Septentrio GNSS Module
MAVLink Peripheral Ports:
RC Port:
FrSky Telemetry:
Optical flow and distance sensors:
Some functions/features may define additional configuration parameters, which will follow a similar naming pattern to the port configuration prefix. For example, MAV_0_CONFIG
enables MAVLink on a particular port, but you may also need to set MAV_0_FLOW_CTRL
, MAV_0_FORWARD
, MAV_0_MODE
and so on.
To configure a port follow the steps below:
Set the configuration parameter for the service/peripheral to the port it will use
Reboot the vehicle to make the additional configuration parameters visible
Configure module-specific parameters (i.e., MAVLink streams and data rate configuration)
If you want to forward sensor data from the FMU to the Mission Computer, you can set up MAVLink message forwarding.
Set the following parameters as described:
Reboot Skynode and run the following command in the MAVLink console to check if the forwarding works: mavlink status.
The output of this command shows the MAVLink instances that are enabled on this system.
If your setup was successful, you'll see at least the two following MAVLink instances:
/dev/ttyS4: connection between the FMU and Mission Computer (enabled by default and cannot be modified)
/dev/ttyS6: connection going to the TELEM1 port on the FMU
(for most GPS/GNSS systems)
Set the baud rate parameter for the selected port to the desired value (e.g. )
: Baudrate for the TELEM1
Serial Port
: Set to TELEM1
to enable MAVLink over it
: Defaults to Normal, but you can also
: Set to 1 (Enabled) to make sure the MAVLink traffic on this port is forwarded to other MAVLink instances (for example the Mission Computer UART)