Inject Frame
inject_frameInjects forged LoRa packets into a connected Meshtastic board to exercise its real receive, decryption, and admin paths for testing; requires explicit confirmation.
Instructions
Inject a packet into a connected board as if it arrived off the LoRa radio.
Destructive: it forges over-the-air traffic, admin included. Requires confirm=True,
or the user's answer when the client can ask. The target must run firmware built with
-D MESHTASTIC_ENABLE_FRAME_INJECTION=1 (portduino sim nodes always accept it); the
frame takes the real receive path, decryption and admin checks included. Wire format
and an example: AGENTS.md, Frame injection.
Returns {ok, target, channel, channel_hash, injected, frames: [{from, to, id, portnum, bytes, ...}]}.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "inject_frame"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | The destination node; defaults to the target. | |
| pki | No | Send the `admin` frame as PKI-encrypted, for the PKC-admin path; needs `public_key_b64` and `encrypt=false`. | |
| body | No | The message text, for `text`. | |
| mode | No | `text` (`body`), `raw` (`payload_hex` on `portnum`), `admin` (set_owner with `long_name`/`short_name`, optional `session_hex`; add `pki=true` and `public_key_b64` for the PKC-admin path), `ciphertext` (`ciphertext_hex` verbatim) or `fuzz` (`fuzz_count` malformed frames). | text |
| port | No | Serial port or `tcp://host[:port]`; omit to auto-select the one likely Meshtastic device. | |
| confirm | No | `True` once the user agreed; omitted, a client that can ask prompts the human. | |
| encrypt | No | Encrypt with `channel_index`'s key (default true); pass false to inject decoded, which `pki` needs. | |
| portnum | No | The port number the `raw` payload goes on. | |
| from_node | No | The forged sender; 0 is dropped, as on air. | 0xdeadbeef |
| fuzz_seed | No | The RNG seed for `fuzz`, so a run repeats. | |
| long_name | No | The owner long name an `admin` frame sets. | INJECTED |
| packet_id | No | The packet id to forge; omit for a random one. | |
| fuzz_count | No | How many malformed frames `fuzz` sends. | |
| short_name | No | The owner short name an `admin` frame sets. | INJ |
| payload_hex | No | The decoded payload as hex, for `raw`. | |
| session_hex | No | The admin session passkey as hex, for `admin`; empty sends none. | |
| channel_index | No | The channel whose key `encrypt` uses. | |
| want_response | No | Set the packet's want_response flag. | |
| ciphertext_hex | No | Encrypted bytes as hex, injected verbatim, for `ciphertext`. | |
| public_key_b64 | No | The sender's public key, base64, for `pki`. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||