Skip to content

[oscillatord] fix set_rtcm_output to avoid receiver restart - #149

Merged
nbourdau merged 1 commit into
Orolia2s:mainfrom
leoleovich:main
May 19, 2026
Merged

nbourdau merged 1 commit into
Orolia2s:mainfrom
leoleovich:main

Conversation

@leoleovich

Copy link
Copy Markdown
Contributor

Fix GNSS receiver reset on every restart when RTCM is enabled

When gnss-rtcm-enabled=true, gnss_set_rtcm_config() persists RTCM message rates to Flash. On next startup, check_gnss_config_in_ram() compares the receiver's current state against the base config which expects RTCM rates = 0. This mismatch triggers a full 571-key reconfiguration + hardware reset every time, causing ~25 minutes of GPS fix loss.

Fix: patch the reference config array to include RTCM rates = 1 before comparison when RTCM is enabled, following the same pattern used by set_cable_delay() and set_preferred_time_scale().

Before

INFO  Using custom value for "gnss-cable-delay": 672
DEBUG Config (CFG-MSGOUT-RTCM_3X_TYPE1005_UART1 (0x209102be, U1) = 0) differs from current config (CFG-MSGOUT-RTCM_3X_TYPE1005_UART1 (0x209102be, U1) = 1)
DEBUG Config (CFG-MSGOUT-RTCM_3X_TYPE1077_UART1 (0x209102cd, U1) = 0) differs from current config (CFG-MSGOUT-RTCM_3X_TYPE1077_UART1 (0x209102cd, U1) = 1)
DEBUG Config (CFG-MSGOUT-RTCM_3X_TYPE1087_UART1 (0x209102d2, U1) = 0) differs from current config (CFG-MSGOUT-RTCM_3X_TYPE1087_UART1 (0x209102d2, U1) = 1)
DEBUG Config (CFG-MSGOUT-RTCM_3X_TYPE1097_UART1 (0x20910319, U1) = 0) differs from current config (CFG-MSGOUT-RTCM_3X_TYPE1097_UART1 (0x20910319, U1) = 1)
DEBUG Config (CFG-MSGOUT-RTCM_3X_TYPE1127_UART1 (0x209102d7, U1) = 0) differs from current config (CFG-MSGOUT-RTCM_3X_TYPE1127_UART1 (0x209102d7, U1) = 1)
DEBUG Config (CFG-MSGOUT-RTCM_3X_TYPE1230_UART1 (0x20910304, U1) = 0) differs from current config (CFG-MSGOUT-RTCM_3X_TYPE1230_UART1 (0x20910304, U1) = 1)
INFO  Receiver not configured to desired configuration, starting reconfiguration
INFO  Configuring receiver with ART parameters...
      rx0: Sending 571 key-value pairs in 10 UBX-CFG-VALSET messages
      ...
INFO  Successfully reconfigured GNSS receiver
DEBUG Performing hardware reset
      rx0: Doing receiver reset: Hardware reset
      <GPS fix lost, ~25min recovery>

After

INFO  Using custom value for "gnss-cable-delay": 672
INFO  RTCM output enabled in base configuration for comparison
INFO  Receiver already configured to desired configuration
      rx0: Sending UBX-CFG-VALSET 1/1 (7 items: 1..7/7, 47 bytes, RAM,BBR,Flash, no transaction)
INFO  RTCM3 output enabled on UART1 (6 messages configured)
INFO  RTCM socket listening at /run/oscillatord/rtcm.sock
      <GPS retains fix, 32 satellites, no recovery needed>

@ESoapW

ESoapW commented May 15, 2026

Copy link
Copy Markdown
Contributor

CI failure here is unrelated to this PR. ubloxcfg_gen.pl needs Path::Tiny (and Data::Float) which aren't on ubuntu-latest. Whether the perl runs at all depends on cmake's timestamp check on the committed generated files, so it's flaky, #148 got lucky, this one didn't.
Fix: add below before cmake in build-oscillatord.yaml:

- name: Install perl modules for ubloxcfg code-gen
  run: sudo apt-get update && sudo apt-get install -y libpath-tiny-perl libdata-float-perl

@nbourdau
nbourdau merged commit d7a6653 into Orolia2s:main May 19, 2026
1 check failed
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.

3 participants