17 Commits

Author SHA1 Message Date
Dorian
bf31f84676 feat(firmware): runtime PHY lock + drop post-TX self-RX on announces
- "LOCK:<T|C|R>" serial command pins the radio to one PHY for debugging /
  focused RX testing; "LOCK:" resumes the normal RTC scan
- clear rxFlag after a Reticulum announce TX so the TX-done interrupt no longer
  makes the bridge log a phantom "reception" of its own packet

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 20:32:39 +01:00
Dorian
a62d989c9e feat(firmware): Reticulum announce RX — decode + verify heard announces
- handleReticulumPacket: parse RNS packet header (HEADER_1/2, flags), extract
  ANNOUNCE payload, reconstruct signed_data, verify Ed25519 signature with the
  announced signing key, and confirm dest_hash = SHA256(name_hash ||
  SHA256(pubkey)[:16])[:16]; register the destination (pubkey/app_data table)
- "RXR:<hex>" serial hook injects raw packets for radio-free validation
- verified against real RNS-generated announces: valid one decodes with correct
  dest + app_data; tampered signature is rejected

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 19:22:42 +01:00
Dorian
422cb9b8da feat(firmware): Reticulum announce TX — valid RNS destination broadcast
- RNS identity: X25519 (encryption, rweather Curve25519) + Ed25519 (signing,
  orlp) keypairs, persisted in NVS; public_key = X25519pub || Ed25519pub
- dest hash = SHA256(name_hash || SHA256(pubkey)[:16])[:16] for "archy.messh"
- ANNOUNCE packet: [flags 0x01][hops 0][dest_hash 16][context 0][pubkey 64 +
  name_hash 10 + random_hash 10 + Ed25519 sig 64 + app_data]; sig covers
  dest_hash||pubkey||name_hash||random_hash||app_data (no ratchet)
- periodic auto-announce on the R window
- VERIFIED byte-valid against the real RNS 1.3.5 library: Identity.validate
  accepts the signature and the dest hash matches (cross-validated offline;
  no RNode hardware available to test on-air)

All three networks now transmit: meshTastic text, MeshCore advert+DM, RNS announce.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 19:12:00 +01:00
Dorian
986ab153e4 chore(firmware): set Reticulum R PHY to the operator's RNS config
- 869.525 MHz / 125 kHz / SF8 / CR4:5 (was a placeholder 867.2 MHz)
- matches the reticulum-daemon defaults + user's stated RNode interface
- NOT yet verified on air: no RNode transmitting to receive from, so RX
  decode is still unbuilt/untestable. Sync word 0x12 assumed (RNode default).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 18:49:23 +01:00
Dorian
8939b9524f feat(firmware): MeshCore text TX — send encrypted DMs to contacts
- sendMeshCoreText: plaintext (timestamp + flags + text) -> encryptThenMAC
  (AES-128-ECB zero-padded + 2-byte HMAC-SHA256 prefix), wrapped as
  [header route=flood|type=TXT_MSG][path_len 0][dest_hash][src_hash][cipher]
- serial "C:msg" now DMs the text to every heard MeshCore contact
- verified end-to-end: bridge DM decrypts to plaintext on a real node

Completes bidirectional MeshCore messaging (advert TX + DM RX + DM TX).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 18:40:03 +01:00
Dorian
38c146c477 feat(firmware): MeshCore message RX — decrypt DMs addressed to us
- vendor orlp/ed25519 (lib/ed25519, MIT — the exact lib MeshCore uses) for
  Curve25519 ECDH key exchange; switch identity/advert signing to it (same
  seed -> same pubkey, so peers still recognise us; sigs are byte-identical)
- store pubkeys from heard MeshCore adverts (contacts table) so a DM's
  1-byte src_hash can be resolved to a full sender key
- decode PAYLOAD_TYPE_TXT_MSG: ECDH shared secret, HMAC-SHA256 MAC check,
  AES-128-ECB decrypt, parse timestamp+text, drive the message modal
- verified end-to-end: real MeshCore node -> "hello from HP Pro Desk" decoded

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 18:30:20 +01:00
Dorian
8e5b4c97d7 feat(firmware): MeshCore advert TX + Meshtastic text send
- MeshCore: fix PHY to live narrowband config (869.618/62.5/SF8/CR5),
  read off the test node's SELF_INFO — old 869.525/250/SF11 heard nothing
- MeshCore: on-chip Ed25519 identity (rweather/Crypto, NVS-persisted) and
  signed ADVERT TX (verified valid + received by a real node) — the bridge
  now shows up as a MeshCore contact
- Meshtastic: send text messages (portnum 1) reusing the announce path
- serial TX console with per-network targeting ("T:hi" / bare = all)
- longer dwell (3000ms) to sit through flood-rebroadcast bursts

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 18:07:05 +01:00
Dorian
d731bfd7fa feat: Meshtastic TX — device announces as a named node (messageable)
The device now transmits a NodeInfo (User protobuf: id/long_name/short_name)
on the LongFast primary channel every 60s, so it appears in other Meshtastic
clients as 'Reticutasticore' / 'RTC'. NodeNum derived from the MAC
(!4359d2d0). No public key advertised, so DMs to us fall back to channel
encryption — which the existing RX path already decodes and displays.

Confirmed on hardware: announce tx=0 (success) on the first T-window.

Also spec the planned message-received animation (upside-down spinning
smiley + lightning bolts -> Meshtastic-style modal) in the README.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 16:35:18 +01:00
Dorian
a284c91848 feat: RTC rebrand + on-chip Meshtastic decode + acid display
- Rebrand to RTC (Reticulum / meshTastic / meshCore); Meshtastic row = T.
- On-chip Meshtastic decode (mbedtls AES-128-CTR + protobuf) surfacing text
  and node short-names, mirroring firmware/tools/meshtastic_decode.py.
- Device identity 'Reticutasticore' / 'RTC' (DEVICE_NAME) baked in for all
  three networks; boot splash shows it.
- Trippy OLED: acid smiley with a periodic spinning-striped freak-out
  (googly eyes + gaping mouth), punk 'bubble' RTC header, three live network
  rows (counts + RX blips), last-decoded line.
- Hardware-confirmed: Meshtastic + MeshCore both received (0x12 MeshCore
  sync word guess validated); Reticulum still placeholder.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 16:23:45 +01:00
Dorian
de4995468d feat: reference Meshtastic decoder, validated on real captures
AES-128-CTR (public LongFast key) + minimal protobuf walk. Verified against
packets our scanner captured on-air: decoded a live NodeInfo (longName
'Arch Optiplex', shortName 'ARCH') and POSITION packets. Serves as the
reference for the on-chip C++ port in src/main.cpp.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 16:23:44 +01:00
Dorian
1fcb0f4c59 feat: trippy acid-house display UI (RMC) on the OLED
Add SSD1306 UI to the Phase 1 scanner: an animated acid smiley inside
expanding psychedelic rings, an 'RMC' (Reticulum/Meshtastic/meshCore)
strobe header, and three live network rows with per-network packet counts
and RX activity blips. Scan loop made non-blocking (millis-based dwell) so
the display animates smoothly (~20fps) while the radio rotates.

Honest note in-code: the single SX1262 is time-sliced across the three
PHYs (ARCHITECTURE.md §2); the UI shows all three armed but true concurrent
RX needs added radios (Phase 2). Pins U8g2 2.36.18.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 16:02:33 +01:00
Dorian
c3f404872e feat: Phase 1 firmware — time-multiplexed tri-protocol RX scanner
First Phase 1 increment toward the single-device 3-in-1: one Heltec V3
(ESP32-S3 + single SX1262) rotating the radio through the Meshtastic /
MeshCore / Reticulum PHY presets, logging every raw packet it demodulates
per dwell window. No framing/crypto/bridge yet — proves the RX loop first.

Validated on hardware: radio.begin() clean, all three presets cycle, and
the Meshtastic window received live broadcast packets (-36..-41 dBm). The
single-radio time-multiplex premise (ARCHITECTURE.md §2) holds.

MeshCore sync word and Reticulum PHY are flagged placeholders in CONFIGS[].
Deps pinned (espressif32 7.0.1, RadioLib 7.7.1). Adds venv/pycache/storage
to .gitignore.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 15:45:36 +01:00
Dorian
dbfdf1c851 fix: close relay loop from prefixed dedup mismatch
The dispatcher deduped on inbound text but relayed a prefixed copy
("[net/sender] text"), so a re-heard relayed message hashed differently
and was re-relayed, stacking another prefix each hop — an unbounded loop,
exactly what the dedup was meant to prevent.

Add MessageBus.mark_seen() and record the on-air relayed string before
sending, so the bridge recognises and drops its own relayed copies.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 15:31:52 +01:00
Dorian
d04e4c8370 fix: clean MeshCore adapter shutdown
close() stopped the asyncio loop without disconnecting first, leaving the
EventDispatcher._process_events() task and the serial transport pending
("Task was destroyed but it is pending!" / "Event loop is closed").
Now await MeshCore.disconnect() and let the transport's connection_lost
callback settle before stopping the loop, then join the thread.

Found by running the adapter against a live MeshCore-flashed Heltec V3.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 15:31:52 +01:00
archipelago
512e30a6fd Add Phase 0 host-bridge: relay text across Meshtastic, MeshCore, Reticulum 2026-06-30 20:32:38 -04:00
archipelago
1884a25a6d Add protocol research synthesis and phased architecture plan 2026-06-30 19:54:40 -04:00
archipelago
d26a7008d6 Initial scaffold for archy-messh 2026-06-30 19:41:21 -04:00