Commit Graph
3514 Commits
Author SHA1 Message Date
agessaman dc539d2dd6 kiss_modem: answer FEM requests strictly in arrival order
A second SetFemState sent while the first was held for a TX got an
immediate TxBusy, which reached the host before the first request's
reply. With no request IDs, the host could not tell which Set failed.

FEM requests now go through a small ordered queue (Set, Get and their
error replies). Sets still wait for TxDone to be queued and apply
once. Each reply is kept until it can be queued. Capability checks
happen in order at processing time. Only an overflow (more than 4
waiting) replies TxBusy immediately.
2026-09-23 17:41:14 -07:00
agessaman 720f0f1528 kiss_modem: reach FEM gain through the board's radio.fem CLI commands
Boards own their FEM control through handleCommand() ("get/set
radio.fem.rxgain|txgain"). Use that instead of a parallel set of FEM
virtuals on MainBoard, so any board that implements the commands works
in KISS with no extra code.

- Remove the six FEM virtuals from MainBoard and the board overrides.
- KissModem talks to the board in one adapter. A gain counts as
  controllable only if "get" replies exactly "> on" or "> off". "set"
  is checked by reading the state back, never by its reply wording.
- SetFemState always replies with the read-back state once the
  requested bits pass the capability check.
- Guard the boards' prefs writes against a NULL store. KISS attaches
  no prefs, so "set radio.fem.*" would dereference NULL.
- Wio Tracker L1 1W TX gain is exposed again, matching its CLI.
2026-09-23 17:31:20 -07:00
agessaman c387fc22c3 kiss_modem: add radio chip boosted RX gain control
Add SetRxBoostedGain (0x20) / GetRxBoostedGain (0x21, reply 0xA1) and
capability bit 3, the KISS equivalent of the radio.rxgain CLI setting.
It is separate from FEM RX gain; a board may support either or both.

- Support is declared by the driver via a new
  RadioLibWrapper::supportsRxBoostedGain() (SX1262, SX1268, LLCC68,
  LR1110, LR1121, LR2021), so nothing is written to the radio at boot.
- The set is refused with TxBusy during TX or while host output is
  backed up. Otherwise any completed RX packet is delivered first,
  because some drivers (LR2021) drop to standby to apply the gain.
- The reply always carries the state read back from the radio.

Driver fixes found along the way, which also affect the radio.rxgain
CLI in regular firmware:
- CustomLR2021 never updated its cached gain state, so the getter
  always reported off. It now tracks the applied level per RX path
  and rolls RadioLib's cached level back if a write fails.
- CustomLR1110/LR1121 cached the requested state even when the write
  failed.
- lr11x0ResetAGC only reapplied the gain when RX_BOOSTED_GAIN was
  defined, so a runtime setting was lost on the next AGC reset.
2026-09-23 16:59:39 -07:00
agessaman 9235d761da kiss_modem: keep FEM replies ordered and deliverable; drop Wio FEM control
- Wio Tracker L1 1W no longer advertises TX gain control: its setter
  drives LORA_PWR_EN, the shared LDO for the SX1262 and the PA, so
  "gain off" would power down the radio.
- A SetFemState that arrives mid-TX is now applied after TxDone is
  queued, so its reply follows TxDone.
- SetFemState replies (immediate or deferred) are retained until they
  fit in the host output queue instead of being dropped, so a change
  that took effect is always acknowledged.
- GetFemState replies queue behind an outstanding SetFemState reply;
  a further SetFemState returns TxBusy until it clears.
2026-09-23 16:11:29 -07:00
agessaman 5a6027d331 kiss_modem: only set USB TX buffer size on HWCDC builds
USBCDC (ARDUINO_USB_MODE=0, TinyUSB) has no setTxBufferSize, which broke
the Station G3 and Heltec Tracker V2 KISS builds.
2026-09-23 15:51:05 -07:00
agessaman 5527a26f9a kiss_modem: add AGC reset interval and FEM gain control (protocol v2)
Add SetHardware sub-commands so a host can probe and configure
per-board RF front-end settings:

- GetCapabilities (0x1B): uint32 feature bits (AGC, FEM RX, FEM TX)
- Set/GetAgcResetInterval (0x1C/0x1D): 0-1020 s, 4 s resolution,
  0 disables; default stays 30 s
- Set/GetFemState (0x1E/0x1F): apply/value masks for FEM RX (LNA)
  and TX (PA) gain; all-or-nothing, Unsupported (0x08) if any
  requested bit is not controllable on this board

The AGC scheduler moves from main.cpp into KissModem so it is
configurable and unit-tested. FEM changes that arrive mid-TX are
deferred until the packet ends, since board setters drive FEM pins
directly.

MainBoard gains virtual FEM hooks (canControl/set/is for LNA and PA
gain). Boards that already implemented these methods privately now
expose them as overrides: Heltec V4, V4 R8, T096, Tracker V2,
Station G3 and Wio Tracker L1 1W.

KISS_FIRMWARE_VERSION bumped to 2.
2026-09-23 15:43:01 -07:00
Liam Cottle c423dece36 Merge pull request #3490 from liamcottle/fix/heltec-ct62
Fix Heltec CT62 boot loop
2026-09-23 17:48:04 +12:00
liamcottle c13b312188 fix heltec ct62 boot loop 2026-09-23 15:04:51 +12:00
Scott Powell 69f3022a5e Merge commit '140178728b34c821b5169665c1f6f5ede2b9f543' into dev 2026-09-22 18:02:33 +10:00
Scott Powell 560fb847d5 missing board.loop() in companion, room server, kiss modem. 2026-09-22 18:01:15 +10:00
ripplebiz 140178728b Merge pull request #3427 from Dom4n/feat/lr1110-dcdc-dev
Enable DC/DC for LR1110 radios
2026-09-22 17:57:09 +10:00
ripplebiz a76d511ff4 Merge pull request #3131 from liekmarflow/feature/board-api-hooks
Add board loop hook for periodic work
2026-09-22 16:43:18 +10:00
Wolfram Keil 61be70849a Add board loop hook for periodic work 2026-09-22 08:01:48 +02:00
ripplebiz 5e9d80df38 Merge pull request #3464 from lbibass/lr1121_dcdc
LR1121 DC-DC & Misc Updates
2026-09-22 15:12:56 +10:00
ripplebiz 7faf87682c Merge pull request #3469 from Blake-Latchford/issue/3409/constrain-agc-interval
Constrain `agc.reset.interval` and allow intervals > 255s
2026-09-22 15:03:03 +10:00
Blake Latchford 0c3fe356d0 Constrain agc.reset.interval and allow intervals > 255s 2026-09-21 12:26:36 -04:00
fdlamotte be371634d0 Merge pull request #3468 from weebl2000/thinknodem4_fixes
Thinknode m4 - don't touch crystal and OTA name
2026-09-21 11:09:55 -04:00
Wessel Nieboer b5787757a7 Thinknode m4 - don't touch crystal and OTA name 2026-09-21 15:55:44 +02:00
fdlamotte f4ae72dc12 Merge pull request #3436 from Blake-Latchford/wio-e5-fix
WIO-E5 Fix: Pin Radiolab for stm32 and replace ltoa
2026-09-21 05:50:12 -04:00
ripplebiz 65737d48f4 Merge pull request #3402 from meshcore-dev/sensor-improvements
Sensor improvements
2026-09-21 19:03:18 +10:00
Ev Lbibass 84f1e11d29 update structure of LR1121 to match LR1110 files. Implement DC-DC on LR1121 radio. saves about 30% power consumption at idle. 2026-09-20 20:38:05 -04:00
fdlamotte f8f9bd4daf Merge pull request #3463 from fdlamotte/thinknode_m4
Thinknode m4
Doing the merge now as it doesn't touch anything outside its own variant dir and its board file ;)
2026-09-20 16:22:47 -04:00
Florent 8bf072a6f0 M4: Handle poweroff 2026-09-20 16:13:15 -04:00
Florent 0a15c487d8 m4: inital port 2026-09-20 15:25:18 -04:00
Blake Latchford 12a8c8d4d4 Add missing include, and revert removal of lota 2026-09-20 15:16:33 -04:00
Liam Cottle 0886259701 Merge pull request #3108 from tjdownes/muzi-base
Add Muzi Base board support (Duo + Uno + SuperIO)
2026-09-20 22:56:32 +12:00
TJ Downes 114cf9f4fc Use the default BLE TX power on Muzi Base
Drop BLE_TX_POWER=0 from the companion envs so they use the default of
4 dBm, like most other variants. The lower power was carried over from
the original Base Duo PR and real-world range is better at the default.
2026-09-20 03:46:25 -07:00
ripplebiz b37e7dd955 Merge pull request #3431 from meshcore-dev/abstract-ui-overhaul
Abstract UI overhaul
2026-09-20 18:08:29 +10:00
TJ Downes 798ce636df Address review feedback on Muzi Base support
- rename the board class and files to MuziBaseBoard
- uppercase the build flags (MUZI_BASE, MUZI_BASE_SUPERIO)
- name the superIO envs muzi_base_{duo,uno}_superIO_companion_radio_ble so
  build.sh picks them up
- set MAX_CONTACTS to 350 like the other variants
- move the pin setup from initVariant() into MuziBaseBoard::begin()
2026-09-19 21:47:24 -07:00
Liam Cottle 4d9a292084 Merge pull request #3459 from liamcottle/board/thinknode-m7-wifi
Add wifi support to ThinkNode M7 BLE variant
2026-09-20 15:25:08 +12:00
liamcottle 4021a341f8 add wifi support to thinknode m7 ble variant 2026-09-20 15:11:21 +12:00
Liam Cottle fac7bf5dd3 Merge pull request #3458 from liamcottle/cli/wifi-pwd
Allow fetching configured wifi password via companion cli
2026-09-20 14:34:48 +12:00
liamcottle 73afe3a0f5 allow fetching configured wifi password via companion cli 2026-09-20 14:22:13 +12:00
fdlamotte 2c700d1689 Merge pull request #3449 from IoTThinks/MCdev-KeepLEDOffBeforePowerOff-20260919
Off LED before powering off for repeaters
2026-09-19 15:06:17 -04:00
Scott Powell 64434c5326 * misc 2026-09-19 20:13:18 +10:00
Kevin Le c425648bfc Off LED before powering off for repeater 2026-09-19 11:26:42 +07:00
Scott Powell 843598724c * fix for X1 2026-09-18 19:03:20 +10:00
Liam Cottle 166f75c1b6 Merge pull request #3442 from liamcottle/feature/companion-cli-commands
added reboot, shutdown and poweroff to companion cli commands
2026-09-18 18:25:33 +12:00
liamcottle 242e401a2c added reboot, shutdown and poweroff to companion cli commands 2026-09-18 18:17:52 +12:00
Blake Latchford 8d2a5657ac Pin Radiolab for stm32 and replace ltoa
The major rev from 19.x to 20.x breaks Radiolab, so pin it for now. This should fix the failing wio-e5-mini_repeater builds.

ltoa is removed upstream, so it was replaced with snprintf. The p[] buffer is always 16 bytes. Copy/paste for why claude thinks this is fine below, but also if this is broken it wouldn't be new.
```
exp2 in [23, 30] (int_part = mantissa << (exp2 - 23)): this is where int_part can reach its true max, up to 2,147,483,520 — 10 digits. That's what the snprintf bound of 11 (10 digits + NUL) is sized for. But in this branch frac_part is never assigned anything other than its initial 0, so only *p++ = '0' runs for the fraction — 1 char, not 7.

exp2 in [0, 22] (int_part = mantissa >> (23 - exp2)): this is the only branch where frac_part can also be nonzero and enter the 7-digit loop. Here int_part < 2^23 by construction, so it's capped at 7 digits, never 10.
```
2026-09-17 22:12:53 -04:00
Liam Cottle 3244e3ec13 Merge pull request #3382 from Blake-Latchford/wifi-disconnect-reason-logging
Extend WiFi disconnect logging to specify reason
2026-09-18 12:01:30 +12:00
Blake Latchford 1077331e31 Extend WiFi disconnect logging to specify reason
Today if a user builds firmware with an incorrect WiFi SSID or password,
they get a generic `WiFi disconnected.` error message.

Extend logging to descirbe the reason that WiFi was disconnected.

I gathered the updated logs for the 3 scenarios below.

```
WiFi: Attempting manual WiFi reconnect...
WiFi: WiFi disconnected (reason=ASSOC_LEAVE). Flagging for reconnect...
WiFi: WiFi disconnected (reason=4WAY_HANDSHAKE_TIMEOUT). Flagging for reconnect...
WiFi: WiFi disconnected (reason=4WAY_HANDSHAKE_TIMEOUT). Flagging for reconnect...
WiFi: WiFi disconnected (reason=4WAY_HANDSHAKE_TIMEOUT). Flagging for reconnect...
```

```
WiFi: WiFi disconnected (reason=NO_AP_FOUND). Flagging for reconnect...
```

```
WiFi: WiFi connected successfully!
WiFi: Got connection
```
2026-09-17 19:39:51 -04:00
Scott Powell b3b17025e3 * more MyMesh::Listener interface hooks 2026-09-17 17:33:36 +10:00
Scott Powell 30dd723c26 * MyMesh::begin() refactor, removing last display concepts 2026-09-17 14:25:41 +10:00
Liam Cottle cdd0407711 Merge pull request #3430 from liamcottle/fix/3429
Add missing null display driver class for ThinkNode M7 ethernet variant
2026-09-17 15:54:28 +12:00
liamcottle cd54ee9754 add missing null display driver class for thinknode m7 ethernet variant 2026-09-17 15:52:46 +12:00
Scott Powell 5c3d9281ff * refactored the UI_DISCOVER_* feature 2026-09-17 13:45:33 +10:00
Jarosław Domański b71933beb5 Enable DC/DC in shared LR1110 initialization 2026-09-16 22:43:48 +02:00
Scott Powell 3caf033de2 * refactor: removed UITask dependency from MyMesh. New MyMesh::Listener interface
* UITask's are now a MyMesh task Listener
2026-09-16 21:03:44 +10:00
ripplebiz 0ec5ed5fe7 Merge pull request #3393 from jbrazio/fix/static-pool-hardening
Improve null checks and index validation in StaticPoolPacketManager
2026-09-16 12:26:29 +10:00