Commit Graph
67 Commits
Author SHA1 Message Date
liquidraver 2f86310500 port lora e5 mini 2026-06-21 20:38:57 +02:00
liquidraver 0f98ecec93 eink full refresh patch 2026-06-19 11:24:47 +02:00
John MillingtonandClaude Opus 4.8 ece01b4f7c fix(esp32): init controller encryption so LE Secure Connections pairing works
The ESP32 BLE controller glue guards ble_enc_funcs_reset() on
CONFIG_BT_CTRL_BLE_SECURITY_ENABLE, an ESP-IDF sdkconfig symbol that is never
defined in a Zephyr build. The call is therefore compiled out and the
controller's LE Secure Connections encryption table is left uninitialised, so
SC pairing derives a wrong session key and the link is terminated with HCI
reason 0x3D (MIC failure).

This breaks pairing for SC-capable centrals (e.g. Pixel 7 / recent Android);
legacy-pairing centrals use a different path and are unaffected. The existing
CONFIG_ESP32_BT_CTLR_LE_SECURITY_ENABLE=y only sets .enc_en and does not reach
this guard.

Correct the guard to BLE_SECURITY_ENABLE, which esp_bt.h already derives from
CONFIG_ESP32_BT_CTLR_LE_SECURITY_ENABLE (the Zephyr knob) and already uses for
.enc_en. Carried as a managed hal_espressif patch via the existing
zephcore_apply_patches() mechanism (mirrors the loramac-node patch).

Verified on Heltec Wireless Tracker (ESP32-S3): device reaches security
level 4, pairing complete bonded=1; Pixel 7 bonds over SC and the companion app
communicates; older Samsung still pairs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-17 14:28:29 +12:00
liquidraver bf71542751 Make Rxdutycycling Great Again 2026-06-13 08:23:01 +02:00
liquidraver b7c72fe5ee route CAD_DONE/CAD_DETECTED to DIO1 so LR1110 LBT CAD completes (radio2 audit) 2026-06-11 13:58:08 +02:00
liquidraver 2ad185bab4 license "refactor" :) 2026-06-07 22:47:17 +02:00
liquidraver 4353936328 lr2021 experiments 2026-06-06 15:33:37 +02:00
liquidraver a77e877ad8 linux native Pi fixes 2026-06-03 13:48:54 +02:00
liquidraver 3c94b83f70 linux native fixup #3 2026-06-02 16:08:51 +02:00
liquidraver eb4e6583c7 linux native fixup #2 2026-06-02 14:50:31 +02:00
liquidraver fac4716ee1 counter zombie packets with header_error check 2026-06-02 13:21:46 +02:00
liquidraver eded1d7f04 linux native fixup #1 2026-06-01 22:29:53 +02:00
liquidraver 051adef93e native linux initial commit 2026-05-24 20:06:49 +02:00
liquidraver 3441caf8b0 new rx busy latch 2026-05-14 22:24:48 +02:00
liquidraver e78e197dee sx1262 fixes
- calibrate_image: revert to datasheet band table.  Narrow ±2 MHz
  window had truncation bug placing 433/869 MHz operating freq
  outside their own calibration windows.  DS §9.2.1 confirms cal
  is range-validity, not point-precision
- reset_agc: K_FOREVER mutex → K_MSEC(50).  Was holding dispatcher
  thread up to ~3 s if a long TX/RX held the SPI lock.  Now bails
  with WARN log; caller retries next maintenance interval.
2026-05-11 11:26:33 +02:00
liquidraver 43a31e190d fix CAD IRQ status clear 2026-05-06 10:07:44 +02:00
liquidraver 6bc3ba7405 disable default duty cycling + SX driver fixes 2026-05-05 21:56:00 +02:00
liquidraverandClaude Opus 4.7 5e7adfb130 normalize source-file line endings to LF
Add .gitattributes rules so .c/.h/.cpp/.hpp are always stored as LF
(prevents EOL drift from editors with autocrlf-true defaults), and
renormalize the 30 source files that had drifted to CRLF in the index.

Pure mechanical change — `git diff --ignore-cr-at-eol` is empty.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-05 14:56:44 +02:00
liquidraver e8f14442bf ramp time to 800us and duty cycle to 13/3 2026-05-05 14:52:05 +02:00
liquidraver 9282ac8c9c stay in full RX after TX for 3 seconds
agc reset on every lora_recv_duty_cycle entry
2026-05-01 20:46:12 +02:00
liquidraver 624fc3306c tune duty cycling 2026-05-01 08:58:55 +02:00
liquidraver 7c31045bd4 fix hang near noisefloorcalibrate 2026-04-30 21:35:06 +02:00
liquidraver 961fc1ec80 sx1262 driver fixes
-Removed broken §15.3 implicit-header workaround (wrong addresses, wrong bit, wrong condition)
-Initialize data->rx_boost_enabled from config->rx_boosted (DTS) instead of hard-coded false
-Re-apply RX gain after the first SetRx in lora_recv_async to match restart_rx / recv_duty_cycle
-Re-issue CalibrateImage(operating_freq) after Calibrate(ALL) to keep image-rejection band correct on EU868 / 433 MHz / 779 MHz
-rx_cb_gen converted from uint32_t to atomic_t — atomic_set/get/inc at all 13 sites; local snapshot is now atomic_val_t
2026-04-30 21:18:50 +02:00
liquidraver 8a7dacf55d increase sx1262 power to 140mA 2026-04-30 20:52:21 +02:00
liquidraver 9938d0e6ca fix a race condition in sx driver 2026-04-30 12:56:42 +02:00
liquidraver 4506280162 fix(sx126x): recover and re-arm duty-cycle RX after BUSY timeout 2026-04-29 11:11:32 +02:00
liquidraver c187dac4b4 fix(sx126x): honor tx-enable-gpios when dio2-tx-enable is set 2026-04-29 10:40:13 +02:00
liquidraver 85c60e613b make our sx driver more aligned with radiolib's logics 2026-04-28 13:49:08 +02:00
liquidraver a3244e2dc2 Three driver fixes for RX duty cycle, all applied to the existing patch
stolen from Zephyr main:

  1. Issue StopTimerOnPreamble=1 before SetRxDutyCycle so the chip's
     timer is not reset on every preamble detect (per §13.1 of the
     datasheet). Without this, duty cycle effectively never sleeps in
     noisy RF and current draw spikes.
  2. On IRQ_RX_TX_TIMEOUT during duty-cycle RX, re-arm via
     sx126x_restart_rx() instead of falling through to set_sleep().
     The old path silently killed duty cycle after the first preamble
     false-positive.
  3. On recv_duty_cycle(NULL) cancel, wake the radio before issuing
     SetStandby — BUSY stays asserted during the sleep phase and the
     standby command was being dropped.

Also adds a dc_timeout_restarts atomic counter incremented on the Fix 2
path, exposed end-to-end: sx126x_ext.h accessors → LoRaRadioBase vtable
→ SX126xRadio override → CommonCLICallbacks → RepeaterMesh. Query via
`get dc.restarts` on the repeater CLI; cleared by `clear stats`. High
values indicate a noisy environment or a too-loose preamble threshold.

(+increase ESP BT stack because future zephyr pin advance will trip that mine)
2026-04-20 13:36:45 +02:00
liquidraver 3b3eff7aab initial port of heltec v4 and v4.3 boards 2026-04-08 11:21:44 +02:00
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
Rastislav Vysoky a72dc3e4d9 fixes for esp32 and sx1276 2026-04-07 20:58:55 +02:00
liquidraver fc28b32d52 west update 2026-03-29 18:20:20 +02:00
liquidraver 0e5e71563c logging cleanup 2026-03-29 09:51:53 +02:00
liquidraver adb19e9705 west update - one manual patch is not obsolete 2026-03-24 08:56:41 +01:00
liquidraver 68e2d1f598 update dutycycling and LBT to match newest zephyr API-s 2026-03-23 10:50:02 +01:00
liquidraver c9013d85d4 update zephyr 2026-03-23 08:56:21 +01:00
liquidraver 249a446877 highly experimental. rx duty cycle + mini AGC reset 2026-03-21 08:48:50 +01:00
liquidraver 653fba4cf1 lr2021 fix v4 2026-03-19 13:27:37 +01:00
liquidraver 6f0fa3db85 fix RSSI reading 2026-03-19 11:38:45 +01:00
liquidraver 4bbc8ac8a8 lr2021 fixes v2 2026-03-17 22:37:42 +01:00
liquidraver 552e9676d8 add debug logging 2026-03-17 11:01:25 +01:00
liquidraver ad6f065510 lr2021 fixes 2026-03-17 10:08:32 +01:00
liquidraver 0bf8bd72a3 promicro LR2021 build fix 2026-03-16 19:49:53 +01:00
liquidraver e2729553ec promicro LR2021 first shot 2026-03-16 12:30:29 +01:00
liquidraver 1223935e21 west: advance Zephyr pin to 2026-03-15 main 2026-03-15 21:31:14 +01:00
liquidraver 3bec5fedb9 agc reset fix 2026-03-15 13:49:13 +01:00
liquidraver 98bf9e0eb6 west update 2026-03-09 13:45:22 +01:00
liquidraver a71da9ba70 guard noisefloor sampling and agcreset while in rx duty cycle 2026-03-07 15:28:50 +01:00
liquidraver 22efe4da6f fs revert cleanup 2026-03-04 09:21:05 +01:00