Skip to content

companion: meshcore-cli's msg, login, req_status and scope, with what the firmware answered - #753

Open
A13xB0 wants to merge 6 commits into
mainfrom
meshcli-direct
Open

A13xB0 wants to merge 6 commits into
mainfrom
meshcli-direct

Conversation

@A13xB0

@A13xB0 A13xB0 commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator

The companion command line listed meshcore-cli's msg, login, req_status and scope as commands it knew and did not answer, and nothing decoded RESP_CODE_SENT, PUSH_CODE_SEND_CONFIRMED or the login and status pushes. So a companion could flood a channel and do nothing else people do with one: no direct message, no login, no status request. On ScotMesh those are over half of what the mesh carries.

This adds the four commands in meshcore-cli's own words, to the same table console.cli and schedule.add read, so they are typed in the companion's CLI tab and scheduled in a fixture alike.

  • msg <contact> <text>, login <contact> <password>, req_status <contact>: the contact by the name the node holds it under, or by key in hex. A name the node has not listed is refused with "holds no contact"; a key is sent as given, and the firmware answers "not found" itself.
  • scope <name>, or scope * for unscoped.
  • Each request is answered twice in the transcript, matched to the request it answers: when the firmware takes it (sent msg to X by flood, waiting up to 7060 ms), and when the ack or reply comes back (delivered to X after 1240 ms: text, login ok from 49d7…, status from 49d7…, 60 bytes, or refused). The firmware answers in the order it took commands and does not say which command an answer belongs to, so the session keeps the requests in order.
  • Each line carries the simulated time it was written: the bridge records the time of the tick it last sent, and a frame the node writes during a tick arrives before that tick's ack.

Found while running a 241-node native ScotMesh scenario, where these were the traffic that could not be generated.

In the GUI: the companion window's CLI tab, which a new -companion-mode Client|CLI|TCP flag opens directly, so it can be captured. While a companion is held by its session, console.read now returns the transcript rather than the raw serial bytes.

Before: the commands were listed and did nothing After: a login, a status request and a direct message, each answered
before after

Tests: decoding of both receipt frames and the answers, the request layouts, receipts matched to the right request when two are in flight, a refusal attributed to the oldest request. Run live against companion-v1.17.1 and repeater-v1.17.1 native builds: login answered in 0.9 s, a 60-byte status reply.

Docs: MeshBench/docs#43

… the firmware answered

meshcore-cli's own commands for talking to one node, which the CLI table
already listed as known but not answered. Each is answered twice in the
transcript, matched to the request: when the firmware says it sent it,
and when the ack, login reply or status comes back, stamped in simulated
time. RESP_CODE_SENT, PUSH_CODE_SEND_CONFIRMED and the login and status
pushes are decoded for the first time.
The bridge records the time of each tick it sends, and a frame the
node writes while running that tick arrives before the tick's ack, so
that is when the frame was said. Read without the engine's lock, from
the goroutine reading the node's output.
The CLI, where meshcore-cli's answers land, could only be reached by a
click, so nothing could photograph or check it.
… serial bytes

Every tick replaced the console lines with the node's raw serial buffer,
which for a companion the session holds is binary frames; the CLI pane
showed noise with a contact's name in it and never the answers.

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.

2 participants