Skip to content

feat: add Raspberry Pi Pico 2 + W5500 + E22-900M30S variant#10135

Open
cvaldess wants to merge 2 commits intomeshtastic:developfrom
cvaldess:feature/pico2-w5500-e22
Open

feat: add Raspberry Pi Pico 2 + W5500 + E22-900M30S variant#10135
cvaldess wants to merge 2 commits intomeshtastic:developfrom
cvaldess:feature/pico2-w5500-e22

Conversation

@cvaldess
Copy link
Copy Markdown

Summary

  • Adds community variant for Raspberry Pi Pico 2 (RP2350, 4 MB flash) with an external WIZnet W5500 Ethernet module and an EBYTE E22-900M30S LoRa module (SX1262, 30 dBm PA, 868/915 MHz)
  • Reuses existing WIZNET_5500_EVB_PICO2 code paths in ethClient.cpp for W5500 Ethernet initialization on SPI0
  • DHCP timeout reduced from 60 s to 10 s to avoid blocking LoRa startup when no DHCP server is present

Hardware

Component Model Notes
MCU Raspberry Pi Pico 2 RP2350 @ 150 MHz, 512 KB RAM, 4 MB flash
Ethernet W5500 module Any WIZnet W5500 breakout, SPI0
LoRa EBYTE E22-900M30S SX1262 + 30 dBm PA, 868/915 MHz, SPI1

Pin assignments

  • LoRa SPI1: SCK=GP10, MOSI=GP11, MISO=GP12, CS=GP13, RST=GP15, DIO1=GP14, BUSY=GP2, RXEN=GP3
  • Ethernet SPI0: MISO=GP16, CS=GP17, SCK=GP18, MOSI=GP19, RST=GP20
  • GPS UART1/Serial2: TX=GP8, RX=GP9

RF configuration

  • SX126X_ANT_SW 3 — GP3 (RXEN) driven HIGH at init and held there permanently (LNA always active)
  • SX126X_DIO2_AS_RF_SWITCH — SX1262 drives DIO2 HIGH during TX; a DIO2→TXEN bridge on the E22 module activates the PA automatically (no extra GPIO needed)
  • SX126X_DIO3_TCXO_VOLTAGE 1.8 — TCXO controlled via DIO3

Note: The E22-900M30S requires a short wire or solder bridge between its DIO2 and TXEN pins. Without this bridge the module will not transmit.

Test plan

  • Firmware builds cleanly (pio run -e pico2_w5500_e22)
    • RAM: 18.1% (94 KB / 512 KB)
    • Flash: 27.3% (978 KB / 3.58 MB)
  • LoRa RX/TX verified on hardware (868 MHz, E22-900M30S)
  • Ethernet DHCP acquisition verified
  • Meshtastic API accessible over TCP port 4403
  • NTP sync working over Ethernet
  • MQTT working over Ethernet

🤖 Generated with Claude Code

@github-actions github-actions bot added needs-review Needs human review hardware-support Hardware related: new devices or modules, problems specific to hardware labels Apr 12, 2026
@fifieldt fifieldt added the ai-generated Possible AI-generated low-quality content label Apr 12, 2026
@cvaldess cvaldess force-pushed the feature/pico2-w5500-e22 branch 2 times, most recently from e59ef4c to c2a3751 Compare April 15, 2026 04:55
@cvaldess
Copy link
Copy Markdown
Author

Friendly bump — CLA is signed and the variant is a self-contained addition under variants/rp2350/pico2_w5500_e22/ (no touching of shared code paths beyond a three-line WIZNET_5500_EVB_PICO2 → PRIVATE_HW mapping in src/platform/rp2xx0/architecture.h). Happy to rebase or adjust wiring docs if anything looks off.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new community hardware variant for the RP2350-based Raspberry Pi Pico 2 that combines a W5500 Ethernet module (SPI0) with an EBYTE E22-900M30S (SX1262) LoRa module (SPI1), plus small core changes to support the W5500 path and shorten DHCP blocking.

Changes:

  • Added new pico2_w5500_e22 variant (PlatformIO env, pin definitions, README, wiring diagram).
  • Updated Ethernet client codepaths to support WIZNET_5500_EVB_PICO2 builds using arduino-libraries/Ethernet.
  • Reduced DHCP timeout to 10 seconds (currently applied globally within ethClient.cpp).

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
variants/rp2350/pico2_w5500_e22/wiring.svg Adds wiring diagram for Pico 2 + W5500 + E22 module connections.
variants/rp2350/pico2_w5500_e22/variant.h Defines GPIO mappings and radio/Ethernet configuration macros for the new variant.
variants/rp2350/pico2_w5500_e22/platformio.ini Introduces env:pico2_w5500_e22 build configuration and dependencies.
variants/rp2350/pico2_w5500_e22/README.md Documents required hardware, pinout, special wiring (DIO2→TXEN), and usage notes.
src/platform/rp2xx0/architecture.h Maps WIZNET_5500_EVB_PICO2 builds to PRIVATE_HW model selection.
src/mesh/eth/ethClient.cpp Adds W5500/Ethernet library initialization and sets DHCP timeout to 10s.
src/mesh/api/ethServerAPI.h Switches include to Ethernet.h for WIZNET_5500_EVB_PICO2 builds.
src/DebugConfiguration.h Includes Ethernet.h for WIZNET_5500_EVB_PICO2 Ethernet builds.

Comment thread src/mesh/eth/ethClient.cpp Outdated
Comment thread variants/rp2350/pico2_w5500_e22/platformio.ini Outdated
Comment thread variants/rp2350/pico2_w5500_e22/README.md Outdated
Comment thread src/mesh/eth/ethClient.cpp
Comment thread src/mesh/eth/ethClient.cpp Outdated
Comment thread src/mesh/eth/ethClient.cpp Outdated
cvaldess added a commit to cvaldess/firmware that referenced this pull request Apr 17, 2026
Rename WIZNET_5500_EVB_PICO2 to PICO2_W5500_E22 so the variant-specific
define matches the variant directory name and isn't confused with an
on-board EVB SKU.

Review fixes from PR meshtastic#10135:
- Gate the 10 s Ethernet DHCP timeout behind PICO2_W5500_E22 so other
  Ethernet builds keep the default 60 s behavior; apply the same timeout
  to reconnectETH() for consistency.
- Drop the unused -D EBYTE_E22 flag; EBYTE_E22_900M30S already selects
  TX_GAIN_LORA / SX126X_MAX_POWER in src/configuration.h.
- Rewrite "on-board W5500" comments to describe the external module.
- Correct README TX_GAIN_LORA value (7, not 10) and drop the EBYTE_E22
  row.
cvaldess added a commit to cvaldess/firmware that referenced this pull request Apr 17, 2026
Rename WIZNET_5500_EVB_PICO2 to PICO2_W5500_E22 so the variant-specific
define matches the variant directory name and isn't confused with an
on-board EVB SKU.

Review fixes from PR meshtastic#10135:
- Gate the 10 s Ethernet DHCP timeout behind PICO2_W5500_E22 so other
  Ethernet builds keep the default 60 s behavior; apply the same timeout
  to reconnectETH() for consistency.
- Drop the unused -D EBYTE_E22 flag; EBYTE_E22_900M30S already selects
  TX_GAIN_LORA / SX126X_MAX_POWER in src/configuration.h.
- Rewrite "on-board W5500" comments to describe the external module.
- Correct README TX_GAIN_LORA value (7, not 10) and drop the EBYTE_E22
  row.
@cvaldess cvaldess force-pushed the feature/pico2-w5500-e22 branch from 956fc0e to 5914434 Compare April 17, 2026 18:18
cvaldess and others added 2 commits April 20, 2026 12:44
Adds community variant for Raspberry Pi Pico 2 (RP2350, 4 MB flash)
with external WIZnet W5500 Ethernet module and EBYTE E22-900M30S LoRa
module (SX1262, 30 dBm PA, 868/915 MHz).

Key details:
- LoRa on SPI1: GP10/11/12/13 (SCK/MOSI/MISO/CS), RST=GP15,
  DIO1=GP14, BUSY=GP2, RXEN=GP3 (held HIGH via SX126X_ANT_SW)
- W5500 on SPI0: GP16/17/18/19/20 (MISO/CS/SCK/MOSI/RST)
- SX126X_DIO2_AS_RF_SWITCH: DIO2→TXEN bridge on module handles PA
- SX126X_DIO3_TCXO_VOLTAGE 1.8: TCXO support via EBYTE_E22 flags
- DHCP timeout reduced to 10 s to avoid blocking LoRa startup
- GPS on UART1/Serial2: GP8 TX, GP9 RX
- Reuses WIZNET_5500_EVB_PICO2 code paths for Ethernet init

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Rename WIZNET_5500_EVB_PICO2 to PICO2_W5500_E22 so the variant-specific
define matches the variant directory name and isn't confused with an
on-board EVB SKU.

Review fixes from PR meshtastic#10135:
- Gate the 10 s Ethernet DHCP timeout behind PICO2_W5500_E22 so other
  Ethernet builds keep the default 60 s behavior; apply the same timeout
  to reconnectETH() for consistency.
- Drop the unused -D EBYTE_E22 flag; EBYTE_E22_900M30S already selects
  TX_GAIN_LORA / SX126X_MAX_POWER in src/configuration.h.
- Rewrite "on-board W5500" comments to describe the external module.
- Correct README TX_GAIN_LORA value (7, not 10) and drop the EBYTE_E22
  row.
@cvaldess cvaldess force-pushed the feature/pico2-w5500-e22 branch from c6eefee to baf11d8 Compare April 20, 2026 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-generated Possible AI-generated low-quality content hardware-support Hardware related: new devices or modules, problems specific to hardware needs-review Needs human review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants