|
| 1 | +# Raspberry Pi Pico 2 + W5500 + E22-900M30S — Meshtastic Variant |
| 2 | + |
| 3 | +Meshtastic support for a **Raspberry Pi Pico 2** (RP2350, 4 MB flash) with an external **W5500** Ethernet module and an **EBYTE E22-900M30S** LoRa module. |
| 4 | + |
| 5 | +--- |
| 6 | + |
| 7 | +## Required Hardware |
| 8 | + |
| 9 | +| Component | Model | Notes | |
| 10 | +|-----------|-------------------------------|------------------------------------------| |
| 11 | +| MCU | Raspberry Pi Pico 2 | RP2350 @ 150 MHz, 512 KB RAM, 4 MB flash | |
| 12 | +| Ethernet | W5500 module | Any WIZnet W5500 breakout board | |
| 13 | +| LoRa | EBYTE E22-900M30S | SX1262 + 30 dBm PA, 868/915 MHz | |
| 14 | + |
| 15 | +--- |
| 16 | + |
| 17 | +## Pinout |
| 18 | + |
| 19 | +### System pins (Pico 2, fixed) |
| 20 | + |
| 21 | +| GPIO | Function | |
| 22 | +|------|-----------------------------------------------| |
| 23 | +| GP24 | VBUS sense — HIGH when USB is connected | |
| 24 | +| GP25 | User LED (heartbeat) | |
| 25 | +| GP29 | ADC3 — VSYS/3, measures supply voltage | |
| 26 | + |
| 27 | +### W5500 Ethernet (SPI0) |
| 28 | + |
| 29 | +| W5500 signal | Pico 2 GPIO | |
| 30 | +|--------------|-------------| |
| 31 | +| MISO | GP16 | |
| 32 | +| CS / SCS | GP17 | |
| 33 | +| SCK | GP18 | |
| 34 | +| MOSI | GP19 | |
| 35 | +| RST | GP20 | |
| 36 | +| INT | — (nc) | |
| 37 | +| VCC | 3.3V | |
| 38 | +| GND | GND | |
| 39 | + |
| 40 | +> SPI0 is reserved for the W5500. |
| 41 | +
|
| 42 | +### E22-900M30S LoRa (SPI1) |
| 43 | + |
| 44 | +| E22 signal | Pico 2 GPIO | Notes | |
| 45 | +|------------|-------------|------------------------------------------------| |
| 46 | +| SCK | GP10 | SPI1 clock | |
| 47 | +| MOSI | GP11 | SPI1 TX | |
| 48 | +| MISO | GP12 | SPI1 RX | |
| 49 | +| NSS / CS | GP13 | Chip select | |
| 50 | +| RESET | GP15 | Active LOW reset | |
| 51 | +| DIO1 | GP14 | IRQ interrupt | |
| 52 | +| BUSY | GP2 | Module busy indicator | |
| 53 | +| RXEN | GP3 | LNA enable — held HIGH permanently | |
| 54 | +| TXEN | ← DIO2 | See wiring note below | |
| 55 | +| VCC | 3.3V | Add a 100 µF capacitor close to the module | |
| 56 | +| GND | GND | — | |
| 57 | + |
| 58 | +> See `wiring.svg` in this directory for the full connection diagram. |
| 59 | +
|
| 60 | +--- |
| 61 | + |
| 62 | +## Special wiring: DIO2 → TXEN bridge on the E22 module |
| 63 | + |
| 64 | +The E22-900M30S does **not** connect DIO2 to the TXEN pin of its PA internally. They must be bridged with a short wire or solder bridge **on the module itself**: |
| 65 | + |
| 66 | +``` |
| 67 | +E22 DIO2 pin ──┐ |
| 68 | + ├── wire / solder bridge on the module |
| 69 | +E22 TXEN pin ──┘ |
| 70 | +``` |
| 71 | + |
| 72 | +With this bridge in place, `SX126X_DIO2_AS_RF_SWITCH` causes the SX1262 to drive DIO2 HIGH automatically during TX, enabling the PA without needing an RP2350 GPIO for TXEN. |
| 73 | + |
| 74 | +**Without this bridge the module will not transmit.** |
| 75 | + |
| 76 | +--- |
| 77 | + |
| 78 | +## Build |
| 79 | + |
| 80 | +```bash |
| 81 | +pio run -e pico2_w5500_e22 |
| 82 | +``` |
| 83 | + |
| 84 | +### Flash — BOOTSEL mode |
| 85 | + |
| 86 | +1. Hold the **BOOTSEL** button on the Pico 2. |
| 87 | +2. Connect USB to the PC — it appears as a `RPI-RP2` storage drive. |
| 88 | +3. Copy the `.uf2` file: |
| 89 | + |
| 90 | +``` |
| 91 | +.pio/build/pico2_w5500_e22/firmware-pico2_w5500_e22-*.uf2 |
| 92 | +``` |
| 93 | + |
| 94 | +Or directly with picotool: |
| 95 | + |
| 96 | +```bash |
| 97 | +pio run -e pico2_w5500_e22 -t upload |
| 98 | +``` |
| 99 | + |
| 100 | +--- |
| 101 | + |
| 102 | +## Network usage |
| 103 | + |
| 104 | +This board uses Ethernet (no Wi-Fi). From the Meshtastic app: |
| 105 | + |
| 106 | +- **Enable Ethernet** under `Config → Network → Ethernet Enabled` |
| 107 | +- **DHCP** by default; static IP can also be configured |
| 108 | + |
| 109 | +Services available once connected: |
| 110 | + |
| 111 | +| Service | Details | |
| 112 | +|---------|-----------------------------| |
| 113 | +| NTP | Time synchronization | |
| 114 | +| MQTT | Messages to external broker | |
| 115 | +| API | TCP socket on port 4403 | |
| 116 | +| Syslog | Remote logging (optional) | |
| 117 | + |
| 118 | +--- |
| 119 | + |
| 120 | +## Technical notes |
| 121 | + |
| 122 | +### LoRa — RF control |
| 123 | + |
| 124 | +| Define | Effect | |
| 125 | +|--------------------------------|---------------------------------------------------------------| |
| 126 | +| `SX126X_ANT_SW 3` | GP3 (RXEN) driven HIGH at init and never toggled again | |
| 127 | +| `SX126X_DIO2_AS_RF_SWITCH` | SX1262 drives DIO2 HIGH during TX → enables TXEN via bridge | |
| 128 | +| `SX126X_DIO3_TCXO_VOLTAGE 1.8` | E22 TCXO controlled by DIO3 | |
| 129 | +| `-D EBYTE_E22` | Enables TCXO support in firmware | |
| 130 | +| `-D EBYTE_E22_900M30S` | Sets `TX_GAIN_LORA=10`, max power 22 dBm | |
| 131 | + |
| 132 | +> RXEN and TXEN may both be HIGH simultaneously during TX — this is safe for the E22 RF switch. |
| 133 | +
|
| 134 | +### Ethernet |
| 135 | + |
| 136 | +- Library: `arduino-libraries/Ethernet@^2.0.2` (supports W5100/W5200/W5500 auto-detection). |
| 137 | +- SPI0 is explicitly initialized with pins GP16/18/19 before `Ethernet.init()`. |
| 138 | +- DHCP timeout is set to 10 s (instead of the default 60 s) to avoid blocking LoRa startup. |
| 139 | + |
| 140 | +### HW_VENDOR |
| 141 | + |
| 142 | +Mapped to `meshtastic_HardwareModel_PRIVATE_HW` — no dedicated model exists in the Meshtastic protobuf for this hardware combination yet. |
| 143 | + |
| 144 | +--- |
| 145 | + |
| 146 | +## Memory usage (reference build) |
| 147 | + |
| 148 | +| Resource | Used | Total | % | |
| 149 | +|----------|---------|----------|-------| |
| 150 | +| RAM | 94 KB | 512 KB | 18% | |
| 151 | +| Flash | 964 KB | 3.58 MB | 26.3% | |
0 commit comments