Skip to content

Add RAK WisMesh Pocket V3 variant#10953

Merged
thebentern merged 1 commit into
meshtastic:developfrom
Ethan-chen1234-zy:feature/add_rak_wismesh_pocket
Jul 16, 2026
Merged

Add RAK WisMesh Pocket V3 variant#10953
thebentern merged 1 commit into
meshtastic:developfrom
Ethan-chen1234-zy:feature/add_rak_wismesh_pocket

Conversation

@Ethan-chen1234-zy

@Ethan-chen1234-zy Ethan-chen1234-zy commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add rak_wismesh_pocket build env for RAK WisMesh Pocket V3 (RAK4631 + OLED).
  • Pocket-specific pin/config via WISMESH_POCKET in rak4631/variant.h:
    • PIN_GPS_EN on GPIO 34 (GPS_PWR_EN per schematic)
    • HAS_ETHERNET 0 (no Ethernet)
    • Default ringtone (not RAK4631 custom RTTTL)
  • Env excludes Ethernet/API mesh code (build_src_filter: mesh/eth, mesh/api).
  • MQTT is enabled (Client Proxy MQTT on phones).
  • Reuses low-VDD System OFF + LPCOMP wake behavior from rak4631 via LOW_VDD_SYSTEMOFF_DELAY_MS (infrastructure from Add RAK WisMesh Repeater Mini V2 and HP variants #10918).

Depends on

Files changed

Area Change
rak4631/platformio.ini New [env:rak_wismesh_pocket]
rak4631/variant.h WISMESH_POCKET: PIN_GPS_EN, HAS_ETHERNET, ringtone

Test plan

  • pio run -e rak_wismesh_pocket
  • pio run -e rak4631 — no behavior change on base env
  • Hardware: GPS on/off power (~53 mA / ~23 mA with PIN_GPS_EN)
  • Hardware: basic mesh, OLED, shutdown on battery
  • Low-VDD auto shutdown (battery, no USB) — same as rak4631 mini path
  • User shutdown near LPCOMP threshold (battery) — inherits Add RAK WisMesh Repeater Mini V2 and HP variants #10918 fix

Notes for reviewers

Summary by CodeRabbit

  • New Features

    • Added a new firmware build option for the RAK4631 Pocket variant with Pocket-specific display settings and low-power (safe-VDD/system-off) tuning.
    • Updated Pocket variant hardware behavior, including GPS power control.
  • Bug Fixes

    • Disabled Ethernet support for the Pocket build.
    • Updated Pocket ringtone/default audio behavior so it follows the intended variant-specific configuration.
  • Chores

    • Reduced the Pocket build footprint by excluding networking-related components at build time.

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds a PlatformIO environment for the rak4631 WisMesh Pocket variant with Pocket-specific metadata, build flags, safe-VDD settings, source exclusions, and conditional hardware feature macros.

Changes

WisMesh Pocket Variant Support

Layer / File(s) Summary
New PlatformIO build environment
variants/nrf52840/rak4631/platformio.ini
Adds env:rak_wismesh_pocket with Pocket metadata, WISMESH_POCKET, safe-VDD/system-off settings, and source filters excluding Ethernet and mesh API code.
Conditional variant macros
variants/nrf52840/rak4631/variant.h
Maps PIN_GPS_EN to PIN_3V3_EN for Pocket builds, disables the custom ringtone for Pocket builds, and sets HAS_ETHERNET to 0 for Pocket builds.

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

Suggested reviewers: caveman99

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Title check ✅ Passed The title is concise and accurately summarizes the main change: adding a RAK WisMesh Pocket V3 variant.
Description check ✅ Passed The description covers summary, dependency, files changed, test plan, and reviewer notes, so it is mostly complete.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@thebentern
thebentern requested a review from caveman99 July 9, 2026 10:12
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

⚡ Try this PR in the Web Flasher

Flash this PR in the Web Flasher

firmware commit boards expires

Warning

This is an automated, unreviewed CI test build. Back up your device configuration
before flashing, and only flash devices you are able to recover.

Supported boards built by this PR (29)
Device Board Platform
Crowpanel Adv 3.5 TFT elecrow-adv-35-tft esp32-s3
Heltec HT62 heltec-ht62-esp32c3-sx1262 esp32-c3
Heltec Mesh Node 096 heltec-mesh-node-t096 nrf52840
Heltec Mesh Node T1 heltec-mesh-node-t1 nrf52840
Heltec Mesh Node T114 heltec-mesh-node-t114 nrf52840
Heltec V3 heltec-v3 esp32-s3
Heltec V4 heltec-v4 esp32-s3
Meshnology W10 meshnology_w10 esp32-s3
Raspberry Pi Pico pico rp2040
Raspberry Pi Pico W picow rp2040
RAK WisMesh Pocket V3 rak_wismesh_pocket nrf52840
RAK WisMesh Repeater Mini V2 rak_wismesh_repeater_mini nrf52840
RAK WisMesh Tag rak_wismeshtag nrf52840
RAK WisBlock 11200 rak11200 esp32
RAK WisBlock 11310 rak11310 rp2040
RAK3312 rak3312 esp32-s3
RAK WisBlock 4631 rak4631 nrf52840
Seeed SenseCAP Mesh-Tracker-X1 seeed_mesh_tracker_X1 nrf52840
Seeed Wio Tracker L1 seeed_wio_tracker_L1 nrf52840
Seeed Xiao NRF52840 Kit seeed_xiao_nrf52840_kit nrf52840
Seeed Xiao ESP32-S3 seeed-xiao-s3 esp32-s3
Station G2 station-g2 esp32-s3
Station G3 station-g3 esp32-s3
LILYGO T-Deck t-deck-tft esp32-s3
LILYGO T-Echo t-echo nrf52840
LILYGO T-Echo Plus t-echo-plus nrf52840
LILYGO T-Impulse Plus t-impulse-plus nrf52840
LilyGo T3-C6 tlora-c6 esp32-c6
Seeed SenseCAP T1000-E tracker-t1000-e nrf52840

Build artifacts expire on 2026-08-15. Updated for 8ba91fa.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/platform/nrf52/main-nrf52.cpp (1)

61-63: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Trim comment to guideline max of two lines.

This 3-line comment block exceeds the repo's comment-length guideline.

As per coding guidelines, "Keep code comments minimal: one or two lines მაქsimum, only when the reason is not obvious, and do not restate the next line."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/platform/nrf52/main-nrf52.cpp` around lines 61 - 63, Trim the comment
above the System OFF wake handling in main-nrf52.cpp to fit the two-line
guideline by removing one line and avoiding restating obvious code behavior.
Keep only the essential rationale for the weak noinline wake override in the
relevant block near the LPCOMP wake path, and preserve the symbols/comments tied
to the call site and weak default behavior.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@variants/nrf52840/rak3401_1watt/variant.cpp`:
- Around line 50-85: The `variant_nrf52LoopHook` implementation is using raw
`millis()` subtraction for both the VDD safety polling and the low-VDD delay,
which should be replaced with the `Throttle` helpers per guidelines. Update the
time-based checks around `last_vdd_check_ms`, `POWER_LEVEL_CHECK_INTERVAL_MS`,
`low_vdd_since_ms`, and `LOW_VDD_SYSTEMOFF_DELAY_MS` to use `Throttle::execute`
or `Throttle::isWithinTimespanMs`, keeping the same behavior. Also extract the
duplicated low-VDD loop hook logic shared with
`variants/nrf52840/rak4631/variant.cpp` into a common helper so both variants
call the same implementation and only their small variant-specific behavior
differs.

---

Nitpick comments:
In `@src/platform/nrf52/main-nrf52.cpp`:
- Around line 61-63: Trim the comment above the System OFF wake handling in
main-nrf52.cpp to fit the two-line guideline by removing one line and avoiding
restating obvious code behavior. Keep only the essential rationale for the weak
noinline wake override in the relevant block near the LPCOMP wake path, and
preserve the symbols/comments tied to the call site and weak default behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: b62e0a4c-a4e0-4908-b254-2e2020cef8ff

📥 Commits

Reviewing files that changed from the base of the PR and between faf92f6 and 1b168c8.

📒 Files selected for processing (7)
  • src/platform/nrf52/main-nrf52.cpp
  • variants/nrf52840/rak3401_1watt/platformio.ini
  • variants/nrf52840/rak3401_1watt/variant.cpp
  • variants/nrf52840/rak3401_1watt/variant.h
  • variants/nrf52840/rak4631/platformio.ini
  • variants/nrf52840/rak4631/variant.cpp
  • variants/nrf52840/rak4631/variant.h

Comment thread variants/nrf52840/rak3401_1watt/variant.cpp
@Ethan-chen1234-zy
Ethan-chen1234-zy force-pushed the feature/add_rak_wismesh_pocket branch from 4855ed7 to 91a5f21 Compare July 9, 2026 10:49
@Ethan-chen1234-zy

Copy link
Copy Markdown
Contributor Author

Cleaned up branch history: Pocket-only (1 commit, 2 files), rebased onto latest develop.

The earlier commits came from sharing git history with #10918 — sorry for the noise.
CodeRabbit findings on variant_nrf52LoopHook / Throttle apply to #10918, not this PR.

rak4631/platformio.ini may need a trivial merge with #10918 when both land (both add new env blocks at the same location). Happy to rebase if needed.

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Firmware Size Report

44 targets | vs develop: 21 increased, 1 decreased, net +462,420 (+451.6 KB)

Target Flash vs develop RAM RAM vs develop
picow 1,275,980 📈 +31,100 (+30.4 KB) 152,508 n/a
pico2w 1,250,432 📈 +29,916 (+29.2 KB) 158,988 n/a
rak11310 835,048 📈 +29,624 (+28.9 KB) 86,320 n/a
pico 812,296 📈 +29,608 (+28.9 KB) 85,876 n/a
seeed_xiao_rp2040 810,496 📈 +29,592 (+28.9 KB) 85,868 n/a
Show 39 more target(s)
Target Flash vs develop RAM RAM vs develop
seeed_xiao_rp2350 796,568 📈 +28,632 (+28.0 KB) 92,368 n/a
pico2 798,384 📈 +28,608 (+27.9 KB) 92,376 n/a
t-deck-tft 3,834,544 📈 +23,872 (+23.3 KB) 108,008 n/a
elecrow-adv-35-tft 3,439,408 📈 +22,784 (+22.2 KB) 94,632 n/a
heltec-vision-master-e213-inkhud 2,249,872 📈 +22,512 (+22.0 KB) 92,408 n/a
rak3312 2,292,352 📈 +20,112 (+19.6 KB) 102,040 n/a
seeed-xiao-s3 2,295,648 📈 +19,504 (+19.0 KB) 102,064 n/a
station-g3 2,285,632 📈 +19,280 (+18.8 KB) 101,848 n/a
station-g2 2,285,616 📈 +19,264 (+18.8 KB) 101,848 n/a
heltec-v3 2,283,264 📈 +19,184 (+18.7 KB) 130,232 n/a
rak11200 1,879,776 📈 +19,168 (+18.7 KB) 87,052 n/a
t-eth-elite 2,509,856 📈 +18,368 (+17.9 KB) 103,068 n/a
heltec-ht62-esp32c3-sx1262 2,153,232 📈 +18,240 (+17.8 KB) 112,004 n/a
heltec-v4 2,295,456 📈 +18,160 (+17.7 KB) 101,112 n/a
tlora-c6 2,384,960 📈 +16,656 (+16.3 KB) 102,772 n/a
rak3172 183,012 📉 -3,284 (-3.2 KB) 25,000 n/a
wio-e5 240,148 📈 +1,520 (+1.5 KB) 26,640 n/a
heltec-mesh-node-t096 751,968 110,492 n/a
heltec-mesh-node-t1 749,824 102,236 n/a
heltec-mesh-node-t114 749,752 110,428 n/a
heltec-mesh-solar 746,856 110,596 n/a
heltec-mesh-solar-eink 738,744 109,916 n/a
heltec-mesh-solar-inkhud 717,880 101,372 n/a
heltec-mesh-solar-oled 746,928 110,596 n/a
heltec-mesh-solar-tft 753,224 110,692 n/a
heltec-mesh-tower-v2 737,928 101,452 n/a
meshnology_w10 2,466,000 136,212 n/a
rak4631 767,824 104,500 n/a
rak_wismesh_pocket 739,040 101,560 n/a
rak_wismesh_repeater_mini 767,956 104,516 n/a
rak_wismeshtag 600,256 92,604 n/a
seeed_mesh_tracker_X1 507,328 87,316 n/a
seeed_wio_tracker_L1 741,392 110,340 n/a
seeed_xiao_nrf52840_kit 736,128 102,060 n/a
t-echo 754,960 93,236 n/a
t-echo-inkhud 713,312 83,956 n/a
t-echo-plus 752,656 93,236 n/a
t-impulse-plus 728,432 110,324 n/a
tracker-t1000-e 506,384 87,316 n/a

Size budgets

Env Metric Measured Budget Used
rak4631 RAM (.data+.bss) 104,500 113,000 92.5%
rak4631 flash 767,824 786,000 97.7%

Budgets live in bin/ram_budgets.json and are raised deliberately in the PR that needs the headroom - never automatically.


Updated for 72e65e2

@thebentern

Copy link
Copy Markdown
Contributor

@Ethan-chen1234-zy I think we may want to leave MQTT enabled on the pocket, as many users utilize the client proxy MQTT mode on their phones (pass MQTT through phone). I don't believe this works without including MQTT classes.

@Ethan-chen1234-zy
Ethan-chen1234-zy force-pushed the feature/add_rak_wismesh_pocket branch from 93318e0 to 8ba91fa Compare July 16, 2026 07:16
@Ethan-chen1234-zy

Copy link
Copy Markdown
Contributor Author

Thanks @thebentern for the review.

I've rebased onto the latest develop (after #10918 was merged) and updated this PR accordingly:

  • Kept MQTT enabled (removed MESHTASTIC_EXCLUDE_MQTT and -<mqtt/>) so Client Proxy MQTT continues to work.
  • Still excluding only mesh/eth and mesh/api (no ethernet hardware on Pocket).
  • Pocket-specific bits remain: WISMESH_POCKET, GPS power via PIN_GPS_EN, default ringtone, HAS_ETHERNET 0, and the low-VDD SYSTEMOFF thresholds.

Ready for another look when you have a moment. Thanks!

@thebentern
thebentern merged commit deea7be into meshtastic:develop Jul 16, 2026
99 of 102 checks passed
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