Commit Graph
272 Commits
Author SHA1 Message Date
fdlamotte 15c3eba809 Merge pull request #3776 from Blake-Latchford/docs/stats-core-error-flags
docs: describe stats-core output and its error flags
2026-11-19 12:42:00 -04:00
Liam Cottle b6a9b5d877 Merge pull request #3754 from netrunnereve/bluetooth-name
Allow the user to set a custom bluetooth name using the cli
2026-11-15 20:01:46 +13:00
Eve 0dbf8f62c3 change prefix as well 2026-11-14 15:17:32 -05:00
Eve 2a53a81e82 use ble.name 2026-11-13 20:35:32 -05:00
Olexandr Tyshchenko 069b9fdaf8 GPS: first fix timeout as a saved setting (gps firstfix), 1 h by default
A cold start can take up to ~30 min with a weak sky view, so the default
limit before the first fix since boot goes from 15 min to 1 h.

The limit is now a GPS preference, set with `gps firstfix <duration>`
(0 = no limit, at most 1 day) and saved with the other GPS settings, so
repeaters and companions can use different values without a rebuild.
GPS_FIRST_FIX_TIMEOUT_MS stays as the build default.
2026-11-13 14:29:02 +02:00
Eve 4c7a134e15 add cli option to set custom bluetooth name 2026-11-12 11:09:43 -05:00
Olexandr Tyshchenko ac2bf9372a Limit the first periodic GPS acquisition after boot
Before the first fix since boot, a periodic acquisition had no timeout. If no
fix is accepted (no sky view, no antenna, or a guard rejecting spoofed fixes),
the receiver then stayed on until a fix was accepted.

Give that window its own limit, GPS_FIRST_FIX_TIMEOUT_MS (15 min by default,
enough for a full almanac; 0 keeps the old behaviour). It counts as a miss and
the next acquisition starts after the configured period.
2026-11-12 10:48:10 +02:00
Olexandr Tyshchenko b920e7d249 GPS guard: drop leftovers of the alert telemetry channel
#3813 removed the telemetry channel for the GPS time alert. Remove the
docs sentence that still described it and the now unused
GpsGuard::getAlertOffset().
2026-11-11 16:18:58 +02:00
fdlamotte c4258a5beb Merge pull request #3801 from AlexandrTyshchenko/feature/gps-guard-time-wait
GPS guard: show "time wait" instead of "rej nofix" between fixes
2026-11-11 10:13:11 -04:00
Florent bed7286192 CommonCLI: get/set loc to replace gps advert command 2026-11-11 09:52:03 -04:00
Florent 74f1f5a156 Revert "Merge pull request #3784 from Maxwell456/feature/repeater-history"
This reverts commit f678f6ac15, reversing
changes made to b8ae75d258.
2026-11-11 07:49:41 -04:00
Olexandr Tyshchenko 196ca97751 GPS guard: show "time wait" instead of "rej nofix" between fixes
When the last GPS time check passed but there is no current trusted fix
(e.g. the GPS is asleep between periodic fixes), gps guard showed
"time rej nofix", which reads like a rejection although the clock is fine.
Show "time wait" instead. A real rejection without a trusted fix (GPS time
arriving while fixes are rejected) still shows "rej nofix".
2026-11-11 01:48:12 +02:00
fdlamotte f678f6ac15 Merge pull request #3784 from Maxwell456/feature/repeater-history
Add min/max/avg history queries to repeaters
2026-11-10 12:42:53 -04:00
fdlamotte e6d141d6f7 Merge pull request #3785 from AlexandrTyshchenko/feature/companion-adc-multiplier
Companion: set/get adc.multiplier CLI command
2026-11-10 08:11:33 -04:00
fdlamotte 62ae611afd Merge pull request #3753 from fdlamotte/gps_refactor
Big GPS refactor
2026-11-10 07:44:00 -04:00
Olexandr Tyshchenko 8c7e1a8f5d GPS guard: gps guard on/off, saved in the GPS prefs 2026-11-09 23:50:48 +02:00
Olexandr Tyshchenko d72f67d37b GPS guard: save gps fence in the GPS prefs 2026-11-09 23:16:29 +02:00
Olexandr Tyshchenko fbd20ac64b GpsGuard: let GPS correct a clock outside the plausible window 2026-11-09 22:54:18 +02:00
Olexandr Tyshchenko eea64ffb74 GPS guard: drop time force, it goes to a separate PR 2026-11-09 22:30:24 +02:00
Olexandr Tyshchenko d644f0a516 GPS: optional anti-spoofing guard for position and time (GPS_GUARD)
A spoofed GPS signal can move a fixed node anywhere and set its clock to
any time; the clock only moves forward, so a time pushed into the future
breaks timestamps and replay protection until fixed by hand.

With GPS_GUARD, MicroNMEALocationProvider asks a GpsGuard before a fix is
stored as the last fix (satellites, HDOP, optional region box, fence
around the configured position, jump speed, N stable fixes) and before
GPS time is written to the clock (trusted fix current, not before the
build date, small steps once the clock is valid, drift-sized after the
first sync). Without a trusted fix no live position is reported.

CLI in CommonGpsPrefs: 'gps guard', 'gps guard accept', 'gps fence',
'gps ref'; CommonCLI keeps the reference on set lat/lon and gps setloc,
resets the time anchor on manual clock sets and adds 'time force'.

Ported from #3736 onto the GpsDriver/LocationProvider refactor.
2026-11-09 20:43:09 +02:00
Olexandr Tyshchenko da1828fd9d Companion: set/get adc.multiplier CLI command, persisted in prefs
Repeaters, room servers and sensors already let the battery ADC multiplier be tuned with 'set adc.multiplier' (CommonCLI). The companion firmware had no equivalent, so a board whose divider differs from the build default (common on DIY ProMicro / Faketec boards) always reported a wrong battery voltage.

Adds the same command to the companion CLI. The value is stored in the companion prefs (comp.adc_mult, 0 = board default) and applied at startup via MainBoard::setAdcMultiplier().
2026-11-08 18:07:58 +02:00
Maxwell 25c1867bbd Add min/max/avg history queries to repeaters
Move TimeSeriesData from simple_sensor into src/helpers and drive it with
monotonic uptime, so RTC changes cannot stall recording or break queries.
Keep the old RTCClock* overloads as deprecated for custom sensor sketches.

Record 24h of battery, noise floor, TX/RX airtime % and MCU temperature on
repeaters and answer the existing 0x04 min/max/avg request using the same
format as sensor nodes. No packets are sent by this feature.
REPEATER_HISTORY_SLOTS=0 removes it; default off on STM32/RP2040.

Add native tests for TimeSeriesData and document the request and channels.
2026-11-08 16:34:54 +02:00
Florent 6eea5e7185 ui_task: let user choose if enter in gps screen toggles or triggers gps 2026-11-08 08:47:35 -04:00
Florent 6c9600e1e7 gps: Rework the CLI
- more consistency with other cli commands
- new format for gps fix
- gps format accepts postfix (s/m/d/h)
- documentation
2026-11-08 08:47:35 -04:00
Florent d49621c805 gps: fix_stats command 2026-11-08 08:47:34 -04:00
Florent 36b53d8de9 gps: cache the last fix in LocationProvider (isValid vs hasValidFix), fix and status commands 2026-11-08 08:47:34 -04:00
agessaman 322cd638fb Merge remote-tracking branch 'upstream/dev' into feat/kiss-agc-fem-control 2026-11-06 20:38:01 -08:00
Blake LatchfordandClaude Opus 5.5 cc885674a7 docs: describe stats-core output and its error flags
Document the stats-core output fields and decode the `errors` bitmask
(shown as "Debug flags" in the app), from the ERR_EVENT_* flags in
Dispatcher.h, and note that the flags stay set until reboot or
`clear stats`.

Fixes #3039

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 21:19:12 -05:00
Juraj Bednar 6011d20587 Add Road Events allocation for GroupData 2026-11-01 13:32:38 +01:00
Florent 5d7100ae7d ui: add some parameters to the cli (mostly regarding eink behaviour) 2026-10-29 08:34:41 -04:00
quyenlt298 47c3005b08 Add Nelos allocation for GroupData 2026-10-07 13:09:36 +07:00
agessaman f4f394c0d7 kiss_modem: default AGC reset interval to 32 s
The AGC interval is set in 4 s steps, matching MeshCore's
agc.reset.interval, so the old 30 s default could not be restored by a
host: setting 30 gives 28. Found on hardware. Use 32 s, the nearest
multiple of 4 above it.
2026-09-23 18:51:03 -07:00
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 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
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
Scott Powell c6b051d063 * request payload doco 2026-09-13 11:40:25 +10:00
Robert Ekl 90a4f51f91 docs: update stale repo URLs and build recipe
The project moved to meshcore-dev/meshcore, but two links still pointed at
ripplebiz/MeshCore: the GitHub Issues link in README and the git clone in the
FAQ build instructions.

Also fixes the FAQ build recipe:
- `pio run -e RAK_4631_Repeater` does not exist; the env is spelled
  RAK_4631_repeater (variants/rak4631/platformio.ini:40).
- LORA_FREQ was given as 867.5; the default in [arduino_base] is 869.618
  (platformio.ini:29). Reworded to point at the flag rather than a value that
  drifts with the default preset.
- Renamed the venv so it no longer collides with the cloned directory name.

And one more env-name casing slip in the Raspberry Pi flashing instructions:
`Heltec_V3_companion_radio_ble` should be `Heltec_v3_...`. Release artifacts are
named directly from the env name (build.sh:147), and the two neighbouring
examples in the same block already use the lowercase spelling.
2026-09-02 11:38:06 -05:00
Robert Ekl fe5d4cc50d docs: remove non-existent set dutycycle from Terminal Chat CLI
f6338430 added get/set dutycycle to CommonCLI and updated both CLI docs, but
Terminal Chat does not use CommonCLI -- simple_secure_chat/main.cpp:479-507 has
its own `set` handler supporting only af, name, lat, lon, tx and freq. Typing
`set dutycycle` there returns "ERROR: unknown config".

Restores `set af` as the documented command, points readers at cli_commands.md
for the roles that do have dutycycle, and documents `help`
(simple_secure_chat/main.cpp:510), which the client implements but the doc
never listed.
2026-09-02 11:38:06 -05:00
Robert Ekl 208333d511 docs: correct pwrmgt CLI behaviour on unsupported boards
The doc claimed every pwrmgt command except `get pwrmgt.support` returns
"ERROR: Power management not supported" when NRF52_POWER_MANAGEMENT is not
defined. `get pwrmgt.bootreason` is not inside the #ifdef (CommonCLI.cpp:787)
and answers on all boards; only pwrmgt.source and pwrmgt.bootmv are gated.
2026-09-02 11:38:06 -05:00
Robert Ekl f5b6ff4c14 docs: fix channel index range, secret semantics and payload limit
Three factual errors in companion_protocol.md:

- The channel-datagram payload cap was given as 163 (MAX_FRAME_SIZE - 9 when
  MAX_FRAME_SIZE was still 172). It went 172 -> 176 in 62f1b11d, but simply
  updating the arithmetic to 167 would be worse than the stale value: 167 is
  only the host-frame bound (MyMesh.cpp:1265). The radio-side bound is
  MAX_GROUP_DATA_LENGTH = 184 - 16 - 3 = 165 (MeshCore.h:21, enforced at
  BaseChatMesh.cpp:544). A 166- or 167-byte payload passes the frame check,
  fails the radio check, and comes back as ERR_CODE_TABLE_FULL -- which this
  same doc describes as "retry later", so a conforming client would retry a
  permanently failing send forever. Documents 165 as the limit to enforce and
  calls out the 166-167 band explicitly.

- Channel index was documented as 0-7 throughout. The bound is
  MAX_GROUP_CHANNELS (BaseChatMesh.cpp:927,936), which is 40 on most current
  variants, 8 on some and 1 on others. Clients should read max_channels from
  byte 3 of PACKET_DEVICE_INFO instead. Index 0 is pre-populated with the
  built-in Public channel but is not reserved.

- The secret field was documented as "all zeros" for public channels. The
  firmware always hashes a real 16-byte key; the public channel ships with
  izOH6cXN6mrJ5e26oRXNcg== (companion_radio/MyMesh.cpp:111,1040). An all-zero
  secret is not a private channel and not an inert one: SHA256 over 16 zero
  bytes is a fixed global constant, giving a well-known channel with an
  all-zero AES key. searchChannelsByHash skips unnamed slots for exactly this
  reason (BaseChatMesh.cpp:392-401), but a named slot with a zero secret is
  not skipped and will absorb null-key group traffic from any node. Now
  documented as something not to do.
2026-09-02 11:38:06 -05:00
Robert Ekl f66ff1d13f docs: correct stale CLI default values
Five "Default:" values in cli_commands.md no longer matched the firmware:

- radio / freq: the default preset moved to EU/UK (Narrow) in b777a7c6,
  changing LORA_FREQ/BW/SF from 869.525/250/11 to 869.618/62.5/8
  (platformio.ini:29-31). No variant overrides these, and LORA_CR is 5
  on every path, so the full preset is 869.618,62.5,8,5.
- flood.advert.interval: raised to 47 hours in 40180b8f for both repeater
  and room server; sensor leaves it disabled.
- advert.interval: prefs store minutes/2 and the getter doubles on read, so a
  factory-fresh node reports 2, not 0. But savePrefs() zeroes any interval
  below the 60 minute minimum (CommonCLI.cpp:162-165), and it is called from
  every `set` handler -- so the value becomes 0 as soon as the node is
  configured. Documented both states, since neither alone is the whole story.
- direct.txdelay: repeater defaults to 0.3, room server and sensor to 0.2.

Sources: platformio.ini:29-31, simple_repeater/MyMesh.cpp:893,903-904,
simple_room_server/MyMesh.cpp:650,661-662, simple_sensor/SensorMesh.cpp:716,
726-727, CommonCLI.cpp:162-165,680-681.
2026-09-02 11:31:24 -05:00
Scott Powell 65650bb192 New TXT_TYPE_CLI_COMMAND (3) 2026-08-28 13:12:59 +10:00
ripplebiz a4ab7f0e59 Merge pull request #3137 from agessaman/feat/station-g3-fem-prefs
Station G3: Expose, persist, and apply FEM gain preferences
2026-08-12 16:11:23 +10:00
Scott Powell 727fc0512c Merge branch 'dev'
# Conflicts:
#	docs/payloads.md
2026-08-09 15:16:48 +10:00
Adam Gessaman c58c9b2f31 fix(station-g3): apply FEM PA level at TX start
PA PL1 re-targets the PA's DC-DC supply rail rather than selecting a
logic-level gain, and the serial CLI is serviced on every main-loop pass
regardless of whether a transmit is in flight. A `set radio.fem.txgain`
write could therefore move the rail mid-transmit, while the SX1262 was
still driving the PA at full input power.

Record the requested level in setPAGainEnable() and drive the pin from
setTxModeEnable(), which runs from onBeforeTransmit() ahead of
startTransmit(). The level only matters while transmitting, so deferring
costs nothing.

Document that the pref is saved immediately but applied at the next
transmit, so `get radio.fem.txgain` can lead the hardware until then.
2026-08-08 14:53:57 -07:00
agessaman 23066573e5 fix(station-g3): expose FEM gain preferences 2026-08-06 15:29:14 -07:00