Skip to content

Report the connected radio transport and endpoint - #998

Open
the8thbit wants to merge 1 commit into
meshtastic:masterfrom
the8thbit:fix/connection-transport-950
Open

the8thbit wants to merge 1 commit into
meshtastic:masterfrom
the8thbit:fix/connection-transport-950

Conversation

@the8thbit

@the8thbit the8thbit commented Oct 23, 2026 •

Copy link
Copy Markdown

The CLI now reports the transport and endpoint of the interface that actually connected: a serial device path, TCP hostname and port, or BLE address. This also identifies automatically discovered serial devices and TCP fallback connections. Configuration exports continue to omit connection status.

Fixes #950.

Validation: regression tests cover serial, TCP, BLE, a missing BLE client, an unknown interface, and configuration export. Default pytest: 492 passed; fast unit suite: 443 passed; pylint: 10.00/10. Mypy reports the same existing Listener/Callable type error in meshtastic/slog/slog.py:183 on both this branch and unchanged master (84 source files checked).

Transport scope: main() selects BLE, TCP, or serial and falls back to TCP on localhost when serial discovery finds no device. These are the CLI's radio connection paths. --dest selects a destination node for sent commands over that existing interface. Commands sent to a remote LoRa node therefore retain the connected serial/TCP/BLE status.

Summary by CodeRabbit

  • New Features
    • Connection status messages now include relevant details for supported connection types: the device path for serial connections, hostname and port for TCP connections, and client address for BLE connections when available. Other interface types continue to show the general connection message.

@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
📥 Commits

Reviewing files that changed from the base of the PR and between 0a18357 and eef0b5b.

📒 Files selected for processing: 2
  • meshtastic/__main__.py
  • meshtastic/tests/test_main.py

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

📝 Walkthrough

onConnected now reports serial device paths, TCP hostnames and ports, or available BLE client addresses. Tests cover these messages, the generic interface message, and suppression of connection status during --export-config.

Changes: Connection Status Output

Layer / File(s) Summary
Format and validate connection status
meshtastic/__main__.py, meshtastic/tests/test_main.py
onConnected includes interface-specific details when available and retains the base message for other interfaces. Tests cover serial, TCP, BLE, generic interfaces, and --export-config.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Feature

Merge Risk: ⚪ Minimal · up to eef0b

No actionable merge-blocking risk is established for the connection-status change. Normal validation remains appropriate before merging.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Linked Issues check Warning Issue #950 requires the connection status to identify the connection path, including USB/serial, TCP, BLE, and LoRa. onConnected now reports the serial device path, TCP hostname and port, and BLE ad… Implement the required LoRa path handling if the CLI supports a LoRa interface. Add a regression test for that interface and its expected status text. If LoRa is not a supported interface, provide reviewable code or issue evidence that defi…
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: reporting the connected radio transport and endpoint.
Out of Scope Changes check Passed The changes are limited to connection-status formatting in meshtastic/__main__.py and regression tests in meshtastic/tests/test_main.py. Serial, TCP, BLE, unknown-interface, missing-BLE-client, an…
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files.
Full details: Out of Scope Changes check

Explanation

The changes are limited to connection-status formatting in meshtastic/__main__.py and regression tests in meshtastic/tests/test_main.py. Serial, TCP, BLE, unknown-interface, missing-BLE-client, and configuration-export cases directly support Issue #950 or verify that existing export behavior remains unchanged.

Full details: Linked Issues check

Explanation

Issue #950 requires the connection status to identify the connection path, including USB/serial, TCP, BLE, and LoRa. onConnected now reports the serial device path, TCP hostname and port, and BLE address. The BLE branch also handles a missing client. The code leaves other interface types, including a possible LoRa interface, at Connected to radio without a path. The reported tests cover serial, TCP, BLE, unknown interfaces, and configuration export, but no LoRa status behavior.

Resolution

Implement the required LoRa path handling if the CLI supports a LoRa interface. Add a regression test for that interface and its expected status text. If LoRa is not a supported interface, provide reviewable code or issue evidence that defines the supported scope for #950.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

This branch has not been deployed

No deployments
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.

Enhancement requested: Change "Connected to radio" to "Connected to radio via ..."

1 participant