Commit Graph
150 Commits
Author SHA1 Message Date
liquidraver 0e7a9b7285 vcontact p1 2026-07-11 16:28:27 +02:00
liquidraver 56e41284e1 repeater-observer hybrid fixup 2026-07-10 22:43:26 +02:00
liquidraver a03856cb34 gps cli commands fix and e-ink sats count clear 2026-07-08 09:16:47 +02:00
Étienne Fesser c4fb9c0638 Fix TX wait thread stack overflow on Xtensa (boot freeze)
TX_WAIT_THREAD_STACK_SIZE was 1024 bytes, shared by every radio
adapter. On Xtensa (all ESP32/S3 boards) the windowed ABI needs ~3x
the stack of Cortex-M for the same code — Zephyr's own Kconfig
defaults reflect this (IDLE_STACK_SIZE: 1024 if XTENSA vs 320 ARM).

Measured peak usage on Heltec V4 (immediate-mode logging, full TX
cycle including startReceive/lora_config): 1252 bytes — already past
the old 1024 limit. The overflow corrupts the exception frame and
parks CPU0 in _DoubleExceptionVector (LoadProhibited @0x2c), a silent
total freeze at boot. Confirmed via the S3 built-in USB-JTAG:
current thread at crash = lora_tx_wait.

2048 gives ~39% headroom over the measured worst case.
2026-07-06 19:26:17 +02:00
liquidraver f8f62cd65b drop serial on reboot for ESP 2026-07-04 11:21:10 +02:00
liquidraver 6ef03fb10e Merge branch 'master' into dev 2026-07-03 19:58:07 +02:00
liquidraver 14cb8c61f9 meshtimesync p1 2026-07-03 09:11:43 +02:00
liquidraver fc940d27ba sync with dev 2026-07-02 13:13:26 +02:00
liquidraver 3af781ee87 get rid of flash writes initiated by ZephyrGPSManager 2026-07-02 09:20:10 +02:00
liquidraver 989dd4b93e dont hammer flash with gps fixes 2026-07-01 22:37:11 +02:00
liquidraver 1cbddc64da gps fixes 2026-07-01 22:31:18 +02:00
Matthew Burton 43f455393e added colour and fixed set tx adc not sticking 2026-06-29 20:22:52 +02:00
liquidraver bd363781ac companion hybrid refactor v1 2026-06-23 22:45:25 +02:00
liquidraver 2f86310500 port lora e5 mini 2026-06-21 20:38:57 +02:00
liquidraver 9f8f13e648 fix automount/autoformat loop 2026-06-18 12:18:06 +02:00
liquidraver 28f1c3af05 fix build and update readmes 2026-06-17 22:31:47 +02:00
liquidraver 906ef08b05 3 way FS self-heal 2026-06-17 22:05:21 +02:00
liquidraver c4a1777956 refactor gps manager 2026-06-17 15:42:50 +02:00
liquidraver 533a2a7e4e first fix 5 min timeout for GPS to prevent battery drain 2026-06-17 14:52:00 +02:00
liquidraver 7b3716bd6a fix M1 GPS power control 2026-06-17 14:15:45 +02:00
liquidraver 4ec6f27202 password compare bug fix 2026-06-16 12:36:54 +02:00
liquidraver a0222fe12b fix android could not connect from app for ESP 2026-06-15 22:39:50 +02:00
liquidraver 572490e909 migrate to NVS, update formatters 2026-06-15 14:08:09 +02:00
liquidraver fb6cd24e9e linux native transport fixes 2026-06-14 21:20:02 +02:00
liquidraver 18b63bd6f5 Add Lilygo T-beam 1.2 (SX1262) 2026-06-14 14:00:51 +02:00
liquidraver bf71542751 Make Rxdutycycling Great Again 2026-06-13 08:23:01 +02:00
liquidraver a9c797b837 guard GPS month_days[] index against out-of-range GNSS month (gps audit) 2026-06-11 13:30:01 +02:00
liquidraver 5564dcbde0 fix RTC and time display 2026-06-09 14:46:30 +02:00
liquidraver 2b90605fe1 bump Service Changed to 2 2026-06-08 11:56:38 +02:00
liquidraver 4a9da3a43c contact_iter_work race 2026-06-08 10:22:25 +02:00
liquidraver 7e00a6682d ble race fixes 2026-06-08 09:57:58 +02:00
liquidraver 2ad185bab4 license "refactor" :) 2026-06-07 22:47:17 +02:00
liquidraver 2cf4b9704e BT DFU fixes + power bump up 2026-06-07 22:33:50 +02:00
liquidraver 7c46f4a343 legacy code cleanup 2026-06-07 13:02:07 +02:00
liquidraver 01fd56a573 wire up RTC to out-of-the-box capable nodes 2026-06-07 12:00:05 +02:00
liquidraver 9ef6774d6a add legacy nordic DFU service 2026-06-06 23:55:15 +02:00
liquidraver ffe9ea652d sync to vanilla 1.16 2026-06-06 16:42:39 +02:00
liquidraver 4353936328 lr2021 experiments 2026-06-06 15:33:37 +02:00
liquidraver 28a8a6999d nrf companion auto-shutdown 2026-06-05 09:27:24 +02:00
liquidraver eda46166b4 companion CLI 2026-06-04 22:43:01 +02:00
liquidraver e052f3d231 sync with upstream dev 2026-06-03 22:01:23 +02:00
liquidraver d37b401033 battery: centralized LiPo OCV curve + ADC multiplier corrections
Add a board-aware battery SOC system replacing the two independent
linear approximations that existed in the UI helpers.

New helpers/battery_curve.{h,c}: a 21-point (5% step) OCV lookup table
with integer linear interpolation. The default generic LiPo curve is a
weak symbol — any board can override it by dropping a battery_curve.c
into its board directory. CMakeLists.txt selects the board-specific file
when present, falling back to the generic.

Board.h gains getBattPercent() (default 0); ZephyrBoard implements it
via battery_curve_lookup().

Board-specific curves added for boards with measured cell data:
t1000_e, rak_wismesh_tag, thinknode_m6, sensecap_solar, wio_tracker_l1.

ADC multiplier corrections applied across all nRF52840 boards:
- Boards using a correctly-derived 3600×ratio formula get +0.5% to
  compensate for nRF SAADC gain error (7200→7236, 6300→6332, etc.)
- rak_wismesh_tag, rak3401_1watt, gat562_30s had multipliers copied
  from Arduino's 3.0V AREF formula; corrected to 3600×1.73×1.005=6259
- xiao_nrf52840 (10911) left unchanged — empirically calibrated value
  above the theoretical, assumed already correct for that hardware

get adc.multiplier now reports current mV reading and the board's
curve 100% target, making field calibration self-guiding.
2026-06-03 13:21:06 +02:00
liquidraver 8761a82d93 fix USB protocol handling and bump version 2026-06-03 10:09:43 +02:00
liquidraver ad4c28cdb0 unbreak build #1 2026-06-03 07:25:24 +02:00
liquidraver eb4e6583c7 linux native fixup #2 2026-06-02 14:50:31 +02:00
liquidraver eded1d7f04 linux native fixup #1 2026-06-01 22:29:53 +02:00
liquidraver e445e97fc3 fix(usb): release the interface on VBUS removal
A device-side cable yank often skips the DTR=0 line-state change, so the
companion stayed stuck on the USB interface and rejected every BLE
connection until reboot. Treat USBD_MSG_VBUS_REMOVED as a DTR drop.
2026-05-31 15:36:46 +02:00
liquidraver b26bd5eee4 fix(rng): hard-fail seed KDF on SHA-256 error
extract_via_aes_ctr used the void Utils::sha256, which silently zeroes
its output on PSA failure -> an all-zero AES key -> a constant,
device-shared Ed25519 identity that the degenerate check misses.
Re-inline psa_hash_compute with its status check so a failure reboots.
2026-05-31 15:36:25 +02:00
liquidraver 553b71c44a Make production the default build; decouple USB companion from CONFIG_LOG
Production (LOG=n, ASSERT=n, RTT=n, reboot-on-fatal) is now the prj.conf
default; debug.conf is the opt-in bundle. Removed prod.conf and the
logging.conf auto-include; relocated RTT/ASSERT out of the always-on
platform confs so they no longer override the prod defaults.

Add CONFIG_ZEPHCORE_COMPANION_USB so the USB CDC companion transport
compiles independently of logging (default-y on USB-capable companions,
opt-in on ESP32-S3 via esp32s3_usb.conf). Gate all USB sites behind one
ZEPHCORE_USB_STACK macro.

Rework BLE/USB interface arbitration to first-come-first-served: neither
transport evicts a live session. Make active_iface mutation thread-safe
(mutex + atomic claim) across the BLE callback thread and USB workqueue.

Share the ESP32-S3 USB OTG / console DTS via common dtsi includes; enable
uart0 (GPIO43/44) on station_g2 and xiao so the console reroute works.
2026-05-30 21:05:42 +02:00
liquidraver 7d7a64ff5a fix: airtime LDRO threshold must track driver (was BW-blind sf>=11)
getEstAirtimeFor() set LDRO from `sf >= 11`, correct only at BW125. Now
matches the driver's should_enable_ldro() (t_sym > 16.38 ms) so the
estimate's DE tracks hardware DE on every SF/BW. Also drop dead
calcRxDelay() + unused MAX_RX_DELAY_MILLIS.
2026-05-29 15:48:48 +02:00