This section covers using the "meshtastic" command line executable, which displays packets sent over the network as JSON and lets you see serial debugging information from the Meshtastic devices.
The `meshtastic` command is not run within python but is a script run from your operating system shell prompt. When you type "meshtastic" and the prompt is unable to find the command in Windows, check that the python "scripts" directory [is in your path](https://datatofish.com/add-python-to-windows-path).
The `--noproto` command in the Meshtastic Python CLI is used to disable the API and function merely as a "dumb serial terminal." This mode of operation allows both the API and device functionalities to remain accessible for regular use, while simultaneously providing a window into the raw serial output. This feature can be particularly useful for debugging, development, or understanding the low-level communication between devices.
For a full list of preferences which can be set (and their documentation) can be found in the [protobufs](https://buf.build/meshtastic/protobufs/docs/main:meshtastic#meshtastic.User).
The channel settings can also be changed, either by using a standard (shareable) meshtastic URL or you can set a particular channel parameter (for advanced users).
Meshtastic encodes the radio channel and PSK in the channel's URL. All nodes must connect to the channel again by using the URL provided after a change in this section by performing the `--info` switch.
Use `--ch-set psk random --ch-index 0` to assign a new (high quality) random AES256 key to the primary channel (similar to what the Android app does when making new channels).
Use `--ch-set psk default --ch-index 0` to restore the standard 'default' (minimally secure, because it is in the source code for anyone to read) AES128 key.
All `ch-set` commands need to have the `ch-index` parameter specified:
Meshtastic is designed to be used without a radio operator license. If you do have a license you can set your operator ID and turn off encryption with:
Use "--ch-set psk random" will assign a new (high quality) random AES256 key to the primary channel (similar to what the Android app does when making new channels).
Use "--ch-set psk default" to restore the standard 'default' (minimally secure, because it is in the source code for anyone to read) AES128 key.
All "ch-set" commands will default to the primary channel at index 0, but can be applied to other channels with the "ch-index" parameter.
The Python CLI supports communicating with Meshtastic devices via Bluetooth Low Energy (BLE), in addition to the standard serial and TCP/IP connections. To use BLE, you will need a Bluetooth adapter on your computer.
### Scan for BLE Devices
First, you can scan for available Meshtastic devices using:
```shell
meshtastic --ble-scan
```
This will list all Meshtastic devices discoverable over BLE along with their addresses and names in the following format:
Once you have the device address or name, you can utilize it alongside your normal Python CLI commands like `--info`, `--nodes`, `--export-config`, etc. but with the `--ble` option to communicate via BLE rather than serial.
You can use **either** the name or address to issue your commands.
```shell
meshtastic --ble <name> --info
meshtastic --ble <address> --nodes
```
The initial time you use the `--ble` option for a specific device, you will be prompted to enter the BLE PIN code (as is normal with a client). Once paired, this step won't be required unless you forget the device.
:::note
On Linux, you may need to pair the BLE device using `bluetoothctl` before connecting. This allows entering the required PIN for pairing.
:::
### Additional BLE Examples
#### Scan for devices and get info from the first one: