diff --git a/src/drivers/gps/gps.cpp b/src/drivers/gps/gps.cpp index f6cc8f8e75..b33e27ac22 100644 --- a/src/drivers/gps/gps.cpp +++ b/src/drivers/gps/gps.cpp @@ -786,6 +786,13 @@ GPS::run() param_get(handle, &gps_ubx_min_elev); } + int32_t gps_ubx_rate = 0; + handle = param_find("GPS_UBX_RATE"); + + if (handle != PARAM_INVALID) { + param_get(handle, &gps_ubx_rate); + } + handle = param_find("GPS_UBX_MODE"); GPSDriverUBX::UBXMode ubx_mode{GPSDriverUBX::UBXMode::Normal}; @@ -945,6 +952,7 @@ GPS::run() .dgnss_timeout = (uint8_t)gps_ubx_dgnss_to, .min_cno = (uint8_t)gps_ubx_min_cno, .min_elev = (int8_t)gps_ubx_min_elev, + .output_rate = (uint8_t)gps_ubx_rate, .heading_offset = heading_offset, .uart2_baudrate = f9p_uart2_baudrate, .ppk_output = ppk_output > 0, diff --git a/src/drivers/gps/params.c b/src/drivers/gps/params.c index dd37f58486..4eb8142128 100644 --- a/src/drivers/gps/params.c +++ b/src/drivers/gps/params.c @@ -114,6 +114,25 @@ PARAM_DEFINE_INT32(GPS_UBX_MIN_CNO, 0); */ PARAM_DEFINE_INT32(GPS_UBX_MIN_ELEV, 0); +/** + * u-blox GPS output rate + * + * Configure the output rate of u-blox GPS receivers (protocol v27+). + * When set to 0, automatic rate selection is used based on the receiver model. + * Default rates: M9N=8Hz, F9P L1L2=5Hz, F9P L1L5=5Hz, Others=10Hz. + * + * Note: Higher rates reduce satellite count (e.g., >8Hz limits to 16 SVs on M9N). + * Max rates vary by model and RTK mode: F9P L1L2=5-7Hz, F9P L1L5=7-8Hz, X20=25Hz. + * High rates at 115200 baud may cause dropouts. + * + * @min 0 + * @max 25 + * @unit Hz + * @reboot_required true + * @group GPS + */ +PARAM_DEFINE_INT32(GPS_UBX_RATE, 0); + /** * Enable sat info (if available) *