Serial Port Configuration
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.
Some ports can't be reconfigured because they are used for a critical purpose such as the system's serial console. These are:
DEBUG_PORT (internal for debugging)
RC_SERIAL_PORT (internal for IO)
The mapping of specific devices to port names on the flight controller is explained in the Serial Port Mapping section of the Skynode datasheet
Port Configuration Parameters
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:
GPS_2_CONFIG (for most GPS/GNSS systems)
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.
Auterion Mission Control only displays the parameters for services/drivers that are present in the firmware.
How to Configure a Port
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
Set the baud rate parameter for the selected port to the desired value (e.g. SER_GPS1_BAUD)
Configure module-specific parameters (i.e., MAVLink streams and data rate configuration)
How to Set up MAVLink Message Forwarding
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:
SER_TEL1_BAUD: Baudrate for the
TELEM1
Serial PortMAV_0_CONFIG: Set to
TELEM1
to enable MAVLink over itMAV_0_MODE: Defaults to Normal, but you can also change to lower bandwidth modes
MAV_0_FORWARD: 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)
If you want to use TELEM2 for forwarding, set MAV_S_FORWARD
to Enabled.
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
Last updated