Fault Injection & Debugging
Seeded LoRa and sub-GHz RF packet-loss testing in CI
Inject 45 dB path fades and seeded packet errors between two LoRa nodes and verify retransmission backoff in CI.
Sub-GHz LoRaWAN and custom SX1262/SX1276/SX1280 protocols fail in the field when ACK packets drop during deep fades or drivers poll SPI while the radio BUSY pin is still high.
CircuitTwin radio scenes model time-on-air to 1 ns, Friis link budgets, BUSY-pin gating and seeded PER determinism (accuracy/radio-twins-2026-11-14.json) so two real MCU ELFs test link recovery automatically.
Radio twin acceptance behaviors
| Behavior | Modelled fidelity | Bug caught |
|---|---|---|
Time-on-Air (ToA) | Exact LoRa SF/BW/CR formula to 1 ns | Premature RX window close before preamble arrives |
BUSY pin gating | SX1280/SX1262 command busy hold | SPI write dropped because firmware skipped BUSY poll |
Seeded attenuation | attenuation_db fault at fixed ms | Infinite retry loop or missed ADR backoff |
Local CLI workflow
Shell - run two-node LoRa fade test
ct test run --json --junit results/lora.xml tests/lora-fade.suite.yamlSuite & fault configuration
tests/lora-fade.suite.yaml
version: 1
scene: scenes/sx1276-two-node.scene.json
tests:
- name: lora-45db-fade-retransmit
seed: 42
timeout_ms: 6000
faults:
- at_ms: 400
link: rf0
kind: attenuation_db
delta_db: 45.0
duration_ms: 1000
expect:
console_contains: "RETRANSMIT_ACK_OK"
exit_code: 0CI pipeline integration
.github/workflows/lora-ci.yml
name: LoRa Link Recovery CI
on: [push, pull_request]
jobs:
lora:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: circuittwin/action@v1
with:
suite: tests/lora-fade.suite.yamlTroubleshooting checklist
| Symptom | Fix |
|---|---|
| SX1280/SX1262 ignores SetTx command | Wait for the BUSY pin to go low before asserting NSS on every opcode transaction. |
| RX node never triggers RxDone IRQ | Verify both nodes configure matching sync word, spreading factor, bandwidth and IQ inversion. |
Frequently asked questions
| Question | Answer |
|---|---|
| Which radio transceivers have published acceptance records in CircuitTwin? | Semtech SX1276 and SX1280 have published clean-tree radio-twin acceptance records under /docs/accuracy, alongside corpus definitions for SX1262, CC1101 and nRF24L01+. |