Commit Graph
4671 Commits
Author SHA1 Message Date
mikecarper b87e86e10f Add SX1262 scan harness and mixed-profile hardware results 2026-09-12 21:06:58 -07:00
mikecarper 12a3a467e1 Make repeater RX watchdog MeshCore-aware and tune temporary radio
Use RX-only radio recovery and feed the repeater reboot watchdog after MeshCore parsing. Default to 24 hours, apply temporary watchdog and advert intervals in RAM, and report temporary durations as days, hours, and minutes. Add regression coverage and an ESP-NOW bridge setup guide.
2026-09-11 22:10:13 -07:00
mikecarper bc0fb2c335 Record PR 7 review and Indicator hardware validation 2026-09-10 22:25:30 -07:00
mikecarper fa010196b1 Merge PR #7 with reviewed ExpressLRS power and memory fixes
Integrate ExpressLRS TX module support and its stacked ESP32 heap changes.
Use the approved Linkflow calibration (17-30 dBm), preserve the PA drive
and output path after radio recovery, and keep LoRa OTA enabled.

Preserve stored ACLs and filters on allocation failure, release owned
client/filter buffers, service heap OTA contexts on Companions, release
self-serving workspaces after TempRadio, and reset staged-resume state
when a context is released. Keep manual staging and active operations
alive. Account for all moved allocations in the runtime RAM gate.

Validation: 1,393 native cases; radio-power, heap-context, ACL persistence,
shared-queue transfer, display/inbox, radio receive, and memory regressions.
Firmware builds passed for Linkflow, Heltec V2 Companion, T-Beam MQTT
repeater, Heltec V4 R8 MQTT repeater, RAK4631 repeater, and Indicator Full.
Physical verification awaits access to the currently offline lab Pi.
2026-09-10 22:06:16 -07:00
mikecarper 01cc7b8ae4 Separate Companion message history from pending inbox
Default to retained history with a separate pending count, and add persistent display.inbox CLI modes for history, pending, and unread. Preserve browsing while clients are connected and show the active USB or Bluetooth connection.

Fixes #5
2026-09-10 21:42:57 -07:00
mikecarper a814a00ce7 Add configurable battery and USB display behavior
Persist separate display modes and timeouts in seconds for battery and USB power, expose four controls in WebConfig and CLI, and apply one shared policy across display-equipped roles.

Detect R8 external power from a USB host or calibrated battery voltage above 4.21 V, with cached sampling and hysteresis. Add policy, persistence, browser, and R8 power-detection regression coverage.
2026-09-10 21:03:15 -07:00
mikecarper d83153e935 Restore clearing all neighbors with an empty prefix
Accept the upstream empty-prefix neighbor.remove command after whitespace normalization while preserving invalid-key checks. Cover repeater and room-server removal paths with regression tests.

Fixes #8
2026-09-10 19:33:54 -07:00
mikecarper 2bc6847a1a Consolidate duplicate Full infrastructure builds 2026-09-10 19:33:54 -07:00
mikecarper d6869b0af9 Default Cascade profiles to CAD off 2026-09-10 17:44:55 -07:00
mikecarper 53aa72a48b Clarify sampling and recovery mode check cadences 2026-09-10 14:22:12 -07:00
mikecarper 0ed8167d02 Reject standby RSSI during noise calibration 2026-09-10 14:17:51 -07:00
mikecarper 2b66e8284c Keep sustained off-SF traffic out of the background noise estimate
Hardware captures show that a median and lower quartile can follow the interferer while the 12.5th percentile retains the quiet floor. Use that estimate with existing weighting and bounded rise recovery. Wait for settling after every RX re-arm and allow thirty seconds for a complete idle-sample block.

Add captured-sample, low-tail limitation, and real CLI setter regressions. Preserve RXPS intent when parsing an off command with trailing whitespace. All 162 native cases and 24 Python regressions pass.
2026-09-10 13:52:21 -07:00
mikecarper 2bf668ac95 Run receive recovery and radio status regression tests in CI 2026-09-10 13:25:41 -07:00
mikecarper 581b82fa51 Merge PowerSaving-v17 and harden noise calibration and RX recovery
Port the measured RXPS model without changing Cascade wire preambles or automatically enabling experimental levels. Use a spaced weighted median with bounded calibration windows, preserve packet ownership across CAD, and check actual SX126x receive mode before recovery.

Preserve Cascade sleep and radio fixes, integrate the new sensor and board profiles, and correct BSEC script inheritance and the MKE UART pin conflict. Native regressions, production-method/SPI harnesses, and ESP32, nRF52, and STM32 builds pass. Hardware comparison and fault-injection validation are recorded privately.
2026-09-10 13:19:22 -07:00
mikecarper 3cd23f6175 Escalate coding rate on hop-zero flood retries 2026-09-10 11:17:58 -07:00
mikecarper 7dd48ff0e2 Allow authenticated LoRa admins to read paged ACLs 2026-09-10 07:40:34 -07:00
mikecarper 00163f2c2b Add CLI listings for rate-limited flood adverts
List limited public-key prefixes, reasons, and wait times in bounded pages, with full-key details for targeted clearing. Queries preserve quotas and recovery timers.

Validated with 71 native tests, Full repeater and room-server builds, and a 909.500 MHz RF test covering 10 forwarded adverts, 2 blocked adverts, and forwarding after targeted clear.
2026-09-10 04:18:17 -07:00
mikecarper 602dbfe3d9 Fix inherited nRF52 USB READY hang in build-local TinyUSB driver 2026-09-10 02:37:15 -07:00
mikecarper 14796e6573 Fix touchscreen navigation and add runtime touch diagnostics 2026-09-09 17:38:41 -07:00
mikecarper 23fe7c8a9d Limit flood advert forwarding and persistent abuse 2026-09-09 17:16:00 -07:00
mikecarper 27ff4b9063 Fix PIN spacing and keep message navigation hints visible
Use measured text rows for companion and repeater layouts, retain the V4 6px footer, and add overlap and navigation regressions. Correct the MQTT logging sleep documentation contract test.
2026-09-09 10:20:22 -07:00
Kevin Le 5b62cc9d7c For sensor firmware, request for GPS sync in GPS PowerSaving upon telemetry request 2026-09-09 17:29:59 +07:00
MUSTARDTIGERFPV c002966c60 Restore the full repeater feature set on the LINKFLOW 900
The variant carried a "classic ESP32 DRAM strip": MAX_CLIENTS cut from 32 to
2, the flood rule engine and group moderation compiled out, and the filter,
scope and moderation tables cut to a single slot each. All of it existed to
squeeze fixed .bss tables into classic ESP32's ~124 KiB static DRAM window.

Those tables now live on the heap, so the strip buys nothing. Removing it also
clears a real trap: with two client slots, once both held a protected manager
(admin, region manager or filter manager) putClient() could no longer allocate,
and every further admin login was refused with no reply to the operator.

Static DRAM with the full feature set restored:
  70,764 / 124,580 occupied, 53,816 free (8,192 required)
2026-09-09 01:36:09 -07:00
MUSTARDTIGERFPV 36c5a6a350 Allow the radio to drive the amplifier from RFO instead of PA_BOOST
The SX127x has two output pins and they accept different power ranges:
RFO takes -4 to 15 dBm, PA_BOOST 2 to 17. RadioLib picks RFO on its own
below 2 dBm, but above that it has no way to know which pin a board
actually uses, so it defaults to PA_BOOST.

A board wired to RFO_HF whose levels fall in the overlap therefore comes
out of the wrong pin with no error anywhere. ExpressLRS layouts flag this
as "radio_rfo_hf"; the Radiomaster Bandit is one, with radio levels of
[2, 6, 9, 10] sitting squarely in the range both paths accept.

force_rfo passes RadioLib's forceRfo through for both the fixed drive level
and the per-step table. std_init()'s begin() always configures PA_BOOST, so
beginPowerControl() is what moves an RFO board over; nothing transmits in
between.
2026-09-09 01:24:38 -07:00
MUSTARDTIGERFPV 4bbcb5270a Support boards that move the radio output alongside the PA gain
Not every external-PA board parks its radio at a fixed drive level. Where
the amplifier is driven somewhere other than its floor, the radio's own
output steps with the requested power as well, and the board describes that
with a second table paired to the first. ExpressLRS layouts call this
"power_values2"; it is independent of dual-band operation, and appears on
single-band modules such as the Radiomaster Bandit.

An optional radio_dbm array supplies one radio output level per entry in the
level table. When present the fixed drive level is unused, and each power
change sets the radio before moving the amplifier so the PA is never asked
to pass a level the radio has already exceeded.

Values go to the SX1276 on the PA_BOOST path. A board wired to RFO_HF would
need RadioLib's useRfo argument plumbed through, which this does not do.
2026-09-09 01:24:38 -07:00
MUSTARDTIGERFPV c430ac130e Add GEPRC LINKFLOW 900M TX variant
An ExpressLRS 900 MHz transmitter module: ESP32-D0WDQ6, 4 MB flash, SX1276
driving an external PA through a DAC gain input on GPIO26.

Pin values come from the ExpressLRS hardware layout for this target
(Unified_ESP32_900_TX). The board brings out only RX_EN, so RadioLib's
single-pin RF switch handling covers it. Note GPIO12 is both RX_EN and the
MTDI flash-voltage strapping pin, so it must stay low through reset.

Verified on hardware: boots, radio initialises, TX power changes take
effect and are rejected outside the configured range, and the node repeats
flood traffic.

Uses dual_ota_1536k.csv, and 115200 for upload because the CH340 on this
board corrupts transfers above 230400.
2026-09-09 01:24:38 -07:00
MUSTARDTIGERFPV 83371a10f3 Add shared board class for ExpressLRS ESP32 TX modules
ExpressLRS transmitter modules share a common shape: powered from the
handset bay or USB rather than a battery, a fan over the amplifier, and an
ESP8285 "backpack" on a second UART that MeshCore has no use for.

ELRSTxBoard handles those from optional defines (PIN_FAN_EN,
PIN_BACKPACK_EN, PIN_BACKPACK_BOOT, MANUFACTURER_NAME) so a variant only
has to supply pin numbers. It also returns DIO0 from getIRQGpio(), since
the ESP32Board default is the SX126x pin.
2026-09-09 01:24:38 -07:00
MUSTARDTIGERFPV ae3ddcd215 Add SX1276 wrapper for DAC-controlled external PA gain
Some SX1276 boards do not drive the antenna from the radio. They feed an
external power amplifier whose gain is set by an analog control voltage on
the PA's gain input (APC/APC1/APC2/VAPC depending on the module), driven
from an MCU DAC. The radio sits at a fixed drive level and all power
control happens on that pin, so setOutputPower() alone does not describe
what the board can do.

DacPaSX1276Wrapper overrides applyCachedTxPower() and translates the
requested dBm, measured at the antenna, into a gain-control code using a
per-board calibration table.

The table defines the legal range, so out-of-range requests are refused
rather than saturated at the nearest entry. An optional max_dbm argument
caps the board below its top entry for thermal or regulatory headroom, and
can only ever reduce the ceiling. The gain write goes through a virtual so
a PA driven by PWM or an external DAC can reuse the rest.
2026-09-09 01:24:38 -07:00
MUSTARDTIGERFPV c6d71b969a Enable the on-demand mOTA context for every classic ESP32 build
Move OTA_HEAP_CONTEXT from two hand-edited envs to a pre-script gated on
build.mcu == "esp32", so every classic ESP32 image gets it and none can drift.
S2/S3/C-series and nRF52 keep the .bss singleton: they have no equivalent
static-DRAM ceiling, so there a guaranteed-present workspace is the better
trade for what is ultimately a recovery path. It has to be a build flag rather
than a header default, because OTA_HEAP_CONTEXT must hold the same value in
every translation unit that sees OtaContext.h - OtaContext.cpp included - and a
header test on CONFIG_IDF_TARGET_ESP32 would depend on include order relative
to sdkconfig.h. The script defers to OTA_SHARED_COMPANION_QUEUE where a Full
Companion recipe already owns the storage.

Fix a gap this exposes in the roles that now use it. Only CLI entry points
acquire the context, so once it was released, a repeater with the temporary
radio profile up would no longer serve or announce its own firmware - LoRa OTA
would look enabled and silently do nothing. ota_service_temp_radio_context()
holds the workspace for exactly the temp-radio window and hands it back
outside it, which is where the saving was coming from anyway. Wired into the
repeater, room server and sensor loops; the Companion keeps its own
acquire-on-host-demand policy, since its context is borrowed from the offline
message queue and must not be taken speculatively.

Static DRAM, classic ESP32 (bytes occupied of a 124,580 region):
  Heltec_v2_repeater                   108,332 -> 70,732
  Heltec_v2_room_server                 83,716 -> 68,300
  Heltec_v2_companion_radio_ble        123,236 -> 107,772  (was failing on main)
  Tbeam_SX1262_repeater                 86,932 -> 71,468
  Tbeam_SX1262_repeater_observer_mqtt  121,132 -> 83,532   (was failing)
2026-09-09 01:24:00 -07:00
MUSTARDTIGERFPV 1257ea4dc5 Free OtaContext-owned buffers when the context is torn down
OtaContext owns serve_buf, serve_self_leaves and serve_self_proof as raw
malloc'd pointers, and nothing freed them on teardown: self-serve only frees
them when it re-allocates, and reset_session() does not touch them. That was
harmless while the context was a permanent .bss singleton, but both dynamic
storage modes destroy it between operations - OTA_HEAP_CONTEXT deletes it,
and the Companion's borrowed queue runs ~OtaContext() in place. A self-serving
node reaches release with both self-serve buffers populated, so every
acquire/release cycle leaked them.

Give OtaContext a destructor that releases what it owns, and delete the copy
operations so the raw pointers cannot be double-freed.
2026-09-09 01:24:00 -07:00
MUSTARDTIGERFPV 0d42d3c8e1 Move large repeater tables off classic ESP32 static DRAM
Classic ESP32 links into a dram0_0_seg of only 124,580 bytes: memory.ld
carves the BT controller's 0xdb5c (56,156) reservation off the 0x2c200
window before the application gets any. Three large objects dominated what
was left, and Tbeam_SX1262_repeater_observer_mqtt overran the build's 8 KiB
static reserve by 4,744 bytes.

Heap-allocate them instead, each with a defined behaviour when the
allocation fails:

- OtaContext: generalize the Companion's borrowed-storage path behind
  OTA_DYNAMIC_CONTEXT and add OTA_HEAP_CONTEXT, which allocates the context
  on first use and frees it once no transfer, apply or folder link needs it.
  A repeater is idle nearly all the time, so the workspace is usually absent.
  Exhaustion is reported to the caller and the operation declines.
- ClientACL: the client table becomes a pointer with a live capacity;
  capacity 0 refuses new clients rather than writing through a null table.
- MyMesh flood packet filters: likewise, with flood_packet_filter_slots as
  the live bound for every rule loop. At capacity 0 the node forwards
  unfiltered, and both save paths refuse to write so a stored ruleset is
  never replaced by an empty file.

Also override the Arduino SDK's weak btInUse() in simple_repeater so
initArduino() releases the BT controller memory to the heap. That grows the
runtime heap these tables now come from; it cannot recover the same
reservation from the linker's static window.

Static DRAM, classic ESP32:
  Heltec_v2_repeater                   108,332 -> 70,732
  Tbeam_SX1262_repeater_observer_mqtt  121,132 -> 83,532  (was failing)
2026-09-09 01:24:00 -07:00
mikecarper f778d14c76 Add multi-tap channel navigation for messages 2026-09-08 22:47:15 -07:00
mikecarper c690f65376 Allow frequency changes over authorized LoRa CLI 2026-09-08 22:07:30 -07:00
mikecarper b9138c13b2 Allow local CLI maintenance across direct connections 2026-09-08 21:44:57 -07:00
mikecarper 99ff7bd693 Allow explicit contact imports with discovery filters enabled 2026-09-08 20:07:25 -07:00
mikecarper 5e6a74be50 Enable the shared terminal on WiFi-only Companions 2026-09-08 19:56:12 -07:00
mikecarper d178cf1474 Share the Companion terminal with the WiFi console 2026-09-08 19:48:15 -07:00
mikecarper cb79dcd4e3 Preserve MQTT settings across slot changes 2026-09-08 18:55:00 -07:00
mikecarper aa8caa4ed2 Unify device controls and restore the WiFi console 2026-09-08 18:36:23 -07:00
mikecarper 30d58d8e5b cleanup 2026-09-08 17:46:37 -07:00
mikecarper b2ce8a8c0a Add spacing to reader button hints 2026-09-08 17:38:45 -07:00
mikecarper 1b3e5daa02 Add button navigation hints to the hidden John reader 2026-09-08 17:31:18 -07:00
mikecarper 05fd0a4794 Merge origin/keymindCascade with companion button hints 2026-09-08 17:24:27 -07:00
mikecarper 74d87c8d13 Show button controls on companion home and message screens 2026-09-08 17:11:43 -07:00
mikecarper ac694d536e Place setup AP status below the WiFi address 2026-09-08 16:56:10 -07:00
mikecarper 42a8795db6 Show connected WiFi address on the V4 setup screen 2026-09-08 16:47:19 -07:00
mikecarper 4c1ed2593a Fix bootloader version discovery and tolerate legacy OTA probes 2026-09-08 16:17:43 -07:00
mikecarper 846282adf4 Use native display resolution and adaptive typography 2026-09-08 16:02:16 -07:00
mikecarper 0058f72192 Offer verified OTA source contact import with explicit approval 2026-09-08 15:33:19 -07:00
mikecarper 8f5614c958 Merge remote-tracking branch 'origin/keymindCascade' into keymindCascade 2026-09-08 14:33:02 -07:00