Skip to content

Pass TELEM_RAK12500_ADDRESS to the RAK12500 I2C probe - #7

Closed
ptr727 wants to merge 1 commit into
devfrom
fix/rak12500-i2c-address
Closed

ptr727 wants to merge 1 commit into
devfrom
fix/rak12500-i2c-address

Conversation

@ptr727

@ptr727 ptr727 commented Sep 17, 2026

Copy link
Copy Markdown
Owner

The bug

src/helpers/sensors/EnvironmentSensorManager.cpp defines the RAK12500's I2C address inside an
#ifndef, which is the file's convention for "a variant may override this":

#ifndef TELEM_RAK12500_ADDRESS
#define TELEM_RAK12500_ADDRESS   0x42     //RAK12500 Ublox GPS via i2c
#endif

The probe then never passes it:

if (ublox_GNSS.begin(Wire) == true){

SFE_UBLOX_GNSS::begin is declared
bool begin(TwoWire &wirePort = Wire, uint8_t deviceAddress = 0x42, ...), so the address actually
probed is the library's own default, not the macro.

grep -rn TELEM_RAK12500_ADDRESS src/ variants/ platformio.ini examples/ returns only the two
lines of the definition itself. It is the one TELEM_*_ADDRESS in this file that nothing consumes
— every other one reaches its probe through the sensor table (TELEM_AHTX_ADDRESS,
TELEM_BME280_ADDRESS, TELEM_SHT4X_ADDRESS, …) or a driver constructor (TELEM_INA219_ADDRESS,
TELEM_INA226_ADDRESS).

Why it is latent, and why it is still worth fixing

No variant in the tree overrides the macro, and the library's default is also 0x42, so nothing
diverges today. The defect is that the knob exists and does nothing: a variant that overrode it —
which the #ifndef invites — would silently probe one address while every other reference to the
macro named another, and the symptom would be a GPS that is simply not detected.

The fix

if (ublox_GNSS.begin(Wire, TELEM_RAK12500_ADDRESS) == true){

This is the only ublox_GNSS.begin call site in the tree.

Verification

  • Signature confirmed against the pinned library
    (SparkFun_u-blox_GNSS_Arduino_Library.h:715), not assumed.
  • RAK_4631_repeater builds. The RAK_WISBLOCK_GPS block is compiled into that env
    (ENV_INCLUDE_GPS && RAK_BOARD && !RAK_WISMESH_TAG), confirmed by the ublox_GNSS symbol and
    the SparkFun translation unit in the resulting ELF, so the changed line is actually built.
  • Not verified on hardware. The RAK4631 available here carries a CASIC receiver on the UART
    rather than a u-blox on I2C, so it takes the serial fallback and never reaches this line. A
    board with an actual RAK12500 would be needed to exercise it, and since the address is unchanged
    in-tree the observable behaviour would be identical either way.

Notes

This is a detection change rather than a reporting one, which is why it was kept out of the
hwinfo PR (#5) when CodeRabbit raised it there. Independent of that branch and of #6.

Not upstream yet — this is the fork bake.

Summary by CodeRabbit

  • Bug Fixes
    • Improved RAK12500 GNSS initialization by using the configured I2C address, helping ensure reliable device communication.

`TELEM_RAK12500_ADDRESS` is defined inside an `#ifndef`, so a variant can override it, but
`ublox_GNSS.begin(Wire)` never receives it and the SparkFun library falls back to its own
default. The macro is the only `TELEM_*_ADDRESS` in this file that nothing consumes; every
other one reaches its probe through the sensor table or a driver constructor.

No variant overrides it today and the library default is also 0x42, so this changes no
behaviour in the tree as it stands. It makes the knob mean what it says.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 17, 2026 02:06
@coderabbitai

coderabbitai Bot commented Sep 17, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

Warning

Review limit reached

Next included review available in 40 seconds.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: d07ce092-0b7d-4713-91ba-ad0763fdc85a

📥 Commits

Reviewing files that changed from the base of the PR and between 0ec5ed5 and 89e7397.

📒 Files selected for processing (1)
  • src/helpers/sensors/EnvironmentSensorManager.cpp

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 5ea0d177-9f90-40b9-bf0f-a2fa433bc9db

📥 Commits

Reviewing files that changed from the base of the PR and between 0ec5ed5 and 89e7397.

📒 Files selected for processing (1)
  • src/helpers/sensors/EnvironmentSensorManager.cpp

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The RAK12500 GNSS initialization now passes TELEM_RAK12500_ADDRESS explicitly to ublox_GNSS.begin while using Wire.

Changes

GNSS initialization

Layer / File(s) Summary
Configured GNSS address
src/helpers/sensors/EnvironmentSensorManager.cpp
The initialization call now uses TELEM_RAK12500_ADDRESS instead of the library default address.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~2 minutes

Change: Bug fix

Suggested reviewers: agessaman

Merge Risk: ⚪ Minimal · up to 89e73

The configured GNSS address call is compatible with the library API and introduces no established merge-blocking risk.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: passing TELEM_RAK12500_ADDRESS to the RAK12500 I2C probe.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/rak12500-i2c-address

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The change is minimal, directly addresses the stated defect, and has no apparent side effects beyond honoring the existing address override knob.

Pull request overview

This PR fixes a latent configuration bug in the RAK12500 GNSS I2C probe by ensuring the code actually uses the variant-overridable TELEM_RAK12500_ADDRESS macro when calling the SparkFun u-blox library’s begin() method.

Changes:

  • Pass TELEM_RAK12500_ADDRESS into ublox_GNSS.begin(...) so the probe honors the configurable I2C address.
File summaries
File Description
src/helpers/sensors/EnvironmentSensorManager.cpp Uses the TELEM_RAK12500_ADDRESS macro in the RAK12500 I2C initialization call so variant overrides are effective.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@ptr727

ptr727 commented Sep 17, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 17, 2026

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@ptr727

ptr727 commented Sep 17, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 17, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@ptr727

ptr727 commented Sep 17, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Sep 17, 2026

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.


Your included review limit is currently reached under our Fair Usage Limits Policy. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 29 minutes.

@ptr727

ptr727 commented Sep 17, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Sep 17, 2026

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.


Your included review limit is currently reached under our Fair Usage Limits Policy. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 44 seconds.

@ptr727

ptr727 commented Sep 17, 2026

Copy link
Copy Markdown
Owner Author

Review coverage on this PR: Copilot only. CodeRabbit never reviewed it. Recording this rather than leaving the PR looking green by omission.

Four attempts, none of which produced a review object, a walkthrough, or a single comment:

time (UTC) command outcome
02:08 review Review rate limited
03:35 review Action performed — Review finished in 5 seconds, no output of any kind
04:06 full review Review rate limited
04:35 full review posted Full review triggered, then edited 6 s later to Review rate limited

Two things worth knowing for anyone reading this later:

  1. The 03:35 run consumed the hourly included review while producing nothing. CodeRabbit's own note says it "does not re-review already reviewed commits" — and this PR's first CodeRabbit comment was an automatic skip notice ("fewer than 10 stars"), which appears to have marked the commit as seen without ever reading it. So a plain review was a no-op that still spent the budget.
  2. The 04:35 reply was edited in place, from success to rate-limited, 6 seconds after posting. Polling the comment body once can therefore read a success that is retracted moments later. created_at != updated_at is the tell.

Not chasing it further: the diff here is one argument added to one call, and further retries would spend hourly windows that #6 has better use for. Copilot reviewed it on head 89e73970, full coverage, approval recommended, zero comments.

Flagging it so the coverage gap is a decision rather than an oversight.

@ptr727

ptr727 commented Sep 17, 2026

Copy link
Copy Markdown
Owner Author

Closed by a branch rename, not by a decision. fix/rak12500-i2c-address became work/rak12500-i2c-address so the name fix/* is free for the squashed branch that goes upstream; GitHub closed this PR on the rename rather than following the branch. The work continues unchanged at #9 on the same head 89e73970.

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