Skip to content

Add dual radio profiles and scheduled switching - #3638

Open
mikecarper wants to merge 9 commits into
meshcore-dev:devfrom
mikecarper:radio2
Open

mikecarper wants to merge 9 commits into
meshcore-dev:devfrom
mikecarper:radio2

Conversation

@mikecarper

@mikecarper mikecarper commented Oct 20, 2026 •

Copy link
Copy Markdown

Adds a second LoRa profile on one transceiver, with temporary overrides and scheduled changes for Companion, Repeater, Room Server, and Sensor. Each scheduling command has one pending slot. Crossover defaults to off.

All eight RadioLib wrappers use the faster shared switching path. The scheduler skips duplicate radio status reads and avoids revalidating an already-applied profile. Each real retune checks for BUSY, an in-progress reception, and a completed packet. The timing uses a 4.6-symbol minimum visit and the measured RX-to-RX switch time plus 10%.

The shared path covers SX1262, SX1268, SX1276, LLCC68, STM32WL, LR1110, LR1121, and LR2021. SX1262 and LR1110 also use guarded warm switching where supported. LR2021 uses host-controlled switching in this PR. T-Deck, ThinkNode M9, and the new T-LoRa Pager Companion builds release SPI between display strips so the radio profile scheduler can run during redraws. The Pager has USB and Bluetooth builds for its SX1262 and LR1121 modules. Command syntax and examples are in docs/radio_profiles.md.

Hardware retune timings

Mean milliseconds per complete receive-to-receive retune on the same physical board. For each case, we measured 500 radio switches after 25 warm-up switches.

Board Change A · Stock upstream 88bbae299 B · Previous PR c8e2bc85f C · Prior PR 5bd3cd3a9 D · Current PR e7f12b632
Heltec V4.3 Frequency only 7.417 ms 0.599 ms 0.531 ms 0.532 ms
Heltec V4.3 Frequency, bandwidth, SF, and coding rate 7.418 ms 0.704 ms 0.655 ms 0.649 ms
RAK3401 Frequency only 6.809 ms 0.552 ms 0.497 ms 0.503 ms
RAK3401 Frequency, bandwidth, SF, and coding rate 6.797 ms 0.677 ms 0.623 ms 0.630 ms

The receive-only bench harness used the Repeater radio code from each revision. Stock used manual retuning between the two settings. All three PR revisions used the automatic radio2 scheduler. The Heltec V4.3 ran at 80 MHz and the RAK3401 ran at 64 MHz.

Both cases switched between 906.525 and 907.525 MHz. The frequency-only case held BW 62.5 kHz, SF7 and CR 4/5. The mixed case alternated that modem tuple with BW 500 kHz, SF5 and CR 4/7. Both ends used a 32-symbol preamble. The original firmware on both boards was restored and verified.

Focused radio tests and the W12 Repeater build passed for the shared timing update. The earlier timing revision also passed the Heltec V4 USB Companion build and T-Deck display test. The current PR revision also passed 44 host tests and built the M9 USB Companion and all four T-LoRa Pager Companions. The physical timings are for the two boards in the table.

Support radio2, temporary profiles and one schedule slot per command family. Preserve reply affinity, shared airtime and session expiry with guarded warm switching on SX1262 and LR1110.

Validate native routing, scheduling, persistence and driver failure paths; build Companion, repeater, room and sensor roles on ESP32, nRF52 and STM32.
Render through a PSRAM canvas and release SPI between bounded display strips. Service the radio at safe checkpoints and retain the tested 8.888888 MHz SPI and guarded modem/IQ caches.

Verify scaled pixel parity, transaction boundaries, partial updates, allocation failure and sleep/wake behavior.
@mikecarper

Copy link
Copy Markdown
Author

https://www.youtube.com/watch?v=YB6AKfYkQNI Example use case

@IoTThinks

Copy link
Copy Markdown
Contributor

This PR looks interesting.
What is the usecase for this?

Have a nice day.

@mikecarper

Copy link
Copy Markdown
Author

What is the usecase for this?

a few things; 2nd mesh for data like pictures. Lora firmware updates. Running an rnode. Companion repeat and main mesh running at the same time. Poor man's frequency bridge using just one radio.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants