Commit Graph
264 Commits
Author SHA1 Message Date
mikecarper 4aac727c38 feat: add opt-in internal-flash RAK4631 bootloader migration 2026-10-23 12:54:18 -07:00
mikecarper df2e56d98e docs: record RAK4631 LoRa bootloader migration validation 2026-10-23 12:42:15 -07:00
Ben Allfree c91c24aed6 integrate: repeater-v1.18.0 + EnvyOS overlay 2026-10-16 05:30:11 -07:00
Scott Powell 81dbae592f Merge branch 'dev' 2026-10-15 19:42:40 +11:00
Ben Allfree f7237643e6 feat(cli): print discover reply snr 2026-10-13 10:18:36 -07:00
quyenlt298 47c3005b08 Add Nelos allocation for GroupData 2026-10-07 13:09:36 +07:00
liamcottle a11009f2df add radio preset docs 2026-09-30 14:52:58 +13: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
Alexander Wunschik 448d1b2239 docs: fix frame format tables 2026-09-18 16:59:26 +02:00
Scott Powell c6b051d063 * request payload doco 2026-09-13 11:40:25 +10:00
Ben AllfreeandCursor 0291e13c23 feat(cli): add try confirm-or-revert command
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-04 19:57:15 -07: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
Ben AllfreeandCursor 6464e69895 integrate: companion-v1.17.1
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-29 19:11:18 -07:00
Scott Powell 65650bb192 New TXT_TYPE_CLI_COMMAND (3) 2026-08-28 13:12:59 +10:00
Rastislav Vysoky acac4af3ec FAQ: Fixed instructions on wiping and resetting nrf52 devices 2026-08-23 20:13:12 +02: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
Ben AllfreeandCursor dc1824ada0 freshen: merge EnvyOS overlay onto companion-v1.17.0
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-09 05:38:49 -04: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
ripplebiz 57ddada3ba Merge pull request #3004 from axhoff/agent/preserve-utf8-advert-names
Preserve UTF-8 boundaries in advert names
2026-07-30 12:59:59 +10:00
Ben Allfree 909d839355 fix(mesh): disable hop retry by default
Co-authored-by: Cursor <cursoragent@cursor.com>
(cherry picked from commit 0e70236c7d2ec5be2def6ee782222ee96b2618c8)
2026-07-27 23:58:21 -07:00
Ben Allfree be7b38fc05 Role-aware nRF52 OTA staging ceiling
Co-authored-by: Cursor <cursoragent@cursor.com>
(cherry picked from commit 5116d0ba3c8c2992d86f19e652966d9b264094d1)
2026-07-27 23:57:54 -07:00
Ben Allfree 4442fbc299 fix(cli): log tail on enables logging
Co-authored-by: Cursor <cursoragent@cursor.com>
(cherry picked from commit 7fd0f6b7c8fdfddf2b1cfa05feb33afbfafa4458)
2026-07-27 23:57:54 -07:00
Ben Allfree c74e4f86bb feat(mesh): echo-primary hop retry
Co-authored-by: Cursor <cursoragent@cursor.com>
(cherry picked from commit 1f7e70a93cbc784525f41cdf19c890626e306e60)
2026-07-27 23:57:54 -07:00
Ben Allfree 9b3c9b10d9 feat(mesh): add hop.ignore test-mode drop
Co-authored-by: Cursor <cursoragent@cursor.com>
(cherry picked from commit 7dedbdd66fcc76c0d70c0d67ee12a6314dd8398b)
2026-07-27 23:57:20 -07:00
Ben Allfree e4f789cd97 feat(cli): add log tail on/off serial mirror
Co-authored-by: Cursor <cursoragent@cursor.com>
(cherry picked from commit fc013f42fdcc19ffb1ad1d78c095314961b13ab3)
2026-07-27 23:57:11 -07:00
Ben Allfree 8cc6e3c915 feat(mesh): hard hop ack for next-hop retry
Co-authored-by: Cursor <cursoragent@cursor.com>
(cherry picked from commit 18be8ace525b770f317bd873b8284af72fbfd557)
2026-07-27 23:57:11 -07:00
Ben Allfree b330b98fdf Add next-hop retry for direct-path relays
Co-authored-by: Cursor <cursoragent@cursor.com>
(cherry picked from commit 97470f418cdef8ed52834b3d2bd2ba62108f1fd9)
2026-07-27 23:57:03 -07:00
Valentin Kivachuk Burda 54906db729 ota: extract the motatool CLI to its own repo (github.com/vk496/motatool)
The host-side build/verify/inspect/serve CLI now lives as a standalone Rust
project at https://github.com/vk496/motatool. Remove the in-tree C++ copy
(tools/motatool/) and repoint the docs (ota_protocol.md, ota_user_guide.md,
tools/mota/README.md) at the standalone repo.

No cross-dependency either direction: MeshCore's firmware build never invoked
motatool (only tools/mota/ Python glue runs in the build), and motatool depends
only on the shared .mota wire spec in docs/ota_protocol.md. tools/mota/
(pio_endf.py EndF hook, motalib.py reference lib, gen_targets.py) is unchanged.

(cherry picked from commit 872413231d)
2026-07-27 23:56:41 -07:00
Valentin Kivachuk Burda cf668879f6 docs: clarify the warm-start capture workflow (--seed flag + validate switch)
Spell out how the warm-start seed is actually applied (a user asked): the seed is the --seed <file> given to `motatool serve`, NOT a file dropped into the --dir destination (which starts empty). motatool stamps that one seed into the fresh .part on every `… folder validate` begin, so it's always the named file — no guessing. `validate` is the switch (a plain folder pull fetches from 0); a re-pull re-begins fresh (never resumes a stale partial); a mismatched/absent seed just falls back to fetching those blocks over the radio (correct result, only slower).

(cherry picked from commit cbdc629f20)
2026-07-27 23:56:41 -07:00
Valentin Kivachuk Burda c33077af5a ota: admin OTA statistics — ota stats reply
Add an admin-only `ota stats` reply: one dense line with the running firmware's merkle content-id (mid) AND its EndF body_hash (only body_hash was surfaced before), version, served-set count + digest, live fetch state/progress, and policy — snprintf-bounded to the 160-byte reply. The remote CLI path is already admin-gated, so it's admin-only over the mesh (send it from the app's repeater command screen, or the WiFi/serial OTA console). A new servedDigest() accessor exposes the beacon set-digest.

HW-verified on RAK4631: reports the fw identity + live fetch state (incl. during a warm-start capture).

(cherry picked from commit b159737ede)
2026-07-27 23:56:41 -07:00
Valentin Kivachuk Burda 033109d88d ota: fragment-level want_mask requests (anti-burst) + warm-start leaf-diff capture
Protocol: OTA_REQ and OTA_GET_MANIFEST now carry a want_mask bitmap, so a fetcher asks for specific fragments (all on the first request, only the still-missing holes on a retry) instead of a whole block/manifest window. The WANT_MANIFEST and FETCHING retry loops re-ask only on a no-progress tick, so a lost fragment costs one fragment to recover and a re-request can't collide with an in-flight multi-fragment burst on half-duplex radios.

Warm-start (motatool folder-capture only): new OTA_GET_LEAVES/OTA_LEAVES let `ota pull <#> folder validate` bulk-fetch the target's merkle leaves, authenticate them against the manifest root, diff a similar seed build already staged in the destination, and pull DATA over LoRa only for the blocks that differ. Leaves are bitmap-fragmented + no-progress retry-gated like the manifest, capped at OTA_DIFF_MAX_BLOCKS so the want_mask stays a fixed uint16, and the diff runs a bounded batch per loop tick so it never starves the mesh loop. motatool `serve --seed <build.mota>` injects the seed payload into the destination .part on OP_BEGIN.

(cherry picked from commit 8953214761)
2026-07-27 23:56:41 -07:00
Valentin Kivachuk Burda fb0778de34 docs: pull a firmware .mota off the mesh into a motatool folder
Document `ota pull <#> <dest>` (flash|folder, destination mandatory), the folder
pull that captures a device's exact firmware to the host as <mid>.mota (for
delta-building), the paused/resume-on-reconnect behaviour, and that a `motatool
serve` link doubles as the pull-to-folder store. (protocol §10, user guide,
motatool README)

(cherry picked from commit 49820b57aa)
2026-07-27 23:56:40 -07:00
Valentin Kivachuk Burda 6fbcda6e3c ota: configurable hop limit (ota config hops) + accept-gate + forward RAM guard
Bound OTA-over-LoRa duty cycle across repeaters with one runtime-tunable,
persisted limit (OtaManager::max_hops, `ota config hops <0..8>`, default 3):

- Accept-gate: a node ignores OTA that arrived from more than max_hops hops
  away (neither processes nor relays it). 0 = direct only.
- Forward-cap: relay a flood only while still under max_hops, appending this
  node's path-hash (hop count increments like the mesh flood routing).
- RAM guard: relay an OTA flood only while more than OTA_FWD_MIN_FREE packet-
  pool slots stay free, so heavy OTA (best-effort, lowest-priority) can never
  monopolise the shared pool and starve real traffic — a dropped relay is
  re-requested by the source.

Persisted in NodePrefs (CommonCLI) and shown in `ota config`. Docs updated.

(cherry picked from commit 259802b706)
2026-07-27 23:56:33 -07:00
Valentin Kivachuk Burda 401278918a ota: configurable advertise interval (default 24h) + advertise on served-set change
The discovery beacon previously re-announced at a random 3-10 min interval.
Replace that with a fixed, user-configurable cadence:

- OtaManager::advert_mins() — re-advertise every N minutes after the boot
  burst; 0 disables periodic re-advertise (boot burst only). Default 24h.
- Persisted in NodePrefs (CommonCLI) and runtime-tunable: `ota config advert
  <minutes>` (0..10080; 0 = off), and shown in `ota config`.
- When periodic advert is disabled, the scheduler still re-checks the config
  on a slow timer, so a later `ota config advert <mins>` takes effect live.

Also advertise immediately whenever the served set changes — when a motatool
folder is attached to / detached from the ESP32 WiFi seeder — so peers learn
about newly-available firmware without waiting for the next interval (the
`ota folder` serial path already announced on attach).

Docs: protocol beacon-cadence note + user-guide `ota config advert`.
(cherry picked from commit 9ff1c883c2)
2026-07-27 23:56:20 -07:00
Valentin Kivachuk Burda de077fbfec ota: serve & manage OTA over WiFi (motatool --tcp + ESP32 companion seeder/console)
Extends the USB-serial folder relay to WiFi so an ESP32 companion can both
serve .mota and be operated headlessly:

- motatool `serve --tcp <host[:port]>`: a TcpTransport sibling of the serial
  transport (default port 5001). SeederCore/Folder are reused unchanged — the
  COUNT/DESCRIBE/READ protocol is transport-agnostic.
- ESP32 companion: a dedicated OTA seeder port (5001) for `serve --tcp`, plus
  an OTA text console on 5002 (`nc <ip> 5002` -> `ota status|ls|announce|...`,
  the same handle_ota_command CLI serial nodes have). Both run alongside the
  phone-app port (5000); all three coexist.
- WiFi.setSleep(false): ESP32 STA mode's modem power-save periodically sleeps
  the modem/CPU and stalls the SX1262 SPI+DIO servicing, leaving LoRa deaf
  while WiFi is associated. Disabling it restores the radio (HW-validated:
  a V3 WiFi companion is then discovered over LoRa and discovers its peers).
- docs: serving .mota over WiFi (protocol §10.2 + user guide).

(cherry picked from commit 280b9b1555)
2026-07-27 23:56:07 -07:00
Valentin Kivachuk Burda fd253f67f7 ota: protocol spec + user guide
(cherry picked from commit 54c8b586c1)
2026-07-27 23:56:07 -07:00
DG1TAL 84ceabfd0d Clarify hashtag privacy and group sender identity 2026-07-27 20:07:08 +02:00
Talia b62b421456 docs: increase header levels on payloads page to fix table of contents
mkdocs will only consider the first H1 (if any) and subheaders under it for the table of contents

this increases the header levels of everything below "important concepts" by 1 so that the table of contents correctly resolves them
2026-07-26 15:55:27 -07:00
Liam Cottle d531a98da1 Merge pull request #2819 from ViezeVingertjes/fix/kiss-modem-usb-backpressure
fix: prevent ESP32 KISS modem stalls under USB backpressure
2026-07-24 11:51:34 +12:00
Alexander Hoffer 79dc1de6fc fix: preserve UTF-8 advert names 2026-07-20 15:47:03 +01:00
liamcottle 8c987c8689 Merge remote-tracking branch 'official/main' into dev 2026-07-20 20:42:09 +12:00
ViezeVingertjes fb2c61f862 fix: prevent ESP32 KISS modem stalls under USB backpressure
Switch ESP32-S3 KISS modem environments to HWCDC and move outbound KISS writes to a non-blocking queued frame path so loop() and TX completion keep progressing when the host reads slowly. Add native backpressure regression tests and correct the native_kiss_modem test filter so this suite runs directly with pio test.
2026-07-18 22:43:55 +02:00
Ryan Gregg 16b76bd35a Merge remote-tracking branch 'upstream/dev' into rak-ethernet
# Conflicts:
#	examples/companion_radio/main.cpp
2026-07-13 23:06:00 -07:00