Add timed cw and cw2 commands for SX1262 and LR1110
Support fractional seconds, guard active packet work, keep the MCU awake, and restore reception after carrier tests. Include regression coverage and independent-radio RF validation for the V4 and T1000-E.
This commit is contained in:
1 parent
239f6a84f5
commit
9de1373bd9
27 files changed
+1153
-2
No files matched your search
@@ -0,0 +1,48 @@
|
||||
# Carrier-wave RF checks
|
||||
|
||||
`cw` and `cw2` transmit a continuous, unmodulated carrier at the selected
|
||||
profile's frequency and the configured TX power. They are available in the
|
||||
shared ASCII CLI on SX1262-family and LR1110 builds, including repeaters,
|
||||
Companions, room servers, and sensors that use that CLI.
|
||||
|
||||
| Command | Action |
|
||||
| --- | --- |
|
||||
| `cw on` | Use the active primary frequency for 10 seconds. |
|
||||
| `cw on 2.5` | Use the active primary frequency for 2.5 seconds. |
|
||||
| `cw2 on 0.75` | Use the active second profile for 0.75 seconds. |
|
||||
| `cw off` or `cw2 off` | Stop the carrier immediately. Either name stops it. |
|
||||
| `get cw` or `get cw2` | Show which carrier is active and its remaining seconds. |
|
||||
|
||||
`set cw ...` and `set cw2 ...` are also accepted. Durations range from
|
||||
0.001 to 60 seconds, rounded to milliseconds. The deadline runs in the main
|
||||
loop, so it is not a precision pulse generator or a hardware cutoff.
|
||||
|
||||
`cw2` requires an active `radio2` or `tempradio2` profile in `rxtx` mode.
|
||||
An `rx` or disabled second profile cannot transmit a carrier. `cw` uses
|
||||
`tempradio` when that is the current primary profile. There is one physical
|
||||
transmitter: a carrier uses one profile at a time and ignores the cross-TX
|
||||
setting. Stop it before selecting the other carrier. Repeating `on` on the
|
||||
same profile restarts the duration.
|
||||
|
||||
Packet transmission, reception, profile scanning, CAD, and receive recovery
|
||||
checks pause during the carrier. The firmware keeps the MCU awake to service
|
||||
the deadline, controls the board's external amplifier, and resumes normal
|
||||
reception and profile scanning afterward. It rejects entry during a packet
|
||||
or a busy radio. Profile retuning waits until the carrier stops; replacement
|
||||
or expiry of the active second profile stops its carrier. Nothing about CW
|
||||
is saved across reboot.
|
||||
|
||||
Use the local USB or BLE console for immediate replies and manual stopping.
|
||||
An on-air CLI reply must wait until the carrier ends because LoRa packets
|
||||
cannot transmit during the test.
|
||||
|
||||
A second radio on the same frequency can detect the carrier using
|
||||
instantaneous RSSI. Compare readings before, during, and after transmission;
|
||||
CAD and packet counters are not carrier detectors. This confirms RF activity,
|
||||
not calibrated output power, frequency accuracy, antenna match, or SWR.
|
||||
Afterward, exchange ordinary LoRa packets to verify both RX and TX recovery.
|
||||
|
||||
The reproducible bench witness is `tools/hil/cw_observer.cpp`, built with
|
||||
`tools/hil/cw_observer.ini` on a separate RAK4631. It never transmits on its own.
|
||||
See the [hardware validation](carrier_wave_validation.md) for measured results,
|
||||
reproduction steps, and the tested preamble settings.
|
||||
@@ -0,0 +1,87 @@
|
||||
# CW and CW2 validation
|
||||
|
||||
Tested on the MercerWoodMesh lab Pi on September 14, 2026 (Pacific), using
|
||||
base commit `9241ccc253ad2f8ac2c9a2fe756f59ba2f52505d` plus the CW changes.
|
||||
Test images are marked `v1.17.1.6-cw-test-9241ccc2`; they are development images.
|
||||
|
||||
A separate RAK4631 sampled instantaneous RSSI every approximately 10 ms.
|
||||
The transmitting boards ran the Full V4 repeater and Full T1000-E Companion
|
||||
builds. Both were configured for −9 dBm chip TX power, with profiles at
|
||||
909.5 and 919.5 MHz, BW125, SF7, CR5, and 32-symbol preambles.
|
||||
|
||||
| Check | V4 / SX1262 | T1000-E / LR1110 |
|
||||
| --- | --- | --- |
|
||||
| `cw on 0.25` measured duration | 0.25 s | 0.25 s |
|
||||
| `cw on 1.25` measured duration | 1.25 s | 1.25 s |
|
||||
| Manual stop approximately 1 s into a 5 s request | 1.01 s | 1.01 s |
|
||||
| `cw on 1.25` after enabling RXPS | 1.26 s | 1.25 s |
|
||||
| `cw2 on 1.25` on the second frequency | 1.25 s | 1.25 s |
|
||||
| Primary-frequency RSSI change while CW2 transmits | 0 dB | 0 dB |
|
||||
| Paired RX and TX recovery checks | 5/5 passed | 5/5 passed |
|
||||
|
||||
The observer saw roughly −56 to −57 dBm during V4 carriers and −67 to
|
||||
−71 dBm during T1000-E carriers, against a −112 to −113 dBm baseline.
|
||||
Readings returned to baseline after timeout and manual stop. These are
|
||||
received signal readings, **not calibrated transmitter output measurements**.
|
||||
|
||||
RX recovery used CRC-valid LoRa test payloads and the DUT's receive counter.
|
||||
TX recovery used each DUT's MeshCore advertisement, received with valid CRC
|
||||
by the observer. Both DUTs finished in RX, with CW and radio2 disabled and
|
||||
no outbound packet pending. The observer has no autonomous transmission.
|
||||
|
||||
## Software checks
|
||||
|
||||
- 1,436 native tests passed, including new checks that CW holds queued packets,
|
||||
services its deadline, and prevents transmission in the same loop where a
|
||||
received command starts CW.
|
||||
- Compiled production-method tests cover fractional input, malformed durations,
|
||||
bounds, timer rollover, busy/IRQ rejection, RXPS cleanup, board TX/RX callbacks,
|
||||
profile selection and replacement, failed TX entry, stop retries, and failed
|
||||
RX restart. An ESP32 sleep test covers a carrier with USB disconnected.
|
||||
- Full V4 repeater, Full T1000-E Companion, and ordinary STM32
|
||||
`RAK_3x72_companion_radio_usb` builds passed. The STM32 build is a compilation
|
||||
check, not an RF test of that board.
|
||||
- An additional existing OTA sleep test still expects the old
|
||||
`ota::ota_ctx().apply_pending` spelling. It fails against unchanged HEAD
|
||||
`src/Mesh.cpp` and test-file contents; the actual implementation uses
|
||||
`ota_context_if_active()`. This is separate from the CW changes.
|
||||
|
||||
## Bench qualifications
|
||||
|
||||
The first CW2 request arrived before radio2's existing delayed activation.
|
||||
The harness now polls `get radio2.status` for the active mode before testing.
|
||||
|
||||
An initial V4 dual-profile packet probe used a 120-symbol preamble against
|
||||
32-symbol profiles. A comparison around another CW2 burst received **0/8
|
||||
before and 1/8 afterward** with that mismatched probe, versus **8/8 before
|
||||
and 8/8 afterward** with a matching 32-symbol probe. The configured preamble
|
||||
also sets the driver's preamble-detection hold timeout, so a much longer
|
||||
incoming preamble can outlast that hold and be interrupted by scanning.
|
||||
The final dual-profile recovery checks use matched preambles. This finding
|
||||
does not establish general packet-loss performance for every scan combination.
|
||||
|
||||
These checks establish RF activity, selected-frequency behavior, and recovery
|
||||
on the tested boards. They do not measure spectral purity, frequency error,
|
||||
SWR, calibrated power, or months of uptime. Carrier timeouts are serviced by
|
||||
the main loop and depend on that loop remaining responsive.
|
||||
|
||||
## Reproduction
|
||||
|
||||
Append `tools/hil/cw_observer.ini` to `extra_configs` in `platformio.local.ini`,
|
||||
preserving existing entries, and build `pio run -e cw_observer_rak4631`.
|
||||
Flash that application onto a separate lab RAK4631. Do not run PlatformIO
|
||||
concurrently with another build or upload in the checkout.
|
||||
|
||||
Configure the lab DUT's primary profile as above, disable radio2, set TX power
|
||||
to −9 dBm, and reboot to apply saved primary settings. Then run:
|
||||
|
||||
```sh
|
||||
python3 tools/hil/carrier_wave.py --dut /dev/serial/by-id/DUT \
|
||||
--observer /dev/serial/by-id/OBSERVER --role repeater --output cw-results.json
|
||||
```
|
||||
|
||||
Use `--role companion` for the T1000-E. The harness changes lab radio2/RXPS
|
||||
settings and emits short RF bursts and packet probes. It is for test boards.
|
||||
|
||||
Compact evidence: [carrier_wave_results.json](../tools/hil/carrier_wave_results.json).
|
||||
Command guide: [carrier-wave RF checks](carrier_wave.md).
|
||||
@@ -3,6 +3,9 @@
|
||||
See [two LoRa profiles](radio_profiles.md) for `radio2`, `tempradio2`, scheduling,
|
||||
RX-only mode, cross-transmission policy, and optional radio preambles.
|
||||
|
||||
See [carrier-wave RF checks](carrier_wave.md) for `cw on [seconds]`,
|
||||
`cw2 on [seconds]`, and stopping a carrier with `off`.
|
||||
|
||||
For copy/paste on/off recipes and the differences from Full Companion, see
|
||||
[feature switches by role](role_feature_switches.md). The
|
||||
[USB web console](https://flasher.meshcore.io/console) opens the default ASCII
|
||||
|
||||
@@ -2,6 +2,10 @@
|
||||
|
||||
Below are the commands you can enter into the Terminal Chat clients:
|
||||
|
||||
For a timed RF carrier test on SX1262 or LR1110, use `cw on 2.5` or
|
||||
`cw2 on 2.5`, then `cw off` to stop early. See [carrier-wave RF checks](carrier_wave.md)
|
||||
for profile selection, limits, and status commands.
|
||||
|
||||
## Companion WiFi browser terminal
|
||||
|
||||
On ESP32 WiFi Companions with WebConfig, open the node's LAN IP address and
|
||||
|
||||
Reference in new issue
Block a user