Commit Graph
46 Commits
Author SHA1 Message Date
tthandClaude Opus 5 4caf52bb7a fix(mesh): sendZeroHop mazal šířku path hashe, uzel se hlásil jako 1bajtový
`packet->path_len = 0` vynuluje celý bajt — a v jeho horních dvou bitech bydlí
šířka hashe (`Packet.h:85`). Zerohop paket proto hlásil 1 B bez ohledu na
`path_hash_mode`, zatímco floodová větev šířku dostávala. Na uzlu s 2bajtovým
nastavením to vypadalo takhle: `flood: {2 B}` a `route2: {1 B}` od téhož
původce, přesně `advert.interval` od sebe.

Routing to nerozbíjí (zerohop nemá cestu a nepřeposílá se, `Mesh.cpp:83` chce
`getPathHashCount() > 0`), ale kazí to odvozování šířky v analyzerech — a je to
pravděpodobné vysvětlení části komunitních uzlů vedených jako "suspected 1B".

`sendZeroHop()` dostal `path_hash_size=1` jako `sendFlood()` a všechna čtyři
volání v `simple_repeater` mu předávají `_prefs.path_hash_mode + 1`. Zvlášť to
u periodického advertu (`MyMesh.cpp:1706`), který NEJDE přes
`sendSelfAdvertisement()` — oprava jen v té funkci by ho minula, a přitom je to
zrovna on, koho bylo v datech vidět.

Ostatní příklady se nemění, default zachovává dnešní chování. Build ověřen na
všech třech produkčních envech.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-22 15:04:52 +02:00
tthandClaude Opus 5 9d5491f5db Merge upstream v1.17.0 (origin/main) into the analyzer/BLE fork
Upstream shipped companion/repeater/room-server v1.17.0 today; its tree is
identical to origin/main, so that is what this merges. Our base was 7 Jul
(7b566670), i.e. 350 files / +11k lines of upstream behind.

Conflicts and how they were settled:

* Mesh.cpp -- upstream split the dedup into wasSeen() + explicit markSeen().
  Kept BOTH: their new call pair AND our payload-length bound on the TRACE
  path-hash read, which is what stops a crafted short TRACE from steering
  isHashMatch() past the buffer.
* companion_radio/main.cpp -- upstream grew its own MultiSerialInterface
  (BLE + USB + WiFi + Ethernet registered side by side), which is a superset
  of the SerialDualInterface we backported from PR #1779. Took theirs whole;
  our copy is now dead code. NOTE: envs that relied on the backport for a USB
  console alongside BLE now need an explicit -D ENABLE_USB_INTERFACE.
* ui-new/UITask.cpp -- isSerialEnabled() was renamed isBluetoothEnabled()
  upstream and DisplayDriver::RED became UIColor::warning_txt. Same intent
  either way: no BT pin on screen while Bluetooth is off.
* EnvironmentSensorManager.cpp -- upstream fixed the millis() wrap on the GPS
  update timer in the exact line our gpsDutyLoop() call sits on. Kept both,
  with their wrap-safe compare.
* NRF52Board.cpp -- upstream independently arrived at the same sd_temp_get()
  fix for SoftDevice-protected TEMP. Took their form, kept our comment, which
  is the only place recording WHY (APP_MEMACC fault -> reboot on telemetry).
* RadioLibWrappers.{h,cpp}, simple_repeater/main.cpp -- add/add. Their
  configSideDetectors()/performChannelScan()/external watchdog next to our
  irqDoneMask()/probeDio1()/BLE pump/WDT feed. The repeater console keeps the
  1032-byte reply buffer for paged analyzer output and now clears it, since a
  static buffer would otherwise reprint the previous reply.
* .vscode/extensions.json -- deleted upstream, and it is in .gitignore; our
  only change was a comment. Gone.

Built clean: Xiao_x1_rpt, Xiao_x2_cmp, Xiao_x3_obs, SenseCap_s1_rpt,
T1000E_cmp_cz. Not flashed to anything yet.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-09 22:44:07 +02:00
Scott Powell 49319023e5 Merge branch 'dev'
# Conflicts:
#	docs/payloads.md
2026-08-09 14:36:53 -04:00
tthandClaude Opus 4.8 ab2eb70714 harden: bounds-check radio TRACE/PATH packet parsing
onRecvPacket() used two received length fields without validating them against the actual received/decrypted length (TRACE payload_len underflow + OOB read; PATH path_len OOB stack read + extra_len underflow). Both now validated before use.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-11 19:21:11 +02:00
Scott Powell f7f8a331cd Merge branch 'dev'
# Conflicts:
#	docs/faq.md
2026-06-06 21:12:43 +10:00
Scott Powell 19499a4eda * support for sending 5-byte ACKs 2026-05-17 22:10:13 +10:00
Stephen Waits 16087b942b fix(mesh): widen TRACE offset to uint16 to avoid narrowing 2026-05-11 19:32:56 -06:00
Scott Powell 62320b64c5 * refactor of Contact/Client out_path_len (stored in files), from signed to unsigned byte (+2 squashed commits)
Squashed commits:
[f326e25] * misc
[fa5152e] * new 'path mode' parsing in Dispatcher
2026-02-21 19:35:51 +11:00
Scott Powell ca6f8ce219 * check for 'early receive' ACK 2025-12-27 20:46:28 +11:00
Scott Powell edca616725 * proposal for 'Extended Trace' packets. Using 'flags' byte, lower 2 bits, for path hash size. 2025-11-21 15:44:31 +11:00
Scott Powell 778c2bfe9f * new PAYLOAD_TYPE_CONTROL (11)
* repeater: onControlDataRecv(), now responds to new CTL_TYPE_NODE_DISCOVER_REQ (zero hop only)
* node prefs: new discovery_mod_timestamp  (will be set to affect when node should respond to DISCOVERY_REQ's )
2025-11-06 00:56:54 +11:00
Scott Powell fc909dfc24 * RegionMap: inverted 'flags' to _deny_ bits
* Mesh: new filterRecvFloodPacket() for overriding
* repeater CLI: 'allow' -> 'allowf' or 'denyf'
2025-11-05 14:34:44 +11:00
Scott Powell 47a74f6a12 * Mesh: new sendFlood() overload with transport codes.
* BaseChatMesh:  sendFloodScoped(), for overriding with some outbound 'scope' / TransportKey
* companion: new 'send_scope' variable.
2025-11-04 01:21:56 +11:00
Scott Powell ff07bbc2ad * Companion: Now using transport codes { 0, 0 } when Share contact zero hop.
* Repeater: onAdvertRecv(), adverts via Share now NOT added to neighbours table
2025-10-31 20:40:22 +11:00
Scott Powell cb00823dc5 * Upping max channel hash conflicts to 4 (was 2) 2025-10-31 16:54:58 +11:00
Scott Powell 51eae0bf6f * CommonCLI: new "multi.acks" config setting 2025-07-16 18:51:18 +10:00
Scott Powell b574709030 Merge branch 'dev' into double-acks 2025-07-09 14:59:25 +10:00
Scott Powell 1c9194181a * Mesh::onAnonDataRecv() slight optimisation, so that shared-secret calc doesn't need to be repeated
* SensporMesh: req_type now optionally encoded in anon_req payload (so can send various requests without a prior login)
2025-07-08 23:19:35 +10:00
Scott Powell 169d33290e Merge branch 'dev' into double-acks 2025-07-08 22:14:48 +10:00
Scott Powell eec347efa5 * PAYLOAD_TYPE_PATH: reserving upper 4 bits if 'extra_type' field, for future use 2025-06-30 23:18:16 +10:00
Scott Powell 117d2d2f22 * new PAYLOAD_TYPE_MULTIPART
* experimental double ACK's (at each hop), sent 300ms apart (direct mode only)
2025-06-23 01:14:08 +10:00
Scott Powell ed0ceaa4af * Mesh: reciprocal path send now with slightly less priority and 500ms delay 2025-06-03 20:28:05 +10:00
Scott Powell b816e3c75d * possible bug when forwarding direct mode packets 2025-05-18 21:22:27 +10:00
Scott Powell 122223a9aa * added Packet::getRawLength() helper 2025-04-11 15:12:04 +10:00
Scott Powell debdfef299 * verify() fix moved to Identity class 2025-03-19 17:30:35 +11:00
Scott Powell d617e78558 * workaround for Identity::verify() bug. 2025-03-19 14:31:48 +11:00
Scott Powell 911fd2994a * experimental workaround for sig verify() bug 2025-03-19 13:54:43 +11:00
Scott Powell 3aa7cf5652 * redesigned TRACE packet structure 2025-03-17 17:56:12 +11:00
Scott Powell 8379a785cc Merge branch 'dev' into trace
# Conflicts:
#	src/Dispatcher.cpp
#	src/Mesh.cpp
#	src/helpers/BaseChatMesh.cpp
2025-03-07 12:14:26 +11:00
Scott Powell 7c1c273255 * new Dispatcher::getCADFailRetryDelay() 2025-02-27 04:05:50 +11:00
Scott Powell b4b9705c7d * repeater and room server: login password now using strcmp(), new 'set direct.txdelay ..' config 2025-02-24 20:52:13 +11:00
Scott Powell 509964427a * new PAYLOAD_TYPE_RAW_CUSTOM 2025-02-23 15:35:33 +11:00
Scott Powell 6af88ed02f * MESH_DEBUG_PRINTLN fixes 2025-02-20 18:04:35 +11:00
Scott Powell 159c4ce8c2 * Mesh/Dispatcher: MESH_DEBUG_ and MESH_PACKET_LOGGING now output date-time. (new getLogDateTime() virtual)
* MESH_PACKET_LOGGING now parity with dynamic/file logging (src/dest hashes)
2025-02-20 12:41:47 +11:00
Scott Powell bea3ccb116 * new Packet type: PAYLOAD_TYPE_TRACE 2025-02-17 19:22:31 +11:00
Scott Powell 4a601f8241 * Terminal Chat: new commands "card" and "import" 2025-02-01 21:45:34 +11:00
Scott Powell 22e87836db * Mesh.cpp: optimisation to not retransmit packets handled by this node
* simple_repeater: now supports a remote CLI
2025-01-22 12:11:43 +11:00
Scott Powell 96724cd26a * onPeerPathRecv() refactored: 'reciprocal path' now handled in Mesh class, not in application layer 2025-01-21 18:39:55 +11:00
Scott Powell ec92bfa6b1 * Refactor: Mesh::onPeer ... methods added 'secret' param. (is whatever getPeerSharedSecret() returned) 2025-01-15 20:52:13 +11:00
Scott Powell a05b951018 * removed unused Destination class 2025-01-14 20:13:20 +11:00
Scott Powell 20fccac2b7 * refactored the hasSeen(Packet) stuff. 2025-01-14 06:43:03 +11:00
Scott Powell 8983584dd8 * added getTransmitDelay(), applied to Flood mode retransmissions. 2025-01-13 20:45:01 +11:00
Scott Powell d06532d6f1 * simple_secure_chat: bug fixes 2025-01-13 16:57:01 +11:00
Scott Powell d291c6d31e * zeroing of path_len now in sendFlood() 2025-01-13 15:09:03 +11:00
Scott Powell 2faff914f6 * separated PAYLOAD_TYPE_ANON_REQ, to new createAnonDatagram(), with extra 'sender' param. So, caller can use 'self_id' or ephemeral key 2025-01-13 15:01:15 +11:00
Scott Powell 6c7efdd0f6 Initial commit 2025-01-13 14:07:48 +11:00