Skip to content

RemoteShell SSH-like experience over PKI#10123

Open
jp-bennett wants to merge 28 commits intodevelopfrom
vibe-coded-dmshell
Open

RemoteShell SSH-like experience over PKI#10123
jp-bennett wants to merge 28 commits intodevelopfrom
vibe-coded-dmshell

Conversation

@jp-bennett
Copy link
Copy Markdown
Collaborator

Still WIP, but actually working, and ready for some general sanity checks from others. does not work super well with a ch341 device, but you can use any Meshtastic device as the local node, and connect using the client script over USB, to connect to a remote Linux node.

LLM was heavily used to generate this. I feel like I kept it reigned on reasonable well in the c++ code (though I'm sure I'll make changes there before I'll completely happy). I'm much less certain about the Python code. Ideally this function can land in the Meshtastic python CLI, but for now, the standalone client is super useful for testing.

@github-actions github-actions bot added the needs-review Needs human review label Apr 10, 2026
@github-actions github-actions bot added the hardware-support Hardware related: new devices or modules, problems specific to hardware label Apr 10, 2026
@jp-bennett jp-bennett added enhancement New feature or request and removed hardware-support Hardware related: new devices or modules, problems specific to hardware needs-review Needs human review labels Apr 10, 2026
@SpudGunMan
Copy link
Copy Markdown

Can there be a 2fa in some snazzy way

@thebentern thebentern requested a review from Copilot April 10, 2026 12:21
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a new “DMShell” transport/protocol for Portduino to support remote PTY shell sessions over Meshtastic, plus a standalone Python client for exercising the feature via TCP API or USB serial.

Changes:

  • Introduces new DMShell protobuf message/opcodes and port number, and binds generated nanopb descriptors.
  • Adds a Portduino-only DMShellModule implementing a PTY-backed session with basic sequencing/ACK/replay.
  • Adds serializer/unit tests for DMShell protobuf frames and a standalone bin/dmshell_client.py client.

Reviewed changes

Copilot reviewed 6 out of 10 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
test/test_meshpacket_serializer/test_serializer.cpp Registers new DMShell serializer tests with Unity.
test/test_meshpacket_serializer/ports/test_dmshell.cpp Adds roundtrip serialization tests for DMShell frames.
src/modules/Modules.cpp Instantiates DMShellModule on Portduino builds.
src/modules/DMShell.h Declares DMShell session/frame state and module interface (Portduino-only).
src/modules/DMShell.cpp Implements PTY session handling, sequencing/ACK/replay, and authorization checks.
src/mesh/generated/meshtastic/portnums.pb.h Adds DM_SHELL_APP port number (comment currently incorrect).
src/mesh/generated/meshtastic/mesh.pb.h Adds generated DMShell message and opcode enum definitions.
src/mesh/generated/meshtastic/mesh.pb.cpp Binds nanopb descriptor for meshtastic_DMShell.
src/mesh/RadioLibInterface.h Adds packetsInTxQueue() helper used for throttling DMShell output.
bin/dmshell_client.py New standalone client (TCP API + serial) with session/replay/heartbeat logic.

Comment thread test/test_meshpacket_serializer/ports/test_dmshell.cpp Outdated
Comment thread test/test_meshpacket_serializer/ports/test_dmshell.cpp Outdated
Comment thread src/modules/DMShell.cpp Outdated
Comment thread src/modules/DMShell.cpp Outdated
Comment thread src/modules/DMShell.cpp Outdated
Comment thread src/modules/DMShell.cpp Outdated
Comment thread src/modules/DMShell.cpp
Comment thread src/modules/DMShell.cpp Outdated
Comment thread src/modules/DMShell.cpp Outdated
Comment thread src/modules/DMShell.cpp Outdated
@jp-bennett
Copy link
Copy Markdown
Collaborator Author

Can there be a 2fa in some snazzy way

We might be able to go to a system login instead of a shell. Then the Meshtastic node is the 2fa, and you're prompted for password.

@jp-bennett
Copy link
Copy Markdown
Collaborator Author

@thebentern decent cleanup punchlist from copilot. I have a few other todo items to knock out before it's ready to merge.

@jp-bennett jp-bennett changed the title dmshell client serial support and tweaks RemoteShell SSH-like experience over PKI Apr 14, 2026
jamesarich added a commit to meshtastic/Meshtastic-Android that referenced this pull request Apr 15, 2026
Align with firmware refactor (meshtastic/firmware#10123) and protobufs
PR meshtastic/protobufs#894 which adds last_tx_seq and last_rx_seq
fields to the RemoteShell message.

- ACK: use last_rx_seq proto field instead of encoding replay-from
  seq into payload bytes
- PING: use last_tx_seq/last_rx_seq proto fields instead of encoding
  heartbeat status as 8-byte payload
- PONG: read last_tx_seq/last_rx_seq from proto fields instead of
  decoding payload
- SentFrame: store flags/lastTxSeq/lastRxSeq for faithful replay
- Remove unused encodeUint32BE, encodeHeartbeatStatus,
  decodeHeartbeatStatus helpers and associated constants

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
jamesarich added a commit to meshtastic/Meshtastic-Android that referenced this pull request Apr 15, 2026
Align with firmware refactor (meshtastic/firmware#10123) and protobufs
PR meshtastic/protobufs#894 which adds last_tx_seq and last_rx_seq
fields to the RemoteShell message.

- ACK: use last_rx_seq proto field instead of encoding replay-from
  seq into payload bytes
- PING: use last_tx_seq/last_rx_seq proto fields instead of encoding
  heartbeat status as 8-byte payload
- PONG: read last_tx_seq/last_rx_seq from proto fields instead of
  decoding payload
- SentFrame: store flags/lastTxSeq/lastRxSeq for faithful replay
- Remove unused encodeUint32BE, encodeHeartbeatStatus,
  decodeHeartbeatStatus helpers and associated constants

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
jamesarich added a commit to meshtastic/Meshtastic-Android that referenced this pull request Apr 15, 2026
Align with firmware refactor (meshtastic/firmware#10123) and protobufs
PR meshtastic/protobufs#894 which adds last_tx_seq and last_rx_seq
fields to the RemoteShell message.

- ACK: use last_rx_seq proto field instead of encoding replay-from
  seq into payload bytes
- PING: use last_tx_seq/last_rx_seq proto fields instead of encoding
  heartbeat status as 8-byte payload
- PONG: read last_tx_seq/last_rx_seq from proto fields instead of
  decoding payload
- SentFrame: store flags/lastTxSeq/lastRxSeq for faithful replay
- Remove unused encodeUint32BE, encodeHeartbeatStatus,
  decodeHeartbeatStatus helpers and associated constants

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants