Commit Graph
1044 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
Scott Powell 560fb847d5 missing board.loop() in companion, room server, kiss modem. 2026-09-22 18:01:15 +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
Blake Latchford 0c3fe356d0 Constrain agc.reset.interval and allow intervals > 255s 2026-09-21 12:26:36 -04:00
ripplebiz 65737d48f4 Merge pull request #3402 from meshcore-dev/sensor-improvements
Sensor improvements
2026-09-21 19:03:18 +10:00
ripplebiz b37e7dd955 Merge pull request #3431 from meshcore-dev/abstract-ui-overhaul
Abstract UI overhaul
2026-09-20 18:08:29 +10:00
liamcottle 73afe3a0f5 allow fetching configured wifi password via companion cli 2026-09-20 14:22:13 +12: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 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
Scott Powell 5c3d9281ff * refactored the UI_DISCOVER_* feature 2026-09-17 13:45:33 +10: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
Scott Powell 53b6476409 Merge branch 'dev' into wio-tracker-L1-1W 2026-09-15 18:24:52 +10:00
Scott Powell 3819a0bd89 * subscribe response now returns expiry_secs (not timestamp) 2026-09-15 17:17:48 +10:00
Scott Powell bc8ccefafe * fix for telemHasChanged() 2026-09-14 20:23:10 +10:00
Scott Powell df82dc2339 * min_deltas now mandatory 2026-09-13 11:05:38 +10:00
Scott Powell d69ae98b5a * telemHasChanged() mod, so that only _specified_ min_delta values are considered. 2026-09-12 16:53:45 +10:00
ripplebiz 0984111d62 Merge pull request #3395 from jbrazio/fix/serial-command-clamp
[HIGH] Ensure command buffers stay NUL-terminated to prevent overflow
2026-09-11 14:09:24 +10:00
tekk 0a82fcd20d fix(companion): gate CMD_SEND_CHANNEL_DATA payload on MAX_GROUP_DATA_LENGTH
Payloads of 166 or 167 bytes previously passed the frame-sized bound
(MAX_CHANNEL_DATA_LENGTH = 167) but were rejected by sendGroupData
against MAX_GROUP_DATA_LENGTH (165), causing ERR_CODE_TABLE_FULL (retry
later) to be returned instead of ERR_CODE_ILLEGAL_ARG.

Fixes #3345
2026-09-09 22:10:41 +02:00
Liam Cottle 1751783931 Merge pull request #3357 from skandragon/feat/picow-wifi-ble
Add WiFi to RPI PicoW (and perhaps others)
2026-09-09 21:55:22 +12:00
liamcottle cee43752c7 add new ENABLE_WIFI_INTERFACE build flag for companions without providing ssid and pwd 2026-09-08 22:54:50 +12:00
liamcottle cced091b0c tidy comments 2026-09-08 22:18:22 +12:00
liamcottle 6809fed159 simplify and remove 2 as a wifi enabled state 2026-09-08 21:30:17 +12:00
Scott Powell 8660d1c973 * refactor: LPP helpers moved to LPPData class 2026-09-08 17:55:02 +10:00
liamcottle 87a05e1589 allow remote management of wifi as user has cli permission 2026-09-08 18:33:37 +12:00
liamcottle bf64fafe90 simplify response message 2026-09-08 18:30:00 +12:00
liamcottle 790680e4d1 allow toggling wifi enabled regardless of stored ssid 2026-09-08 18:25:34 +12:00
Scott Powell d71a54cd3d * CLI: removed "sub" and "unsub" (cannot support via command line)
* _SUBSCRIBE: binary req/resp payload changes (now keeps supplied 'push_tag')
* Sensor: added MCU temperature support in telemetry
2026-09-07 13:56:47 +10:00
Michael Graff 7c2b4d88be WiFi on/off tri-state: on when SSID set unless explicitly disabled; PicoW ships no default SSID 2026-09-06 22:18:00 -05:00
Michael Graff dac171b49c Default wifi.enabled to 0 2026-09-06 22:05:29 -05:00
Michael Graff eb2ab10de0 Add wifi.enabled pref and CLI; skip WiFi when disabled or SSID blank 2026-09-06 21:56:25 -05:00
Michael Graff 98cf4f3332 Add get wifi.status and get wifi.ip CLI commands 2026-09-06 21:44:47 -05:00
Michael Graff b11a779843 Address review: per-variant wifi src, real SSID reply, rename PicoW env 2026-09-06 21:28:04 -05:00
Michael Graff b9fa450f52 Fix review findings on Pico W WiFi/BLE 2026-09-06 20:43:37 -05:00
Michael Graff 88cc014f55 Add BLE companion support for Pico W 2026-09-06 20:15:45 -05:00
ripplebiz 89ef200efa Merge pull request #3366 from recrof/companion-cli-fix-2
Companion CLI: fixed txdelay, direct.txdelay, agc.reset.interval, int.thresh
2026-09-07 10:42:48 +10:00
Rastislav Vysoky 5d82ed352c Companion CLI: fixed txdelay, direct.txdelay, agc.reset.interval, int.thresh 2026-09-06 15:14:35 +02:00
Michael Graff a4ac85a0d6 Address review findings on WiFi companion support
- scope the serial config CLI to RP2040; it was exposing the rescue CLI
  (cat/rm/erase) on every ESP32 WiFi build, which gates it behind a
  physical long-press
- bound and space out RP2040 rejoins: the core's join busy-waits, so cap
  it at 5s and retry every 30s instead of every 10s
- stamp the reconnect timer in setup(), so the first loop() doesn't tear
  down an association that is still finishing DHCP
- treat stored credentials as a pair, and pass NULL (not "") for an open
  network
- teach build_as_lib.py where SerialWifiInterface moved
2026-09-05 23:15:13 -05:00
Michael Graff 58181bb8a2 Fix blocking WiFi connect on RP2040, log link state
arduino-pico's WiFi.begin() blocks for up to 2x its 15s timeout, which
stalled the mesh loop on every reconnect attempt; use beginNoBlock().
Log the IP when the link comes up, and the status code when retrying.
2026-09-05 23:15:13 -05:00