M5Stack Cardputer ADV · Volume 5
M5Stack Cardputer ADV Volume 5 — Cap LoRa-1262, LoRa CSS Theory, and GNSS
SX1262 sub-GHz radio + AT6668 multi-constellation GNSS + CSS modulation + link budget + regional rules
Contents
1. About this volume
Vol 5 covers the Cap LoRa-1262 in full — the SX1262 LoRa radio + AT6668 GNSS daughterboard that turns the Cardputer ADV from “an ESP32-S3 handheld” into “an off-grid Meshtastic + GPS handheld”. It’s the flagship Cap and the single most-impactful add-on for Cardputer ADV utility.
Three components covered: (1) the SX1262 sub-GHz radio, (2) the CSS modulation theory that explains how LoRa achieves its absurd range, (3) the AT6668 multi-constellation GNSS receiver that pairs with the LoRa for position broadcasting.
Combined with Meshtastic firmware (Vol 6 § 5.1), this Cap is what makes the Cardputer ADV a viable Meshtastic node. Without it, the Cardputer ADV is just an ESP32-S3 handheld.
2. The Cap LoRa-1262 module
2.1 Block diagram + component function
┌─────────────────────────────────────────────────────┐
│ Cap LoRa-1262 (M5Stack SKU U214) │
│ │
│ ┌──────────┐ ┌─────────────┐ ┌──────────┐ │
│ │ SX1262 │────│ FM8625H │────│ RP-SMA │──┼── Antenna
│ │ LoRa │ │ ant. switch │ │ female │ │ (3 dBi whip
│ │ +22 dBm │ │ (TX/RX/off) │ │ │ │ included)
│ └────┬─────┘ └──────┬──────┘ └──────────┘ │
│ │ │ enable │
│ │ SPI │ │
│ │ │ │
│ ┌────┴────┐ ┌────────┴────────┐ │
│ │ EXT │ │ PI4IOE5V6408 │ │
│ │ control │ │ I²C GPIO exp. │ │
│ │ (4 lines)│ │ (addr 0x43) │ │
│ └────┬────┘ └────────┬────────┘ │
│ │ │ │
│ │ │ I²C (G8/G9) │
│ │ │ │
│ ┌────┴─────────────────┴───────┐ │
│ │ 14-pin EXT bus header │ ────────────── To Cardputer ADV
│ │ (mates Cardputer ADV) │ │
│ └──────────────────────────────┘ │
│ │
│ ┌──────────┐ ┌─────────────────┐ │
│ │ AT6668 │────│ on-board patch │ │
│ │ GNSS │ │ antenna (top) │ │
│ │ multi- │ │ │ │
│ │ const. │ └─────────────────┘ │
│ └────┬─────┘ │
│ │ UART 115200 (G13/G15) │
│ │ │
│ (routes through EXT) │
│ │
└─────────────────────────────────────────────────────┘
Component function:
| Component | Function | Notes |
|---|---|---|
| SX1262 | LoRa transceiver — TX up to +22 dBm, RX down to −147 dBm | Semtech. Shielded under RF can. |
| FM8625H | RF antenna switch | Routes between TX path, RX path, and off. Must be enabled via I²C before use (§ 3.4). |
| PI4IOE5V6408 | I²C GPIO expander | Address 0x43. Drives FM8625H enable + other Cap control. |
| AT6668 | GNSS receiver (ATGM336H-6N module) | CASIC chip in a M-class module package. UART output. |
| Patch antenna | GNSS antenna on top of Cap | ~25 × 25 mm passive patch, ~5 dBi nominal gain. |
| RP-SMA female | LoRa antenna connector | Industry standard for sub-GHz; supplied antenna mates here. |
| RF shield can | Over SX1262 | Reduces RFI from Cardputer ADV digital traffic. |
2.2 Authoritative spec table
| Parameter | Value |
|---|---|
| LoRa radio | |
| Chip | Semtech SX1262 |
| Frequency coverage (chip) | 150 MHz - 960 MHz |
| Frequency tuned (Cap) | 868 - 923 MHz (via antenna + matching network) |
| TX power range | −9 dBm to +22 dBm (1 dBm steps) |
| TX peak current | ~163 mA at +22 dBm, 5V supply |
| RX sensitivity | −147 dBm at SF12 BW125 (absolute floor) |
| Modulation modes | CSS (LoRa), FSK, GFSK, MSK, GMSK, OOK |
| RX current | ~12 mA (continuous receive) |
| Sleep current | <1 µA (with retention) |
| GNSS | |
| Module | ATGM336H-6N |
| Chip | CASIC AT6668 |
| Channels | 50 |
| Constellations | GPS L1 + GLONASS L1 + Galileo E1 + BeiDou B1I/B1C + QZSS + SBAS |
| Position accuracy | <1.5 m CEP50 (consumer-grade single-frequency) |
| TTFF cold | ~23 s |
| TTFF warm (<4h almanac) | ~10 s |
| TTFF hot (<5 min almanac) | ~1 s |
| Update rate | 1-10 Hz configurable |
| Output | NMEA 0183 v4.1 + CASIC binary protocol |
| UART | 115200 bps default (configurable to 9600 / 38400 / 230400 etc.) |
| Antenna | |
| LoRa connector | RP-SMA female |
| Included LoRa antenna | 3 dBi rubber-duck, 108 × 9.3 mm |
| GNSS antenna | On-board passive patch (not user-replaceable) |
| Mechanical | |
| Dimensions | 84 × 24 × 15.2 mm |
| Weight | 22.1 g |
| Mating | 14-pin EXT bus (Vol 3 § 4) |
3. SX1262 — the sub-GHz radio
3.1 Frequency coverage and modulation modes
The SX1262 silicon covers 150 MHz - 960 MHz natively. The Cap LoRa-1262 is tuned by its antenna network + matching to 868 - 923 MHz. Out-of-band operation (e.g., 433 MHz) is electrically possible — the chip will TX/RX at 433 MHz — but the antenna’s VSWR will be poor, the radiated power will be much lower than the chip output, and the matching network may have detuned passband. For 433 MHz work, re-antenna the Cap (§ 8) or use a separate SX1262 module wired to EXT (Vol 4 § 6.5).
Modulation modes (the SX1262 silicon supports all, the Cap exposes all):
| Mode | Use case | Typical Cardputer ADV firmware |
|---|---|---|
| CSS (LoRa) | Long-range mesh / point-to-point — the canonical mode | Meshtastic, CardputerLoRaChat |
| FSK / GFSK | Higher-rate point-to-point (compatible with non-LoRa sub-GHz protocols) | Custom firmware, niche |
| MSK / GMSK | Some legacy protocols | Rare on Cardputer ADV |
| OOK | Fixed-code remote replay (433 MHz garage doors, etc.) | Bruce sub-GHz with on-EXT SX1262 |
For 99% of Cardputer ADV use cases, you’ll be in CSS mode (LoRa-proper).
3.2 Pin assignments on the EXT bus
The SX1262 connects to the Cardputer ADV via these EXT-bus signals (cross-ref Vol 3 § 4.1):
| Signal | EXT pin | GPIO | Function |
|---|---|---|---|
| RESET | 3 | GPIO 3 | Active-low reset |
| INT (DIO1) | 4 | GPIO 4 | Interrupt — TX done, RX done, timeout, header valid |
| CS (NSS) | 5 | GPIO 5 | SPI chip-select |
| BUSY | 6 | GPIO 6 | Busy status — must be low before sending SPI commands |
| SCK | 11 | GPIO 40 | SPI clock |
| MISO | 10 | GPIO 39 | SPI data in (to ESP32-S3) |
| MOSI | 12 | GPIO 14 | SPI data out (from ESP32-S3) |
Plus the I²C bus (G8/G9 → EXT pins 7/8) for the PI4IOE5V6408 GPIO expander that controls the FM8625H antenna switch.
3.3 Bring-up sequence
Six steps to bring up SX1262 from cold:
- Initialize I²C —
Wire.begin(8, 9)(or M5Cardputer’s pre-initialized Wire). - Enable RF switch — set PI4IOE5V6408 (I²C addr 0x43) port P0 HIGH. This connects the FM8625H switch’s enable line. Without this step, the SX1262 will transmit but no RF will emerge from the antenna. Most-common new-user bug.
- Initialize SPI — configure MOSI=G14, MISO=G39, SCK=G40 (or use M5Cardputer’s pre-initialized SPI).
- Pulse RST — drive G3 (EXT RESET) low for ≥100 µs, then high. Waits for the SX1262 to finish its internal reset.
- Wait BUSY low — poll G6 (EXT BUSY) until low. The SX1262 is busy during internal startup; SPI commands must wait.
- SetStandby(STDBY_RC) — the standard “ready for commands” SX1262 state. From here, configure modulation, frequency, power, then TX or RX.
All subsequent SPI commands per the SX1262 datasheet (Semtech publishes the full command reference).
3.4 RF antenna switch (FM8625H) — must-enable-via-I²C
The single most-common Cap LoRa-1262 footgun: forgetting to enable the FM8625H antenna switch.
The FM8625H is a small RF SPDT switch that routes between TX path and RX path. It has an enable pin that’s controlled by the PI4IOE5V6408 I²C GPIO expander (I²C address 0x43, port P0). At power-on, P0 is in its default state (low). The SX1262 will accept SPI commands, generate RF, but no RF reaches the antenna because the switch is disabled.
The fix:
// Pseudo-code for FM8625H enable via PI4IOE5V6408
Wire.beginTransmission(0x43);
Wire.write(0x03); // Output register
Wire.write(0x01); // P0 = HIGH (P1-P7 = LOW)
Wire.endTransmission();
// Now the SX1262 + FM8625H + antenna path is operational
Meshtastic, Bruce, CardputerLoRaChat all do this automatically. Bare RadioLib code from tutorials sometimes omits it — symptoms: SetTxConfig + transmit succeeds in software (no SPI errors), but received signal strength at the other end is “as if no transmission happened.” Trace to FM8625H enable.
Some firmwares hide this in a M5Stack_LoRa.begin() wrapper; others require explicit configuration. When debugging “I can’t receive my own transmissions,” check the FM8625H first.
3.5 RadioLib code example
#include <SPI.h>
#include <Wire.h>
#include <RadioLib.h>
// EXT-bus pins
#define LORA_CS 5
#define LORA_RST 3
#define LORA_INT 4 // DIO1
#define LORA_BUSY 6
// FM8625H enable
#define IOEXP_ADDR 0x43
#define IOEXP_OUTPUT_REG 0x03
#define IOEXP_P0_HIGH 0x01
SX1262 radio = new Module(LORA_CS, LORA_INT, LORA_RST, LORA_BUSY);
void enable_rf_switch() {
Wire.beginTransmission(IOEXP_ADDR);
Wire.write(IOEXP_OUTPUT_REG);
Wire.write(IOEXP_P0_HIGH);
Wire.endTransmission();
}
void setup() {
Serial.begin(115200);
Wire.begin(8, 9); // Primary I²C
SPI.begin(40, 39, 14, LORA_CS); // SCK, MISO, MOSI, CS
enable_rf_switch(); // CRITICAL — enable FM8625H
int state = radio.begin(915.0, // Frequency 915 MHz (US ISM)
125.0, // BW 125 kHz
9, // SF 9
5, // CR 4/5
0x12, // Sync word (private network)
14, // +14 dBm TX power
8, // Preamble length
1.6, // TCXO voltage 1.6 V (Cap uses TCXO)
false); // Use DC-DC regulator
if (state == RADIOLIB_ERR_NONE) {
Serial.println("SX1262 init OK");
} else {
Serial.printf("SX1262 init failed: %d\n", state);
while (true) delay(10);
}
}
void loop() {
Serial.print("Sending packet... ");
int state = radio.transmit("Hello from Cardputer ADV");
if (state == RADIOLIB_ERR_NONE) {
Serial.println("OK");
} else {
Serial.printf("failed: %d\n", state);
}
delay(5000);
}
This compiles + flashes + runs against the Cap LoRa-1262 directly. For receive, use radio.receive(). For non-blocking operation, use radio.startTransmit() + radio.startReceive() with DIO1-based interrupt handlers.
4. LoRa CSS theory of operation
4.1 Chirp Spread Spectrum modulation
LoRa is a Semtech-proprietary modulation built around Chirp Spread Spectrum (CSS). A LoRa symbol is a frequency sweep — a linear chirp from f₀ to f₁ across the channel bandwidth.
The trick: data is encoded by cyclic-shifting the chirp’s starting frequency. A receiver correlates the incoming signal against a known reference chirp; the cyclic shift that gives maximum correlation = the data bits encoded.
Why this works at extreme low SNR:
- Process gain — spreading the symbol across the full bandwidth gives the demodulator gain over noise. SF7 chips at 4× the bit rate but with 4× more bandwidth — net SNR margin improves by ~24 dB vs simple FSK at equivalent power.
- Doppler-robust — the chirp’s frequency-varying nature is tolerant of small frequency offsets caused by motion (drone hovering, vehicle passing, antenna swaying).
- Multipath-tolerant — the chirp’s time-frequency structure resolves multipath echoes that confuse narrow-bandwidth modulations.
The cost: spectral efficiency is poor compared to OFDM / modern Wi-Fi modulations. LoRa is not for fast bulk data. LoRa is for “is this transmitter reachable from km away?” — which is exactly what Meshtastic needs.
4.2 The four tuning knobs — SF, BW, CR, TX power
LoRa configuration has four primary tunables:
| Knob | Range | Effect |
|---|---|---|
| Spreading Factor (SF) | 5 - 12 | +1 SF = +2× range, +2× ToA, halved data rate |
| Bandwidth (BW) | 7.8 - 500 kHz | +1 step = -3 dB sensitivity, +2× data rate, +2× ToA |
| Coding Rate (CR) | 4/5 - 4/8 | Higher CR = more FEC overhead = more error tolerance, lower effective rate |
| TX power | −9 dBm to +22 dBm | Per 1 dB step. +20 dBm = 100 mW; +22 dBm = 158 mW. |
The tradeoff matrix is the central LoRa design decision — pick once per channel, configure both ends to match. Meshtastic ships standard “presets” (LongFast, ShortFast, etc., Vol 9 § 3.1) that encode common tradeoff points.
Rule of thumb:
- High SF + low BW = maximum range, slowest data, longest ToA.
- Low SF + high BW = shortest range, fastest data, shortest ToA.
- High CR = more error correction, useful in noisy environments.
- Higher TX power = longer range linearly until clip on legal EIRP limits (§ 5).
4.3 Sensitivity by spreading factor
Receiver sensitivity table (BW 125 kHz, the Meshtastic default):
| SF | Sensitivity (dBm) | Data rate (bps) |
|---|---|---|
| 7 | −120 | 5470 |
| 8 | −123 | 3125 |
| 9 | −126 | 1758 |
| 10 | −129 | 977 |
| 11 | −132 | 537 |
| 12 | −147 | 292 |
(Sensitivity at SF12 jumps to −147 dBm — the absolute floor. This isn’t a typo; CSS achieves this via the spreading gain.)
For BW 250 kHz, subtract 3 dB from each sensitivity number (less spreading). For BW 500 kHz, subtract another 3 dB.
Why −147 dBm is significant: this is roughly 6 dB below the natural thermal noise floor of a 125 kHz receiver. LoRa demodulates below the noise floor via spreading gain. Conventional FSK / FM demodulators cannot do this.
4.4 Link budget walkthrough
For a hypothetical Cardputer ADV → Cardputer ADV link at +22 dBm TX, 3 dBi antennas, SF12 BW125 sensitivity −147 dBm:
Link budget = TX power + TX antenna gain + RX antenna gain − RX sensitivity
= +22 dBm + 3 dBi + 3 dBi + 137 dB (sensitivity expressed as positive)
= +22 + 6 − (−147)
= +22 + 6 + 147
= 175 dB total link budget at SF12 BW125
(Actually: link budget = +22 dBm + 3 + 3 − (−147 dBm) = +22 + 3 + 3 + 147 = 175 dB.)
Free-space path loss at 915 MHz vs distance:
| Distance | Path loss (dB) | Margin (dB at 175 dB budget) |
|---|---|---|
| 1 km | 92 | 83 dB |
| 10 km | 112 | 63 dB |
| 100 km | 132 | 43 dB |
| 1000 km | 152 | 23 dB |
In free space (no obstacles), SF12 BW125 LoRa at +22 dBm has over 1000 km of theoretical range. In practice — obstacles, multipath, antenna inefficiencies, RF noise — real-world performance is much worse:
| Environment | Realistic range (SF12 BW125, +22 dBm, 3 dBi antennas) |
|---|---|
| Urban (buildings) | 200 m - 2 km |
| Suburban (line-of-sight broken by trees / houses) | 5 - 15 km |
| Rural / open field | 15 - 30 km |
| Air-to-ground (drone TX, ground station RX) | 100+ km (record: 700+ km in optimal conditions) |
| Boat-to-shore over water | 50+ km |
Higher-gain antennas extend these proportionally. A 6 dBi omni doubles range vs 3 dBi (+3 dB on each end = +6 dB link budget, ~2× distance in free space).
4.5 Time-on-air calculator
LoRa packet airtime depends on SF, BW, CR, payload length, and preamble length. For a typical 50-byte Meshtastic position packet:
| Configuration | ToA |
|---|---|
| SF7 BW125 CR4/5 | ~85 ms |
| SF9 BW125 CR4/5 | ~250 ms |
| SF11 BW250 CR4/5 (Meshtastic LongFast) | ~510 ms |
| SF12 BW125 CR4/8 | ~2000 ms (2 seconds!) |
Implication for EU duty cycle (§ 5.1):
- EU 868 g1 allows 1% duty cycle = 36 seconds of TX per hour
- SF12 BW125 CR4/8 packet at 2 s ToA = 18 packets per hour maximum before the duty cycle locks you out
- After hitting the 1% limit, the radio must stay silent for the remaining hour
For SF12 use in EU, packet rate is severely limited. Meshtastic’s region-default LongFast (SF11/BW250) at 510 ms ToA enables ~7 packets/min sustained — practical for mesh chat.
5. Regional LoRa rules
LoRa hardware operates in ISM bands per region. Rules differ on:
- Frequency band allocated for unlicensed sub-GHz use
- Maximum EIRP (Effective Isotropic Radiated Power = TX power + antenna gain)
- Duty cycle or dwell-time restrictions
- Channel plan (specific frequencies vs free-form)
5.1 EU 868 MHz
Regulator: ETSI EN 300 220.
| Sub-band | Frequency | EIRP limit | Duty cycle |
|---|---|---|---|
| g1 | 868.0 - 868.6 MHz | +14 dBm / 25 mW | 1% (36 sec/hour) |
| g2 | 868.7 - 869.2 MHz | +14 dBm / 25 mW | 0.1% |
| g3 | 869.4 - 869.65 MHz | +27 dBm / 500 mW | 10% |
| g4 | 869.7 - 870.0 MHz | +7 dBm / 5 mW | 1% |
Meshtastic EU868 preset uses 869.525 MHz (in g3 sub-band) for +14 dBm EIRP and 10% duty.
Strict 1% duty cycle compliance in g1: a 2-second TX requires 200 seconds of silence before next TX. Meshtastic implements this — burst-then-silent pattern is normal behavior for EU nodes.
5.2 US 902–928 MHz
Regulator: FCC §15.247.
| Parameter | Value |
|---|---|
| Frequency band | 902 - 928 MHz |
| Maximum EIRP | +30 dBm / 1 W |
| Duty cycle | None (replaced by dwell-time rules) |
| Dwell-time rule | If using FHSS: must dwell ≤400 ms on each channel; if DSSS: must channel-hop within 50 channels; LoRa CSS gets §15.247(c) coverage |
US rules are the most permissive of major regions. LoRa nodes can transmit continuously (subject to FCC §15.249 max EIRP and antenna gain limits). The 1 W EIRP limit is well above the Cap LoRa-1262’s +22 dBm + 3 dBi = +25 dBm EIRP, so the stock configuration is legal.
5.3 Other regions
| Region | Frequency | Max EIRP | Duty cycle |
|---|---|---|---|
| AU/NZ (AS/NZS 4268) | 915 - 928 MHz | +30 dBm / 1 W | None |
| JP (ARIB STD-T108) | 920.6 - 928 MHz | +13 dBm / 20 mW | 10% (sub-band varies) |
| CN (SRRC) | 470 - 510 MHz / 779 - 787 MHz | varies | varies |
| IN (TEC) | 865 - 867 MHz | +30 dBm / 1 W | None |
| RU | varies | varies | varies |
For travel: set your firmware’s region code to match the country you’re operating in. Operating with the wrong region code is technically a regulatory violation regardless of whether anyone notices.
5.4 The Cap LoRa-1262 EU g1 compliance gotcha
The Cap LoRa-1262 ships at +22 dBm by default. With the included 3 dBi antenna:
EIRP = TX power + antenna gain = +22 dBm + 3 dBi = +25 dBm
This is 11 dB over the EU g1 limit (+14 dBm). Running the stock Cap at +22 dBm in EU g1 frequencies is non-compliant.
Compliance options:
- Firmware-clamp TX to ≤+11 dBm (so +11 + 3 = +14 dBm EIRP). Meshtastic does this automatically when EU868 region is selected.
- Run g3 only (+27 dBm EIRP cap, 10% duty) — operate in 869.4 - 869.65 MHz, allow +22 dBm.
- Use a 0 dBi antenna — odd choice for LoRa but allows +14 dBm TX with +14 dBm EIRP.
Bare RadioLib code without region-aware configuration is non-compliant by default. Meshtastic’s region presets handle this automatically.
US operators don’t have this problem — +25 dBm EIRP is well under the +30 dBm FCC limit.
6. GNSS — AT6668 multi-constellation receiver
6.1 Constellations supported
The ATGM336H-6N module wraps a CASIC AT6668 chip — a 50-channel multi-constellation GNSS receiver.
| Constellation | Frequency | Active satellites visible | Coverage |
|---|---|---|---|
| GPS L1 | 1575.42 MHz | ~31 worldwide | Global |
| GLONASS L1 | 1602 MHz | ~24 worldwide | Global |
| Galileo E1 | 1575.42 MHz | ~30 worldwide | Global |
| BeiDou B1I + B1C | 1561 / 1575.42 MHz | ~45 worldwide | Global with stronger Asia-Pacific coverage |
| QZSS L1 | 1575.42 MHz | 4 satellites | Asia-Pacific only (regional augmentation) |
| SBAS | 1575.42 MHz | Various (WAAS, EGNOS, MSAS, GAGAN) | Region-specific augmentation for higher accuracy |
Typical visibility outdoors clear sky: 20-30 satellites in view, 10-15 tracked simultaneously for position fix. Indoors / urban canyon: degraded but still typically functional.
Position accuracy: <1.5 m CEP50 (Circular Error Probable, 50% of fixes within this radius). Consumer-grade. For RTK-level <10 cm accuracy, you need a dedicated RTK module (not the AT6668).
6.2 Time-to-first-fix (TTFF)
| Start type | Almanac state | Typical TTFF |
|---|---|---|
| Cold | No almanac, no recent fix | ~23 seconds |
| Warm | Almanac valid (<4 hours since last fix) | ~10 seconds |
| Hot | Almanac valid + recent fix (<5 minutes) | ~1 second |
The almanac is stored in volatile chip RAM by default; loss of power = cold start on next boot. Some firmwares use the backup battery on the Atomic GPS Kit (NEO-M8N) to retain almanac — the Cap LoRa-1262’s AT6668 does not have a backup battery, so every cold boot = ~23 s TTFF.
For Meshtastic users: this matters at trail-head start-up — your first GPS fix takes 20-30 seconds after power-on. Plan accordingly.
6.3 Interface — UART + NMEA + CASIC binary
The AT6668 module communicates with the Cardputer ADV via UART:
- Baud rate: 115200 default (configurable to 9600 / 38400 / 230400)
- Protocol: NMEA 0183 v4.1 (sentences
$GNGGA,$GPGGA,$GNRMC,$GLGSV, etc.) by default - Alternative: CASIC binary protocol — proprietary higher-rate / lower-overhead alternative
EXT-bus pin map:
| Direction | EXT pin | GPIO | AT6668 pin |
|---|---|---|---|
| Cardputer RX (AT6668 → Cardputer) | 13 | GPIO 13 | TX |
| Cardputer TX (Cardputer → AT6668) | 9 | GPIO 15 | RX |
The TX path is mostly for configuration commands (set baud rate, set update rate, select constellations, enable/disable specific NMEA sentences). For passive position reading, only the RX path is used.
6.4 Code example — Arduino NMEA parsing
#include <HardwareSerial.h>
#include <TinyGPSPlus.h>
HardwareSerial GPS(2); // Use UART2
TinyGPSPlus gps;
void setup() {
Serial.begin(115200);
GPS.begin(115200, SERIAL_8N1, 13, 15); // baud, config, RX pin, TX pin
}
void loop() {
while (GPS.available()) {
gps.encode(GPS.read());
}
if (gps.location.isValid()) {
Serial.printf("Lat %.6f Lng %.6f Alt %.1f m Sats %u Time %02d:%02d:%02d UTC\n",
gps.location.lat(), gps.location.lng(),
gps.altitude.meters(),
gps.satellites.value(),
gps.time.hour(), gps.time.minute(), gps.time.second());
} else {
Serial.println("Waiting for fix...");
}
delay(1000);
}
TinyGPSPlus library handles NMEA parsing. SparkFun also publishes SparkFun_u-blox_GNSS_Arduino_Library — works against the AT6668 since the NMEA protocol is standard.
Configuration commands (to change update rate, etc.) use the $PCAS sentence prefix (CASIC-vendor-specific). Example: $PCAS02,1000*1E\r\n sets update rate to 1 Hz. Full command reference in CASIC documentation.
7. Cap + Cardputer ADV combined power profile
When the Cap LoRa-1262 is mated, the combined power draw is the sum of Cardputer ADV base + Cap operations:
| State | Cardputer ADV | Cap LoRa-1262 | Total |
|---|---|---|---|
| Idle (display backlight on, both radios sleeping) | ~120 mA | +1 µA | ~120 mA |
| GNSS tracking only | ~120 mA | +20-30 mA | ~150 mA |
| Meshtastic listen (RX + GNSS) | ~120 mA | +12 mA (LoRa RX) + 25 mA (GNSS) | ~157 mA |
| Meshtastic TX +14 dBm (LongFast burst) | ~120 mA | +63 mA peak | ~183 mA peak (during ~510 ms burst) |
| Meshtastic TX +22 dBm | ~120 mA | +163 mA peak | ~283 mA peak |
| Display backlight off (sleep variant) | ~30 mA | +12 mA | ~42 mA |
Battery life estimates for the 1750 mAh stock battery:
- Meshtastic LongFast continuous listen (no TX): ~10 hours
- Meshtastic LongFast with periodic TX every 10s: ~8 hours
- Meshtastic + GPS active continuously: ~6 hours
- Display backlight off, listen-only: ~30 hours
For 24-hour deployment, either replace battery with 3000+ mAh upgrade (Vol 9 § 4.1) or use solar-harvesting (Vol 9 § 3.3) or USB power.
8. Antenna upgrade options
The included 3 dBi rubber-duck antenna is adequate for short-range Meshtastic. For longer range:
| Antenna | Gain | Form factor | Approximate price |
|---|---|---|---|
| Stock rubber-duck | 3 dBi | 108 × 9.3 mm whip | Included |
| SignalPlus 6 dBi 915 MHz dipole | 6 dBi | Cargo-pocket foldable handheld | ~$25 |
| Comet GP-3 / GP-9 (omni, fixed) | 6-8 dBi | Long fiberglass rod, fixed-mount | ~$80-120 |
| 14 dBi 5-element Yagi (directional, fixed) | 14 dBi | ~600 mm boom | ~$80 (L-Com) |
| J-pole DIY (homebrew) | ~6 dBi | 12 AWG wire, ~400 mm | Free |
EIRP recalculation with antenna upgrade:
| TX power | Antenna gain | EIRP | EU g1 limit | Compliant? |
|---|---|---|---|---|
| +22 dBm | 3 dBi | +25 dBm | +14 dBm | No |
| +22 dBm | 6 dBi | +28 dBm | +14 dBm | No (even further over) |
| +14 dBm | 6 dBi | +20 dBm | +14 dBm | No |
| +8 dBm | 6 dBi | +14 dBm | +14 dBm | Yes (clamp TX further) |
Always recalculate EIRP for your region after an antenna change. Higher-gain antennas + EU g1 = lower allowed TX power.
Always attach an antenna before powering on. SX1262 PA can be damaged by open or short load. FM8625H protection helps but isn’t a guarantee. Vol 11 § 6 has the RF-safety details.
9. Resources
Datasheets
- Semtech SX1262: https://www.semtech.com/products/wireless-rf/lora-connect/sx1262
- ATGM336H-6N (AT6668) — CASIC vendor docs (search “AT6668 datasheet”)
- PI4IOE5V6408 GPIO expander: Diodes Inc.
- FM8625H RF switch: vendor docs
Libraries
- RadioLib (jgromes — canonical SX1262 driver): https://github.com/jgromes/RadioLib
- TinyGPSPlus (NMEA parsing): https://github.com/mikalhart/TinyGPSPlus
- SparkFun u-blox GNSS (works with AT6668 NMEA): https://github.com/sparkfun/SparkFun_u-blox_GNSS_Arduino_Library
Regulatory
- ETSI EN 300 220 (EU rules): https://www.etsi.org/
- FCC §15.247 (US rules): https://www.fcc.gov/general/title-47-code-federal-regulations
- ARIB STD-T108 (Japan): https://www.arib.or.jp/english/std_tr/telecommunications/desc/std-t108.html
- Meshtastic region preset docs: https://meshtastic.org/docs/configuration/region-by-country/
Community
- Meshtastic Cardputer ADV setup guide: https://meshtastic.org/docs/hardware/devices/
- The Things Network LoRa coverage maps: https://www.thethingsnetwork.org/community
Forward references in this series
- Meshtastic firmware configuration: Vol 6 § 5.1
- LoRa-APRS for licensed amateurs: Vol 6 § 5.2
- Range optimization recipes (per environment): Vol 9 § 3.1
- Solar-harvested fixed relay: Vol 9 § 3.3
- Antenna safety / never-TX-unloaded: Vol 11 § 6
This is Volume 5 of a twelve-volume series. Next: Vol 6 is the firmware ecosystem — M5Launcher, Bruce, NEMO, Marauder, Evil-M5, MicroHydra, Meshtastic, ESPHome, retro emulators, and niche apps.