Commit Graph
20 Commits
Author SHA1 Message Date
liquidraver 5f9c8b0d99 sx1276: fix loramac-node direction fast-path, resetAGC, add BW 62.5kHz
Three correctness fixes for the SX127x radio adapter on top of
Rastislav's initial sx1276 + patch commits:

1. _loramac_node flag (LoRaRadioBase + SX127xRadio):
   Guard the direction-only fast path in configureTx()/configureRx()
   so loramac-node always calls both Radio.SetTxConfig() and
   Radio.SetRxConfig().  Skipping either leaves TxTimeout=0 in the
   library, causing an immediate TX timeout callback, which prevents
   the _tx_signal from ever being raised and blocks the TX wait thread
   for TX_TIMEOUT_MS (5 s) — a 5-second RX blackout per transmission.
   This was the root cause of "boots but no RX".

2. SX127xRadio::resetAGC() override:
   The base-class resetAGC() calls startReceive() after hwResetAGC().
   During async RX the loramac-node modem mutex is STATE_BUSY, so
   lora_recv_async() returns -EBUSY, which sets _in_recv_mode = 0 and
   corrupts the receive state machine.  Override skips the call
   entirely — the loramac-node driver self-manages AGC.

3. BW 62.5 kHz support in loramac-node/sx1276.c + patch:
   Rastislav's 0004-lora-sx127x-62k5-bandwidth.patch adds BW_62_KHZ
   support to sx12xx_common.c (Zephyr side) but not to the loramac-
   node library itself.  Without this fix bandwidth index 3 hits the
   "while(1)" fatal guard in SX1276SetRxConfig/SX1276SetTxConfig.
   This commit patches sx1276.c directly and adds
   patches/modules/loramac-node/0001-sx1276-bw62k5.patch so the fix
   survives west update.  CMakeLists.txt is extended to apply module
   patches via the existing zephcore_apply_patches() mechanism.
2026-04-08 08:30:17 +02:00
liquidraver 33fa19a7f5 comment overhaul 2026-03-28 20:53:59 +01:00
liquidraver 57d392b124 close the 5ms race window before TX 2026-03-23 13:33:08 +01:00
liquidraver 68e2d1f598 update dutycycling and LBT to match newest zephyr API-s 2026-03-23 10:50:02 +01:00
liquidraver 4bd84ddf7e APC first test 2026-03-14 14:01:10 +01:00
liquidraver a71da9ba70 guard noisefloor sampling and agcreset while in rx duty cycle 2026-03-07 15:28:50 +01:00
liquidraver 2584e237f6 led switcher page in ui
rx duty cycle + noise floor measurement marriage
ui fixes
2026-03-06 22:15:13 +01:00
liquidraver 2d4b0c0a67 tweak noise floor reading 2026-03-05 16:34:28 +01:00
liquidraver 30379ee48a LoRaRadioBase volatile → atomic_t
LR1110 BUSY pin → interrupt-driven
2026-03-04 22:36:34 +01:00
liquidraver a4e96fa6e6 separate main events from housekeeping ones 2026-03-04 21:08:21 +01:00
liquidraver b3e3d4147b noise floor logic update (plus formatter cleanup) 2026-03-04 13:18:40 +01:00
liquidraver 383f23f448 port upstream: AGC reset, autoadd max hops, noise floor EMA, fixes
- AGC reset: proper warm sleep + Calibrate(ALL) + image recal for both
  SX126x and LR1110 (was cancel+restart / no-op respectively)
- Guard AGC reset against mid-receive (matches upstream RadioLib)
- Noise floor calibration: replace blocking 64-sample burst with
  single-sample EMA (alpha=1/8) per housekeeping tick — zero blocking,
  better temporal spread for real-world noise floor tracking
- Auto-add max hops: filter new contacts by hop count (NodePrefs,
  BaseChatMesh, CompanionMesh, ZephyrDataStore persistence)
- Fix CommonCLI memcmp("prefs", 4) → 5
2026-03-03 23:26:58 +01:00
liquidraver 225b59e0e5 rx duty cycle rework 2026-02-27 08:51:39 +01:00
liquidraver ced260c8c3 t1000 fixes 2026-02-26 14:34:18 +01:00
liquidraver 403914d126 rework sx and lr1110, improve BLE sync 2026-02-25 14:19:25 +01:00
liquidraver 6c7d52e725 t1000 gps fix 2026-02-24 15:50:11 +01:00
liquidraver 1332df0461 future-proof lora rx queue 2026-02-22 15:19:03 +01:00
liquidraver b6bc46b921 ESP OTA first implementation 2026-02-22 13:09:18 +01:00
liquidraver 521955bc05 clamp TX on station G2, refactor "set af" 2026-02-21 20:19:16 +01:00
liquidraver 8d1823d0b6 First iteration that seems to work 2026-02-20 12:43:13 +01:00