Skip to content

Add MeshPager X2 support - #11255

Draft
mverch67 wants to merge 40 commits into
developfrom
mesh-pager-x2
Draft

mverch67 wants to merge 40 commits into
developfrom
mesh-pager-x2

Conversation

@mverch67

@mverch67 mverch67 commented Jul 27, 2026 •

Copy link
Copy Markdown
Collaborator
image
  • ST7789P3 TFT display
  • LR2021
  • AG3335MV/B ultra-low-power, dual-frequency GNSS
  • SDIO SD card
  • ES8311 I2S sound
  • TCA6424 IO expander
  • ES7243E audio DAC (mic)
  • ADC battery
  • AW35615 programmable USB Type-C PD controller
  • SHT4X temp + humidity
  • BMM350 3-axis magnometer
  • LSM6DSO 6-axis IMU
  • YSN8900E RTC
  • button navigation (via io expander)
    • full MUI support
    • full BaseUI support

🤝 Attestations

  • I have tested that my proposed changes behave as described.
  • I have tested that my proposed changes do not cause any obvious regressions on the following devices:
    • Heltec (Lora32) V3
    • LilyGo T-Deck
    • LilyGo T-Beam
    • RAK WisBlock 4631
    • Seeed Studio T-1000E tracker card
    • Other (please specify below)

Summary by CodeRabbit

  • New Features
    • Added support for the Seeed MeshPager X2 hardware platform.
    • Added board configuration for ESP32-S3, including Wi-Fi, Bluetooth, USB, debugging, and high-speed uploads.
    • Enabled hardware integration for the display, touch controls, LoRa radio, GPS, audio, sensors, battery monitoring, and power management.
    • Added automatic peripheral startup, reset, and power sequencing.
    • Bluetooth is disabled by default on this board.

@coderabbitai

coderabbitai Bot commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
📝 Walkthrough

Adds Seeed MeshPager X2 ESP32-S3 board support, including PlatformIO configuration, pin and hardware definitions, TCA6424-controlled startup sequencing, audio initialization, LR2021 radio support, and a Bluetooth default override.

Changes: MeshPager X2 hardware support

Layer / File(s) Summary
Board contract and build wiring
boards/seeed_meshpager_x2.json, variants/esp32s3/seeed_mesh_pager_x2/*
Defines board metadata, ESP32-S3 build settings, pin mappings, peripheral feature macros, PlatformIO flags, source filtering, and required libraries.
Peripheral startup and codec initialization
variants/esp32s3/seeed_mesh_pager_x2/variant.cpp
Adds TCA6424 register handling, display/GNSS power and reset sequencing, and conditional ES8311 codec initialization.
Radio reset and board defaults
variants/esp32s3/seeed_mesh_pager_x2/rfswitch.h, variants/esp32s3/seeed_mesh_pager_x2/variant.cpp, src/mesh/NodeDB.cpp
Adds LR2021 RF-switch modes, expander-controlled radio reset, and MeshPager X2 selection in the TFT-board Bluetooth default branch.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Firmware
  participant TCA6424
  participant ES8311
  participant LR2021
  Firmware->>TCA6424: initialize expander and configure hardware
  TCA6424-->>Firmware: initialization status
  Firmware->>TCA6424: sequence display and GNSS power/reset
  Firmware->>ES8311: initialize audio codec when ready
  Firmware->>TCA6424: pulse LoRa reset
  TCA6424->>LR2021: drive reset line
  Firmware->>LR2021: apply RF-switch mode configuration
Loading

Possibly related PRs

Suggested labels: hardware-support, needs-review

Pre-merge checks: Passed 5
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 clearly and concisely identifies the main change: adding MeshPager X2 support.
Description check Passed The description summarizes the supported and unsupported MeshPager X2 features and includes the required attestation section. Testing attestations remain unchecked, but the description is otherwise fo…
Full details: Description check

Explanation

The description summarizes the supported and unsupported MeshPager X2 features and includes the required attestation section. Testing attestations remain unchecked, but the description is otherwise focused and sufficiently complete.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch mesh-pager-x2

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.

@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: 5

🤖 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/esp32s3/seeed_mesh_pager_x2/platformio.ini`:
- Line 2: Update the custom_meshtastic_hw_model setting for the MeshPager X2 to
an unassigned hardware model ID that is not 100 or otherwise already reserved,
and remove the TODO comment. Keep the change limited to this platform
configuration.

In `@variants/esp32s3/seeed_mesh_pager_x2/variant.cpp`:
- Around line 117-120: Update configureOutput() to call
ioExpander.digitalWrite(pin, level) before ioExpander.pinMode(pin, true), while
preserving short-circuit failure handling. Ensure EXP_PIN_PWR_HOLD receives its
requested latch level before the pin is enabled as an output.

In `@variants/esp32s3/seeed_mesh_pager_x2/variant.h`:
- Around line 139-146: Remove the HAS_ES7243E, HAS_BMM350, HAS_SHT4X, and
HAS_LSM6DSO feature definitions from the variant configuration, including the
associated ES7243E_I2C_ADDR definition if it is only used by the unsupported
device. Leave unsupported peripherals disabled until their initialization and
validation are implemented.
- Around line 40-47: The battery ADC and power-save declarations in
variants/esp32s3/seeed_mesh_pager_x2/variant.h (lines 40-47) must be removed
until battery support is implemented and validated. In
variants/esp32s3/seeed_mesh_pager_x2/variant.cpp (lines 124-152), do not rely on
expander initialization in the variant setup to make the ADC available to
pre-earlyInitVariant() power checks; this site requires no direct change if
removing the declarations eliminates those checks.
- Around line 3-13: Replace the multi-line board banner in variant.h with a
concise one- or two-line comment identifying the SenseCAP MeshPager X2 and its
ESP32-S3 target, AG3335MV/B GNSS, and LR2021 radio; remove the inaccurate
peripheral and implementation details.
🪄 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: daee657f-5709-47c6-a2d9-a3ad309726c1

📥 Commits

Reviewing files that changed from the base of the PR and between 1e982fa and 0730aaa.

📒 Files selected for processing (7)
  • boards/seeed_meshpager_x2.json
  • src/mesh/NodeDB.cpp
  • variants/esp32s3/seeed_mesh_pager_x2/pins_arduino.h
  • variants/esp32s3/seeed_mesh_pager_x2/platformio.ini
  • variants/esp32s3/seeed_mesh_pager_x2/rfswitch.h
  • variants/esp32s3/seeed_mesh_pager_x2/variant.cpp
  • variants/esp32s3/seeed_mesh_pager_x2/variant.h

Comment thread variants/esp32s3/seeed_mesh_pager_x2/platformio.ini Outdated
Comment thread src/platform/extra_variants/seeed_mesh_pager_x2/variant.cpp
Comment thread variants/esp32s3/seeed_mesh_pager_x2/variant.h Outdated
Comment thread variants/esp32s3/seeed_mesh_pager_x2/variant.h Outdated
Comment on lines +139 to +146
#define HAS_ES7243E
#define ES7243E_I2C_ADDR 0x14 /* I2C1 address for ES7243E ADC
Note: May conflict with BMM350 sensor in some configs */

// Sensors - I2C1
#define HAS_BMM350 /* Magnetometer on I2C1 */
#define HAS_SHT4X /* Temperature/Humidity on I2C1 */
#define HAS_LSM6DSO /* IMU (Accel/Gyro) on I2C1 */

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.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Do not enable unsupported peripherals.

HAS_ES7243E, HAS_BMM350, HAS_SHT4X, and HAS_LSM6DSO advertise devices that the PR explicitly lists as incomplete. Remove these flags until their initialization and validation are implemented; otherwise generic subsystem setup may attempt to use unavailable hardware.

🤖 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 `@variants/esp32s3/seeed_mesh_pager_x2/variant.h` around lines 139 - 146,
Remove the HAS_ES7243E, HAS_BMM350, HAS_SHT4X, and HAS_LSM6DSO feature
definitions from the variant configuration, including the associated
ES7243E_I2C_ADDR definition if it is only used by the unsupported device. Leave
unsupported peripherals disabled until their initialization and validation are
implemented.

@github-actions

github-actions Bot commented Jul 27, 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 (32)
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
Meshnology W12 meshnology_w12 esp32-s3
Raspberry Pi Pico pico rp2040
Raspberry Pi Pico W picow rp2040
RAK WisMesh Pocket V3 rak_wismesh_pocket nrf52840
RAK WisMesh Pod rak_wismesh_pod 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 MeshPager X2 seeed_meshpager_x2 esp32s3
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-26. Updated for 0730aaa.

@mverch67 mverch67 added the hardware-support Hardware related: new devices or modules, problems specific to hardware label Jul 27, 2026
@mverch67
mverch67 marked this pull request as draft July 27, 2026 14:14
@mverch67 mverch67 self-assigned this Sep 8, 2026
@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

MemBrowse Memory Report · Explore what changed →

heltec-ht62-esp32c3-sx1262

  • drom0_0_seg: .flash.rodata +8 B (+0.0%, 2,122,071 B / 8,388,576 B, total: 25% used)
  • iram0_2_seg: .flash.text +10 B (+0.0%, 1,713,726 B / 8,388,576 B, total: 20% used)

heltec-mesh-node-t114

  • FLASH: .text -16 B (-0.0%, 720,624 B / 802,816 B, total: 90% used)

heltec-v3

  • iram0_2_seg: .flash.text -32 B (-0.0%, 1,797,444 B / 8,388,576 B, total: 21% used)

heltec-vision-master-e213-inkhud

  • iram0_2_seg: .flash.text -8 B (-0.0%, 1,785,128 B / 8,388,576 B, total: 21% used)

pico2w

  • FLASH: .text +16 B (+0.0%, 1,211,576 B / 3,665,920 B, total: 33% used)

picow

  • FLASH: .ARM.exidx -8 B, .ARM.extab -12 B, .text +16 B (-0.0%, 1,235,148 B / 1,568,768 B, total: 79% used)

seeed-sensecap-indicator-tft

  • dram0_0_seg: .dram0.bss +96 B, .dram0.data +128 B (+0.1%, 193,284 B / 341,760 B, total: 57% used)
  • drom0_0_seg: .flash.rodata +6,448 B (+0.1%, 7,597,232 B / 33,554,400 B, total: 23% used)
  • iram0_2_seg: .flash.text +37,728 B (+1.6%, 2,404,124 B / 8,388,576 B, total: 29% used)

t-deck-tft

  • dram0_0_seg: .dram0.bss +200 B, .dram0.data +112 B (+0.2%, 187,216 B / 341,760 B, total: 55% used)
  • drom0_0_seg: .flash.rodata +6,216 B (+0.1%, 7,742,852 B / 33,554,400 B, total: 23% used)
  • iram0_2_seg: .flash.text +32,532 B (+1.3%, 2,472,380 B / 8,388,576 B, total: 29% used)

t-echo-plus

  • FLASH: .text -16 B (-0.0%, 721,864 B / 802,816 B, total: 90% used)

thinknode_m7

  • drom0_0_seg: .flash.rodata -4 B (-0.0%, 4,596,700 B / 33,554,400 B, total: 14% used)
  • iram0_2_seg: .flash.text -20 B (-0.0%, 1,670,948 B / 8,388,576 B, total: 20% used)

tlora-c6

  • irom_seg: .flash.rodata +8 B, .flash.text -2 B (+0.0%, 4,165,995 B / 16,777,184 B, total: 25% used)

wio-e5

  • FLASH: .text -16 B (-0.0%, 234,984 B / 247,808 B, total: 95% used)

No memory changes detected for:


Catch memory regressions in CI with MemBrowse. Free for open source.

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

Labels

hardware-support Hardware related: new devices or modules, problems specific to hardware

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants