Meshtastic Python CLI Guide
The python pip package installs a "meshtastic" command line executable, which displays packets sent over the network as JSON and lets you see serial debugging information from the meshtastic devices. This command is not run inside of python, you run it from your operating system shell prompt directly. If when you type "meshtastic" it doesn't find the command and you are using Windows: Check that the python "scripts" directory is in your path.
Connection Arguments
--port PORT
The port the Meshtastic device is connected to, i.e. /dev/ttyUSB0
, /dev/cu.wchusbserial
, COM4
etc. if unspecified, meshtastic will try to find it. Important to use when multiple devices are connected to ensure you call the command for the correct device.
This argument can also be specified as --serial
or -s
.
meshtastic --port /dev/ttyUSB0 --info
meshtastic --port COM4 --info
meshtastic -s --info
--host HOST
The hostname/ipaddr of the device to connect to (over TCP). If a host is not provided, the CLI will try to connect to localhost
.
This argument can also be specified as --tcp
or -t
.
meshtastic --host meshtastic.local --info
meshtastic --host --info
--ble BLE
Connect to a Meshtastic device using its BLE address or name. This option allows for wireless communication with the device, similar to how the --host
option is used for TCP connections. If an address is not provided, meshtastic will try to find a compatible device that's paired.
This argument can also be specified as -b
.
meshtastic --ble "device_name_or_address" --info
meshtastic -b --info