Commit graph

9 commits

Author SHA1 Message Date
jirogit
c725b82e77 Replace JP_STRICT build flag with runtime frequency detection
JP LBT mode now activates automatically based on operating frequency:
- CH25: 920.800MHz
- CH26: 921.000MHz
- CH27: 921.200MHz (ARIB STD-T108, 200kHz grid)

Changes:
- Add isJapanMode() to RadioLibWrapper using getFreqMHz()
- Add getFreqMHz() to CustomSX1262Wrapper and CustomLR1110Wrapper
- Remove #ifdef JP_STRICT throughout, replaced by isJapanMode()
- Remove -D JP_STRICT build flag from platformio.ini
- MAX_TEXT_LEN dynamically determined by CR at runtime via getMaxTextLen()

No build flags required: JP compliance activates automatically
when device is configured to Japan 3 frequencies.
2026-03-31 21:57:05 -07:00
jirogit
2d11d9fedb Add exponential backoff for channel busy detection
Replace fixed random(8000-22000ms) backoff with exponential backoff:
- 1st busy: 3-6s
- 2nd busy: 6-12s
- 3rd+ busy: 12-20s (capped)
- Reset counter on channel free

Results (48-byte simultaneous DM, JP SF12/BW125/CR4-5):
- 3/3 success, delivered within 0:23-0:45
- Previous fixed backoff: 1:03-3:55
2026-03-31 21:57:05 -07:00
jirogit
c5bacd7de9 JP_STRICT: dynamic MAX_TEXT_LEN based on runtime CR value
Instead of compile-time LORA_CR define, MAX_TEXT_LEN is now determined
at runtime by reading the actual coding rate from the radio hardware.

Added getMaxTextLen() to RadioLibWrapper and Dispatcher:
- CR4/5: 48 bytes (~16 JP chars, TX ~3808ms)
- CR4/6: 32 bytes (~10 JP chars)
- CR4/7: 24 bytes (~8 JP chars)
- CR4/8: 16 bytes (~5 JP chars, default)

getCodingRate() added to CustomSX1262Wrapper to read codingRate
from RadioLib PhysicalLayer at runtime.

Tested: 48-byte limit with LORA_CR=5, 16-byte limit with LORA_CR=8.
2026-03-31 21:57:05 -07:00
Wessel Nieboer
52b9d877a6 Use hardware channel activity detection for checking interference 2026-03-31 21:57:05 -07:00
João Brázio
9a95e25ef2
Remove unused RX boosted gain mode functions and related preprocessor directives across multiple variants 2026-03-05 18:38:57 +00:00
Wessel Nieboer
a2dc2eb50c
when doing AGC reset, call Calibrate(0x7F)
1. warm sleep
2. wake to stdby
3. Calibrate(0x7F) to reset all internal blocks
4. re-apply DIO2 RF / boosted gain & register patch to make sure
everything is as it was
2026-02-28 19:09:25 +01:00
Chris
c16bcd2fe3 Expose a counter to track RadioLib receive errors
This change counts when readData returns an err code other than RADIOLIB_ERR_NONE. In most cases this is going to be a CRC error. This counter is exposed in the `stats-packets` command, and in the repeater stats payload (4 additional bytes to the payload, which is now 56 bytes with this change. My incompetent robot claims the total payload size is 96 bytes (unverified but probably close).
2026-01-24 20:06:29 -08:00
Jaroslav Škarvada
07e7e2d44b
companion: Suspend radio when hibernating
This should significantly reduce power consumption in hibernation.

Fixes: #1014

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
Signed-off-by: Frieder Schrempf <frieder@fris.de> # generalize for all radios and UIs
2025-11-22 15:05:01 +01:00
recrof
6be8e19a9f move radiolib wrappers to dedicated directory 2025-07-13 11:37:33 +02:00
Renamed from src/helpers/RadioLibWrappers.h (Browse further)