Skip to main content

mushtastic

mushtastic installs the mush command: a Meshtastic live packet logger with an interactive prompt. It connects to a radio over serial, TCP, or BLE; stores received and locally sent packets in SQLite; and provides tools to inspect nodes and packets, send messages, configure the radio, and manage channels.

Requirements

  • Python 3.10 or newer
  • A Meshtastic-capable radio reachable over USB/serial, TCP, or BLE

Install

pip install mushtastic

Run either entry point after installation:

mush --help
python -m mushtastic --help

Start a live session

mush live                         # auto-detect a serial radio
mush live --dev /dev/ttyUSB0
mush live --tcp 192.168.1.50:4403
mush live --ble AA:BB:CC:DD:EE:FF

Choose at most one of --dev, --tcp, and --ble. A TCP address without a port uses port 4403. Serial connections automatically try to reconnect after a radio restart.

Use Ctrl+D to leave the prompt. BLE shutdown is limited to five seconds, so mush may print a warning and exit if the underlying Bluetooth library stalls.

The prompt shows the radio's default hop limit, local node identity, and the current message target, for example:

🐰3 !deadbeef MUSH @ primary>

Global options

Place global options before the command:

Option Description
-v, --version Show the installed version.
-d, --debug Enable radio device log output.
--database PATH Use a specific SQLite database file.
--pos-fmt {latlon,google,osm} Select position display format.

Without --database, mush uses mush.db in the current directory.

Messaging in the prompt

Commands begin with /. Any other nonempty line sends a text message to the current target, which starts as the primary channel. Set the target with /target:

/target !deadbeef       # a node ID
/target NORTH           # a unique node short name, or a channel name
/target #1              # channel 1
Hello from the field!   # sent to the selected target

Channel names take precedence when a channel name and node short name match. !xxxxxxxx, ^local, and ^all identify nodes. #0 through #7 identify enabled channels.

Send one message to another target without changing the selection by prefixing it with @ENTITY:

@LongFast hello everyone
@!deadbeef are you there?
@#1 need assistance

Use a #N prefix to override the hop limit for one message, where N is 0 through 7. For a one-off target, it may appear before @ENTITY or immediately after it:

#3 hello there
@admin #2 need help
#2 @admin need help

Use /hops to view the default hop limit, or /hops N to change it. A literal message cannot begin with /.

Prompt commands

Type / then press Tab for completion, or use /COMMAND --help for full syntax.

Radio and configuration

Command Description
/help Show prompt command help.
/version Show the installed version, like mush --version.
/debug (/d) Toggle device log output.
/trace NODE [HOPS] (/t, /traceroute) Request a traceroute.
/position Show the connected node's current position.
/position precision list List each channel's position precision.
/position precision set CHANNEL PRECISION Set a channel's position precision.
/target ENTITY Select the destination for ordinary message lines.
/hops [N] Show or set the default hop limit, from 0 to 7.
/conf list List writable radio configuration options.
/conf get OPTION Show a configuration value and any staged value.
/conf set OPTION VALUE Validate and stage a change.
/conf apply Write staged changes to the radio.

Configuration option names accept snake_case and camelCase. Repeated values must be JSON arrays, such as [1, 2].

Nodes

/node (/n, /nodes) without a subcommand shows the local node's saved record.

Command Description
/node ls [COUNT] List up to 100 recently heard nodes by default.
/node show NAME Show a saved node's details.
/node rm ID Remove a node from the local database.
/node fav [NAME] List favorites, or toggle a node favorite on the radio and locally.
/node dls Print the radio's live NodeDB as JSON.
/node pull Copy the radio's live NodeDB to the local database.
/node count Count saved nodes.

Channels

/channel (/c, /chan) lists channels. Channel management is available only inside a live session.

Command Description
/channel add INDEX NAME [PSK] [--random-psk] Add or replace a channel.
/channel rm INDEX Delete a secondary channel.
/channel mv INDEX1 INDEX2 Swap two secondary channel slots.

Channel indexes are 0 through 7. Channel names are limited to 10 characters. The primary channel (0) cannot be deleted or moved. A supplied PSK can use the base64: prefix; --random-psk creates and displays a 32-byte key.

Packets and filters

/filter limits displayed live packets and /packet results. /filter-out hides matching packets. Neither prevents packets from being saved.

/filter from NORTH SOUTH
/filter channel LongFast
/filter portnum POSITION_APP
/filter-out portnum TELEMETRY_APP
/filter clear

Each filter provides clear, from [NODE ...], to [NODE ...], channel [CHANNEL ...], and portnum [PORTNUM ...]. Values within one field are alternatives; active inclusion fields are combined. An exclusion applies only when all of its configured fields match.

/packet (/p, /pkt, /packets) operates on the active filtered set:

Command Description
/packet ls [COUNT] List the latest 100 matching packets by default.
/packet show [ID] [--raw] Show packet details or raw JSON.
/packet process Reprocess matching packets.
/packet reprocess Reprocess every stored packet, ignoring filters.
/packet import [--merge=append|overwrite|skip] Read one JSON packet from standard input.
/packet portnums Count stored packets by port number.
/packet count Count matching packets.

One-shot shell commands

These commands query the local database without connecting to a radio:

mush ble-scan
mush node ls [COUNT]
mush node show NAME
mush node rm ID
mush node count
mush packet [FILTERS] list [COUNT]
mush packet [FILTERS] show [ID] [--raw]
mush packet [FILTERS] process
mush packet [FILTERS] import [--merge=append|overwrite|skip]
mush packet [FILTERS] portnums
mush packet [FILTERS] count

mush packet supports --id, --msg-id, --limit, --portnum, --from-id, --to-id, --id-start, --id-end, --rx-time-start, and --rx-time-end. For example:

mush packet --portnum POSITION_APP list 20

Use mush COMMAND --help for command-specific options and aliases.

Data and privacy

The SQLite database contains the node, packet, and replhistory tables. It can contain node identities, messages, telemetry, and locations. Treat it as sensitive data. To back it up or move it, copy the database while mush is not running.

Metadata

Release files for mushtastic 0.2.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mushtastic 0.2.4
File Size Uploaded Provenance
mushtastic-0.2.4.tar.gz 88.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for mushtastic 0.2.4
File Interpreter ABI Platform
mushtastic-0.2.4-py3-none-any.whl Python 3 none any Details

Total release size: 160.8 kB

Release files / mushtastic-0.2.4.tar.gz

Download URL mushtastic-0.2.4.tar.gz
Size 88.9 kB
Tags Source
SHA-256 checksum
How to use checksums
fe45a033eb4a3af53d127337caa1b64dab0d073c6f55dcbae8aa2a02d4c9fafc
BLAKE2b-256 checksum
How to use checksums
23400df07202a7f561e60de5b6261cae965022fdfcc130a3b344159b61d8bb0a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Release files / mushtastic-0.2.4-py3-none-any.whl

Download URL mushtastic-0.2.4-py3-none-any.whl
Size 71.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
297a40eb4a460a7e1511c3e960c29e6cbb2b27e9031f107f4d059fed1983dfc4
BLAKE2b-256 checksum
How to use checksums
5bda61d08194873da917c0c736e7fb97e375d73dc40cc663cd4116f3ce21990c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Security for mushtastic 0.2.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page