Commit graph

912 commits

Author SHA1 Message Date
jirogit
56a2d93aa4 Fix build for non-FreeRTOS and non-SX1262 platforms
- Replace vTaskDelay(1) with YIELD_TASK() macro for platform compatibility
  (FreeRTOS: vTaskDelay, others: delay)
- Make getCodingRate() and getFreqMHz() non-pure virtual with defaults
  (default CR4/8, default freq 0.0f for unknown platforms)
- Add getCodingRate() and getFreqMHz() to CustomSTM32WLxWrapper

All environments now build successfully.
2026-03-31 21:57:05 -07:00
jirogit
4276d84070 Remove TX duration debug logging
_tx_start_ms and TX duration logging were added for 4-second
airtime verification and are no longer needed.
2026-03-31 21:57:05 -07:00
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
73ec37657c Add getCodingRate() to CustomLR1110 and CustomLR1110Wrapper
LR1110 has codingRate as protected field in LR_common.h, so
getCodingRate() is implemented in CustomLR1110 class directly,
and exposed via CustomLR1110Wrapper override.

This enables dynamic MAX_TEXT_LEN calculation for T1000-E
under JP_STRICT mode.
2026-03-31 21:57:05 -07:00
jirogit
d7045a1020 Fix missing newline at end of file in CustomSX1262.h 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
jirogit
eb58523775 JP_STRICT: adjust MAX_TEXT_LEN based on LORA_CR setting
MAX_TEXT_LEN is automatically selected based on the LORA_CR build flag
defined in platformio.ini (e.g. -D LORA_CR=5).

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)

To enable CR4/5 for Japan, add -D LORA_CR=5 to your board's
build_flags in platformio.ini. Set LORA_CR=5 for WioTrackerL1 and RAK WisMesh Tag.
2026-03-31 21:57:05 -07:00
jirogit
f4519b19c8 JP_STRICT: use absolute -80dBm RSSI threshold for LBT (ARIB STD-T108)
Replace relative threshold (_noise_floor + _threshold) with absolute
-80dBm as specified by ARIB STD-T108 for carrier sense detection.

Previous relative threshold (~-99dBm) caused false busy detection
from environmental noise. -80dBm matches the legal requirement and
reduces spurious backoff.
2026-03-31 21:57:05 -07:00
jirogit
7bae0d8405 Add JP_STRICT 5ms continuous RSSI sensing before TX (ARIB STD-T108)
Under JP_STRICT mode, add energy-based carrier sensing loop before CAD:
- Sample RSSI continuously for >= 5ms before each TX attempt
- If RSSI exceeds threshold at any point, trigger random backoff
- ARIB STD-T108 requires energy-based sensing; LoRa CAD alone is
  insufficient as it only detects LoRa preambles

This satisfies the minimum 5ms continuous sensing requirement for
the 920.6-922.2 MHz zone (specified low power radio, LBT mode).

Test results (JP LoRa SF12/BW125/CR4-8, simultaneous DM):
- 16-char: 2/2 success, delivered within 1:03-1:50
- 1-char:  3/4 success, delivered within 0:46-2:11
           (shorter airtime reduces RSSI detection window)
2026-03-31 21:57:05 -07:00
jirogit
309a090958 Add JP_STRICT mode: enforce MAX_TEXT_LEN for ARIB STD-T108 compliance
JP_STRICT limits MAX_TEXT_LEN to 1*CIPHER_BLOCK_SIZE (16 bytes) to keep
TX time under 4 seconds on SF12/BW125/CR4-8 (Japan LoRa settings).

SF12/BW125/CR4-8 airtime:
  60 bytes total packet = ~3809ms (within 4s limit)
  packet overhead ~44 bytes, leaving 16 bytes for text payload

Enabled only for WioTrackerL1 and RAK_WisMesh_Tag builds.
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
Brian Widdas
811ac1cd02 Add missing methods in ESPNOWRadio()
ESP-NOW radios (ie, Generic_ESPNOW_* variants) do not compile due to
missing methods

Changes in January 2026 (019bbf74) to add additional stats (receive errors)
to CMD_GET_STATS was not implemented in the ESPNOWRadio() class

Changes in March 2026 (9a95e25e) to add setRxBoostedGainMode to all devices
rather than just SX1262/SX1268 were not applied to the ESPNowRadio() driver

Specifically, this change adds the following to ESPNOWRadio()
* getPacketsRecvErrors()    - always returns 0
* getRxBoostedGainMode()    - always returns false
* setRxBoostedGainMode()    - does nothing
2026-03-30 04:25:08 +01:00
Wessel Nieboer
728b586c3a
Address comments 2026-03-23 14:31:08 +01:00
Wessel Nieboer
741392889d
Fix memcp compare length off by one
Co-authored-by: ViezeVingertjes <michael.overhorst@gmail.com>
2026-03-23 14:31:08 +01:00
Wessel Nieboer
0aa0ec1f16
Add get/set dutycycle command
We translate to af internally, it's easier to store and doesn't break
stored prefs. Made get/set af command show deprecated, but it still
works fine.
2026-03-23 14:31:07 +01:00
liamcottle
1d61df72c3 add define for reserved group data type 2026-03-23 23:09:35 +13:00
liamcottle
ed326255d5 add support for direct paths when sending group data 2026-03-23 21:46:21 +13:00
Liam Cottle
91aed048e9
Merge pull request #1928 from dz0ny/feat/grp-data-upstream
feat: Add support for PAYLOAD_TYPE_GRP_DATA
2026-03-23 21:41:51 +13:00
Rastislav Vysoky
285fc685c5 allow to set lower LoRa frequency 2026-03-22 13:54:42 +01:00
Wessel Nieboer
ff5aad71a6
Make radio.rxgain true by default after upgrades 2026-03-22 08:35:32 +01:00
Quency-D
f6cfed66b3 add heltec_mesh_node_t096 board. 2026-03-20 15:56:09 +08:00
Janez T
ae9fcb3c0b fix: Rename grp dev type
ref: #1928
2026-03-19 09:35:02 +01:00
Janez T
2f68769185 fix: Widen grp data type
ref: #1928
2026-03-19 09:25:42 +01:00
Janez T
1fb26e7623 fix: Drop grp data timestamp
ref: #1928
2026-03-19 09:22:12 +01:00
Janez T
f25d7a882a fix: Align channel data framing
ref: #1928
2026-03-18 20:14:22 +01:00
Janez T
a21b83b127 fix: address comments
ref:
2026-03-18 20:09:11 +01:00
Janez T
9b84278607 feat: Add support for PAYLOAD_TYPE_GRP_DATA
Docs changes are to reflect how it is currently in fw

This adds ability to send datagram data to everyone in channel
2026-03-18 20:08:52 +01:00
João Brázio
83b7a95679
Merge pull request #2 from weebl2000/2026/remote-lna
Make sure LR1110 builds
2026-03-16 09:55:00 +00:00
João Brázio
92bef49c55
Merge branch 'dev' into 2026/remote-lna 2026-03-16 09:40:10 +00:00
João Brázio
274e00df50
Merge remote-tracking branch 'upstream/dev' into 2026/remote-lna 2026-03-16 09:37:55 +00:00
Wessel Nieboer
0e62240119
Set AUTO_OFF_MILLIS to 0 for E213, E290 2026-03-15 15:51:31 +01:00
Wessel Nieboer
696323c11b
Fix Heltec E213 and E290 e-ink board builds 2026-03-15 15:51:25 +01:00
Wessel Nieboer
9af332b6e6
Make sure LR1110 builds 2026-03-13 13:48:36 +01:00
Scott Powell
bb8dc5b55b Merge branch 'main' into dev 2026-03-12 18:14:56 +11:00
ripplebiz
792f299986
Merge pull request #1873 from Specter242/codex/sensecap-solar-led-poweroff-parity
sensecap solar: add poweroff/shutdown support and nrf52 PM parity
2026-03-12 18:13:14 +11:00
Liam Cottle
8ac8c4d59d
Merge pull request #1991 from weebl2000/prevent-auto-restart-ble-nrf52
Prevent auto-restarting BLE when disabling it on nRF52
2026-03-11 22:05:25 +13:00
Liam Cottle
8a3262cd70
Merge pull request #1483 from ssp97/dev
fix: avoid redundant redefinition of SX126X_DIO3_TCXO_VOLTAGE
2026-03-11 21:49:31 +13:00
Liam Cottle
a10476efd7
Merge pull request #1845 from lincomatic/repeaterbaud
don't limit bridge_baud to 115200
2026-03-11 11:51:00 +13:00
Wessel Nieboer
e3afbf975e
Prevent auto-restarting BLE when disabling it on nRF52
If client is still connected, client would automatically reconnect
immediately thus keeping BLE on

fixes #1933
2026-03-10 14:31:58 +01:00
Scott Powell
2715d3a113 * Dispatcher::next_tx_time init fix 2026-03-08 23:58:28 +11:00
ripplebiz
cf0cc851d4
Merge pull request #1297 from ViezeVingertjes/feature/duty-cycle-token-bucket
Implement token bucket duty cycle enforcement
2026-03-08 23:54:32 +11:00
ripplebiz
29be7e293c
Merge pull request #1877 from DanielNovak/fix-countbefore-sentinel-regression
Fix countBefore regression: replace sentinel with getOutboundTotal()
2026-03-07 18:48:02 +11:00
Liam Cottle
aad56bb334
Merge pull request #1936 from Quency-D/dev-heltec-tracker-v2
Update Heltec Tracker v2 to version KCT8103L.
2026-03-07 17:59:19 +13:00
Liam Cottle
5dddb8a3a1
Merge pull request #1350 from weebl2000/sync-gps-time-30min
Sync gps time every 30min
2026-03-07 17:11:07 +13:00
Quency-D
cdca79540f Update Heltec Tracker v2 to version KCT8103L. 2026-03-06 14:19:07 +08: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
João Brázio
f858f2e4bb
Rename sx126x_rx_boosted_gain to rx_boosted_gain 2026-03-05 18:14:47 +00:00
João Brázio
8df87d5609
Merge remote-tracking branch 'upstream/dev' into 2026/remote-lna 2026-03-05 17:21:38 +00:00
Scott Powell
e233346bf0 * repeater: new "get/set loop.detect {off | minimal | moderate | strict }" 2026-03-05 16:26:09 +11:00