Skip to content

gnss: auto-detect L5 receiver with separate config arrays - #153

Merged
nbourdau merged 4 commits into
Orolia2s:mainfrom
leoleovich:feat/l5-signal-detection
Jun 17, 2026
Merged

nbourdau merged 4 commits into
Orolia2s:mainfrom
leoleovich:feat/l5-signal-detection

Conversation

@leoleovich

@leoleovich leoleovich commented Jun 15, 2026 •

Copy link
Copy Markdown
Contributor

The F9T-10B supports L1+L5 but not L2. At startup, probe the receiver's RAM for CFG-SIGNAL-GPS_L5_ENA to detect the receiver model:

  • F9T-00B (standard): uses default_configuration_v220 (L1+L2 signals)
  • F9T-10B (L5): uses default_configuration_f9t_10b (L1+L5 signals)

The correct config array is selected before comparison, so an already- configured receiver won't trigger unnecessary hardware resets.

Also adds:

  • Per-band satellite monitoring via UBX-RXM-RAWX (always enabled)
  • L1/L2/L5 signal counts in per-second log output
  • Proper maxKv sizing for rxGetConfig (must be >= batch + 64)
  • RTCM base station output with raw observations and ephemeris

L1/L5 receiver:

Jun 15 08:19:12 time12 oscillatord[81921]: 08:19:12 INFO  L5 receiver detected (F9T-10B), using L5 signal config
...
Jun 15 08:22:41 time12 oscillatord[82177]: 08:22:41 DEBUG GNSS data: Fix time (3), Fix ok: True, satellites num 29, signals L1=40 L2=0 L5=26, survey in error: 0.70, antenna status: 4, valid 1, time 1781526161, leapm_seconds 18, leap_notify 0, lsChange 0, timeToLsChange 11360240, lsSet: True, QErr(n) -3077, qErr(n-1) 3730, pos_accuracy 0 m, time_accuracy 21 ns

L1/L2 receiver (L1 antenna):

Jun 16 05:40:53 time11 oscillatord[283304]: 05:40:53 DEBUG GNSS data: Fix time (3), Fix ok: True, satellites num 32, signals L1=41 L2=0 L5=0, survey in error: 4.52, antenna status: 4, valid 1, time 1781602853, leapm_seconds 18, leap_notify 0, lsChange 0, timeToLsChange 11283547, lsSet: True, QErr(n) -824, qErr(n-1) 3517, pos_accuracy 4 m, time_accuracy 23 ns

@leoleovich
leoleovich force-pushed the feat/l5-signal-detection branch 4 times, most recently from 97fb191 to 5aea3d2 Compare June 15, 2026 12:22
@leoleovich

Copy link
Copy Markdown
Contributor Author

@nbourdau please take a look

@nbourdau nbourdau left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you split up this commit into smaller and more atomic commits?
Being a big one merging several changes make it hard to review properly and quickly. Having the changes split gives the occasion in the commit message of each to explain at least why each one is needed and make clear by looking at each one what code change is relevant for which semantic change.

A natural split is hinted in your current commit message (the "also adds" list + auto-detect L5), but another split could be chosen.

@leoleovich
leoleovich force-pushed the feat/l5-signal-detection branch from 5aea3d2 to c05cd90 Compare June 16, 2026 08:53
@leoleovich

Copy link
Copy Markdown
Contributor Author

@nbourdau done, split in 5 different commits, but kept 1 pull request

@leoleovich
leoleovich requested a review from nbourdau June 16, 2026 09:10

@nbourdau nbourdau left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please ensure that all commits compile

Comment thread common/gnss-config.c
Comment on lines 107 to 141
@@ -90,18 +120,24 @@ UBLOXCFG_KEYVAL_t *get_default_value_from_config(int *nKv, int major, int minor)
char current_line[128] = {};

{
size_t config_length = default_configuration_size;

// If version >= to 2.20 apply 2.20 ubx config
if ((major == 2 && minor >= 20) || (major >= 3))
/* Select config array based on firmware version and band mask */
const char (*cfg_array)[128];
size_t config_length;

if (bands & GNSS_BAND_L5) {
cfg_array = default_configuration_f9t_10b;
config_length = default_configuration_f9t_10b_size;
} else if ((major == 2 && minor >= 20) || (major >= 3)) {
cfg_array = default_configuration_v220;
config_length = default_configuration_v220_size;
} else {
cfg_array = default_configuration;
config_length = default_configuration_size;
}

for (size_t i = 0; i < config_length; i++)
{
if ((major == 2 && minor >= 20) || (major >= 3))
strncpy(current_line, default_configuration_v220[i], 127);
else
strncpy(current_line, default_configuration[i], 127);
strncpy(current_line, cfg_array[i], 127);
IO_LINE_t line = { .line = current_line };

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes the commit not to compile, this part must be introduced later (with "gnss-config: add band mask parameter to config selection" commit)

Comment thread common/gnss-config.c
Comment on lines +127 to +129
if (bands & GNSS_BAND_L5) {
cfg_array = default_configuration_f9t_10b;
config_length = default_configuration_f9t_10b_size;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This must be introduced no before "f9_defvalsets: add F9T-10B (L1+L5) config array" commit

Comment thread common/gnss-config.h

bool check_gnss_config_in_ram(RX_t *rx, UBLOXCFG_KEYVAL_t *allKvCfg, int nAllKvCfg);
UBLOXCFG_KEYVAL_t *get_default_value_from_config(int *nKv, int major, int minor);
UBLOXCFG_KEYVAL_t *get_default_value_from_config(int *nKv, int major, int minor, int bands);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing src/gnss.c update for use of get_default_value_from_config

rxGetConfig() internally checks if there's room for another 64-item
batch after receiving data: (totNumKv + 64) > maxKv. This means maxKv
must always be at least received_items + 64, otherwise the call fails
with "Too many config items". Fix by using a 128-element result buffer
for batch reads of 64 keys at a time.

Also simplify check_gnss_config_in_ram() to read only the keys we
need (from the config array) rather than using the ALL wildcard which
can overflow on receivers with many config items.
The ZED-F9T-10B supports L1+L5 signals instead of L1+L2. Add a
dedicated config array (default_configuration_f9t_10b) with the
correct L5 signal keys:

  GPS_L5_ENA, GAL_E5A_ENA, QZSS_L5_ENA = true
  BDS_B2_ENA, GLO_L2_ENA = false (no L5 equivalent)
Add GNSS_BAND_L1/L2/L5 flags and pass a band mask to
get_default_value_from_config() so it selects the correct config
array for the detected receiver model.

At startup, probe CFG-SIGNAL-GPS_L5_ENA from receiver RAM. If L5
is enabled, load the F9T-10B config array instead of the standard
L2 config. This ensures an already-configured L5 receiver won't
trigger unnecessary hardware resets on restart.

As fallback, if L5 wasn't detected but the L2 config is rejected
by the receiver, reload with L5 config and retry.
Always enable UBX-RXM-RAWX on UART1 (moved out of RTCM gate) and
parse it every second to count L1/L2/L5 signals. Classification
uses both gnssId and sigId per the u-blox UBX-RXM-RAWX signal
numbering table:

  GPS (0):     sigId 0,1=L1  3,4=L2  6,7=L5
  SBAS (1):    sigId 0=L1  3=L5
  Galileo (2): sigId 0,1=E1(L1)  3,4=E5a(L5)  5,6=E5b(L2)
  BeiDou (3):  sigId 0,1=B1I(L1)  2,3=B2I(L2)  5,6=B1C(L1)  7=B2a(L5)
  QZSS (5):    sigId 0,1=L1  4,5=L2  8,9=L5
  GLONASS (6): sigId 0=L1OF  2=L2OF

Signal counts are included in the per-second log line:
  signals L1=N L2=N L5=N
@leoleovich
leoleovich force-pushed the feat/l5-signal-detection branch from c05cd90 to 6c25739 Compare June 16, 2026 15:56
@leoleovich

Copy link
Copy Markdown
Contributor Author

Thanks for the feedback verified each commit

@leoleovich
leoleovich requested a review from nbourdau June 16, 2026 15:57
@nbourdau
nbourdau merged commit 6f36b9b into Orolia2s:main Jun 17, 2026
1 check passed
@leoleovich

Copy link
Copy Markdown
Contributor Author

Thank you @nbourdau please issue a release when you can we don't have pending updates.
Side node - you probably want to enable automated branch removal on merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants