Skip to content

[codex] Add MC0 BLE companion transport#69

Draft
n30nex wants to merge 3 commits into
ItsLimitlezz:mainfrom
n30nex:codex/mc0-ble-transport
Draft

[codex] Add MC0 BLE companion transport#69
n30nex wants to merge 3 commits into
ItsLimitlezz:mainfrom
n30nex:codex/mc0-ble-transport

Conversation

@n30nex

@n30nex n30nex commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

What changed

Adds a private MeshCore MC0-over-BLE companion transport for LimitlezzOS/test clients:

  • Adds src/mc_ble_companion.cpp, a T-Deck NimBLE GATT service advertising as Limitlezz-MC0-<shortname> with RX write and TX read/notify characteristics.
  • Adds serial controls: companion mc ble on|off|status|test.
  • Routes BLE MC0 requests through the shared MC0 parser with bridge=ble, while USB remains bridge=usb.
  • Keeps external-app arbitration explicit: enabling MC0 BLE disables Meshtastic USB/BLE and MC0 USB, and vice versa.
  • Adds session cleanup so MC0 event streaming does not leak across USB/BLE teardown.
  • Adds scripts/mc_companion_ble_smoke.py for host BLE smoke testing and includes it in CI Python compile checks.
  • Updates README/roadmap/protocol/inventory docs to state the honest boundary: private MC0 BLE transport is implemented for test clients; official MeshCore app compatibility is not claimed until the real app protocol is mapped.

Stack

This branch is stacked on the earlier MC0 companion work:

Validation

Local validation run on Windows before push:

  • git diff --check
  • python -m py_compile scripts\check_tdeck_budget.py scripts\fetch_tdeck_artifact.py scripts\serial_harness.py scripts\tdeck_smoke.py scripts\tdm_airtime_smoke.py scripts\mc_companion_usb_smoke.py scripts\mc_companion_ble_smoke.py scripts\release_evidence.py
  • pio run -e native
  • .pio\build\native\program.exe --selftest
  • .pio\build\native\program.exe --simtest
  • pio run -e tdeck-meshcore succeeded; RAM 241,364 / 327,680 bytes, flash 1,589,021 / 5,242,880 bytes
  • pio run -e tdeck succeeded; RAM 241,356 / 327,680 bytes, flash 1,587,297 / 5,242,880 bytes

GitHub Actions:

  • Firmware CI run 27880813251 passed for 0593c7daf85f64e2801143e0313e81b2045f2640.
  • Downloaded artifact tdeck-meshcore-firmware-0593c7daf85f64e2801143e0313e81b2045f2640 to .pio\ci-artifacts\mc0-ble-0593c7d.
  • Manifest: env=tdeck-meshcore, meshcore_enabled=1, budget_status=pass, firmware_bytes=1589264, static_ram_bytes=241364.

COM8 hardware validation:

  • Flashed the exact Actions artifact to COM8 with scripts\tdeck_smoke.py --port COM8 --env tdeck-meshcore --no-stub-upload --skip-build --artifact-dir .pio\ci-artifacts\mc0-ble-0593c7d.
  • esptool detected ESP32-S3 rev v0.2, MAC cc:8d:a2:0d:14:28, and verified flash hashes.
  • Serial smoke passed id, sys, net, rf, stats, wifi, companion mc test, companion mc ble on, companion mc ble status, companion mc ble test, companion mc ble off, companion, and companion test.
  • BLE client smoke passed: python scripts\mc_companion_ble_smoke.py --mc0-tx-smoke --scan-timeout 20 --connect-timeout 30 --timeout 30 --verbose connected to Limitlezz-MC0-*, asserted bridge=ble, read identity/nodes/threads, sent Public text, and observed MC0 EVT tx_status for client_mid=mc0-ble-smoke-tx.
  • Restored final COM8 state: MC0 BLE off, Meshtastic on, MeshCore on, Balanced airtime, RF SPLIT MT 50% / MC 50%.

@n30nex

n30nex commented Jun 20, 2026

Copy link
Copy Markdown
Contributor Author

COM8 validation for commit 0593c7daf85f64e2801143e0313e81b2045f2640 is complete.

  • Actions run 27880813251 passed.
  • Downloaded exact artifact tdeck-meshcore-firmware-0593c7daf85f64e2801143e0313e81b2045f2640; manifest reports env=tdeck-meshcore, meshcore_enabled=1, budget_status=pass, firmware_bytes=1589264, static_ram_bytes=241364.
  • Flashed only COM8. esptool saw ESP32-S3 rev v0.2, MAC cc:8d:a2:0d:14:28, hashes verified.
  • Serial smoke passed MC0 USB protocol selftest and new MC0 BLE controls: companion mc ble on/status/test/off.
  • Host BLE smoke passed with scripts\mc_companion_ble_smoke.py --mc0-tx-smoke: connected to Limitlezz-MC0-*, asserted bridge=ble, read snapshots, sent Public, and observed MC0 EVT tx_status for mc0-ble-smoke-tx.
  • Restored device: MC0 BLE off, Meshtastic on, MeshCore on, Balanced split, RF SPLIT MT 50% / MC 50%.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant