Files
heltec-repeater/docs/FINDINGS.md
T

132 lines
7.4 KiB
Markdown

# Findings
## CONFIRMED
- Heltec V4.3 SX1262 pin mapping (NSS 8, SCK 9, MOSI 10, MISO 11, RST 12,
BUSY 13, DIO1 14): SPI write/readback passes, radio enters RX
(`radio_init: spi:true, reset:true, tcxo:true, result:ok`).
- TCXO is DIO3-controlled at 1.8 V. The first Calibrate after
SetDIO3AsTCXOCtrl latches a benign XOSC_START_ERR (0x20). Correct
sequence: enable TCXO -> clear errors -> STDBY_XOSC (verify chip mode 3)
-> clear -> Calibrate(0x7F) -> judge remaining errors. With that
sequence: device_errors=0, TCXO verified running.
- KCT8103L FEM on GPIO7 (power), GPIO2 (CSD), GPIO5 (CTX), CPS on DIO2.
RX works with CSD high + CTX low + DIO2-as-RF-switch; TX RF confirmed
with CTX high during TX.
- SX1262 IRQ flags latch ONLY for interrupts enabled in the
SetDioIrqParams mask. An unconfigured radio produces zero flags forever
— indistinguishable from "no traffic" without the raw probe.
- TX proof of life: SDR decoded our synthetic C1 format-A frame as valid
(crc_ok=1, mfr 0x4D8E "SLN", ID 00000001) at configured -9 dBm, and the
wM-Bus CRC blocks computed by firmware matched rtl_wmbus's checks.
- First real repeat observed: 100-byte Techem frame received, repeated
after 50.002 ms (configured 50 ms).
- Nooelec NESDR SMArt v5 R820T PLL wedges ("PLL not locked"), producing
gain-independent white noise on all frequencies until USB reset.
`usbreset 0bda:2838` reliably restores operation. Trigger correlated
with `rtl_test -t` direct-sampling probe.
- rtl-sdr-blog and osmocom rtl_sdr builds behave identically w.r.t. the
wedge; not a driver-fork issue.
- Real C1 traffic exists at this site: 8 meters in 10 min baseline
(docs/SDR_BASELINE.md); one strong plaintext meter (61471660), several
marginal encrypted Techem meters.
## ROOT-CAUSED BUGS (fixed)
1. XOSC_START_ERR treated as fatal -> init "failed" -> GFSK config was
skipped entirely -> radio sat in LoRa defaults; recovery level 1
reported "rx_restored" on an unconfigured radio. Fix: proper TCXO
verify + always apply configuration + recovery judges combined result.
2. DIO1 ISR callback was never registered (sx126x_set_irq_callback not
called) -> no notifications despite correct radio-side IRQ config.
3. `timeout bash -c "rtl_sdr | rtl_wmbus"` orphans the pipeline children
on timeout (device stays claimed). Apply timeout to rtl_sdr directly.
## LIKELY
- Fixed 255-byte RX capture adds up to ~20 ms artificial dead time per
frame (by construction; measured airtimes are consistent with it).
- The remaining CRC failures on long Techem frames are bit errors
accumulating over frame length, not a hard sensitivity floor: the same
meters decode cleanly when a few dB stronger (docs/RF_FRONTEND_TESTS.md).
## CONFIRMED (measurement methodology)
- WITHDRAWN: an earlier entry claimed "Heltec matched 124 of 127 SDR
originals (97 %)". That measurement was taken while the dongle was in its
degraded state, so the SDR decoded few originals and the Heltec matched
nearly all of them. With the observer state recorded, the honest figure is
58.5 % of SDR originals matched (600 s run, observer "degraded"), with
each receiver also decoding meters the other missed. See
docs/RF_FRONTEND_TESTS.md.
- Repeat payloads are byte-exact: 63/63 logged `tx_payload` values equalled
mode bytes + the received raw frame. No corruption in the RX->TX path.
- Real repeats are emitted as correct RF: aligning firmware TX timestamps
to bursts in the same stream's IQ confirmed 48 of 57 TX events (84 %),
with alignment error median 1.3 ms (max 3.6 ms) and burst duration within
0.5 ms (median) of the computed airtime. Firmware repeat delay measured
200.0 ms min/median/max against a 200 ms setting.
- Firmware TX reliability: 58/58 TX success over 600 s and 72/72 over
1200 s; tx_timeout 0, tx_failures 0, radio recoveries 0, MCU resets 0.
- The KCT8103L RX path is essential: holding CSD low in RX costs ~41 dB of
chip-referred level and drops the visible meter population from 18 to 1
(600 s per arm, docs/RF_FRONTEND_TESTS.md). No evidence of excessive
front-end gain hurting at this site.
- Repeat-delay accuracy: +1 to +8 us against a 200 ms setting across 72
repeats. RX deaf time per repeat ~225.7 ms median, of which 12.2 ms is
the fixed-255-byte RX tail and 13.4 ms the TX airtime (docs/TIMING.md).
- The SX1262 GFSK engine cannot express wM-Bus length semantics, so RX uses
a fixed 255-byte capture; RxDone therefore fires 9.4-17.1 ms after the
real end of frame and the firmware reconstructs the true timestamp.
- The observer, not the repeater, limits repeat DECODING. In the dongle's
full-sensitivity state our TX arrives ~36 dB stronger than meter traffic
and reaches RTL-SDR full scale; rtl-wmbus then receives our repeat with
1-2 byte errors and fails CRC (observed directly: transmitted
`...78534f4c5458...` decoded as `...78514f4c5448...`, rest bit-exact).
Raising the repeat delay 50 -> 200 ms improved SDR repeat decoding from
3 % to 30 % (demodulator level-estimate recovery).
- The dongle's sensitivity drifts ~17 dB within minutes of streaming, so
captures taken at "the same gain" at different times are NOT comparable.
Meter decodes and our own TX measurements must come from one stream
(`hil/capture_both.sh`).
- `rtl_sdr -g 0` selects AUTOMATIC gain, not 0 dB; lowest real fixed gain
is 0.9 dB. Low fixed gain is not a usable workaround while degraded:
at 0.9 and 7.7 dB nothing decoded at all.
- Synthetic C1 bursts from the Heltec (L = 19/40/60/98) are decoded by
rtl-wmbus as valid C1 with correct CRCs, including two airings of the
same frame 50/100/200 ms apart. TX framing is therefore correct and
standards-shaped independently of meter traffic.
- rtl_wmbus runs two demodulators, so one airing yields 1-2 output lines;
and rtl_sdr delivers ~81.92 ms buffers, so decode timestamps are
quantized - SDR timestamps cannot be trusted below ~100 ms resolution.
Correlation must use byte identity plus occurrence counting, not
timestamps alone.
- The Nooelec intermittently enters a deaf state (R820T I2C init failure /
PLL wedge). `hil/sdr_health.py` detects it by checking that noise tracks
tuner gain and the spectrum has structure; the harness aborts rather
than reporting an unattributable empty capture.
- "[R82XX] PLL not locked!" printed during tuning is BENIGN (emitted while
rtl_sdr probes and disables direct-sampling mode); it is not a wedge
indicator. The real symptom is railed, gain-independent noise.
## CONFIRMED (failure recovery)
- The recovery ladder works and escalates correctly, verified by fault
injection rather than assumption:
`inject standby` -> heartbeat sees chip_mode 2 -> level 1 restores RX;
`inject sleep` (configuration destroyed) -> heartbeat sees chip_mode 0 and
`config_intact:false` -> level 1 reports "failed" -> level 2 (full radio
reinit) restores RX, confirmed by chip_mode 5 + config intact + plausible
RSSI on the following heartbeats.
- Checking chip mode alone is NOT sufficient to detect a broken receiver: a
radio that lost its configuration can sit in RX looking healthy while
deaf to C1. The firmware therefore reads the sync-word registers back
every heartbeat (`config_intact`), and recovery levels only report success
when both the mode and the configuration verify.
## NEEDS TESTING
- Narrower RX bandwidth (156 kHz) vs current 234.3 kHz on weak meters.
- Long-run stability at >=100 and >=500 verified repeat events.
- Early-stop RX (poll GetRxBufferStatus) to cut the ~20 ms deaf tail.