Many serial (UART) ports on a Pixhawk board can be fully configured via parameters: e.g.:
- 在其他端口上运行 MAVLink ，或更改流消息
- 设置双 GPS
- 启用在串口上运行的传感器，例如某些 距离传感器 。
Some ports cannot be configured because they are used for a very specific purpose like RC input or the system console (
The following functions are typically mapped to the same specific serial ports on all boards, and are hence mapped by default:
- MAVLink 被映射到
Telem 1端口，端口的波特率为 57600 (对于遥测模块)。
- GPS 1 (gps driver) is mapped to the
GPS 1port with a baudrate Auto (with this setting a GPS will automatically detect the baudrate - except for the Trimble MB-Two, which requires 115200 baudrate).
All other ports have no assigned functions by default (are disabled).
The ports mappings above can be disabled by setting MAV_0_CONFIG and GPS_1_CONFIG to Disabled, respectively.
All the serial drivers/ports are configured in the same way:
- Set the configuration parameter for the service/peripheral to the port it will use.
Configuration parameter names follow the pattern
*_CFG (QGroundControl only displays the parameters for services/drivers that are present in firmware). At time of writing the current set is: GPS_1_CONFIG, GPS_2_CONFIG, ISBD_CONFIG, MAV_0_CONFIG, MAV_1_CONFIG, MAV_2_CONFIG, RTPS_CONFIG, RTPS_MAV_CONFIG, TEL_FRSKY_CONFIG, TEL_HOTT_CONFIG, SENS_LEDDAR1_CFG, SENS_SF0X_CFG, SENS_TFMINI_CFG, SENS_ULAND_CFG.
Reboot the vehicle in order to make the additional configuration parameters visible.
配置特定于模块的参数 (如 MAVLink 流和数据速率配置)。
The GPS/Compass > Secondary GPS section provides a practical example of how to configure a port in QGroundControl (it shows how to use
GPS_2_CONFIG to run a secondary GPS on the
TELEM 2 port).
Port conflicts are handled by system startup, which ensures that at most one service is run on a specific port.
At time of writing there is no user feedback about conflicting ports.
# QGroundControl 中缺少的配置参数
QGroundControl only displays the parameters for services/drivers that are present in firmware. If a parameter is missing, then you may need to add it in firmware.
PX4 firmware includes most drivers by default on [Pixhawk-series](../flight_controller/pixhawk_series.md) boards. Flash-limited boards may comment out/omit the driver (at time of writing this only affects boards based on FMUv2).
You can include the missing driver in firmware by uncommenting (or adding) the driver in the default.cmake config file that corresponds to the board (opens new window) you want to build for. For example, to enable the sf0x driver, you would remove the
# at the beginning of the line below.
You will then need to build the firmware for your platform, as described in Building PX4 Software.