Python notes
Using the python CLI (command line interface) allows you to directly interact with units via serial (usb) wifi (TCP) or bluetooth (BLE).
Most reliable is of course serial, and this is the best way to configure one or many devices, as you can use the python scripts to load many settings at once.
Below are some of the commands I use frequently:
Installing meshtastic on linux, mac or other terminal:
Install meshtastic CLI:
- sudo apt install pipx -y
- pipx install meshtastic
- pipx ensurepath
Serial connection: e.g. "meshtastic -s" or simply "meshtastic" at the command line:
- meshtastic --set lora.region US
- meshtastic --set lora.hop_limit 7
- meshtastic --set mqtt.enabled true
- meshtastic meshtastic --set security.admin_key base64:<your key here>
- meshtastic -s --set lora.config_ok_to_mqtt true
- meshtastic -s --set lora.config_ok_to_mqtt true
- meshtastic -s --set mqtt.map_reporting_enabled true
- meshtastic -s --set security.admin_channel_enabled TRUE
- meshtastic -s --export-config>rp2040a.yaml
- meshtastic --info
- meshtastic --seturl <url of your channel settings here>
These can also be used on a meshtasticd unit like a pi with a HAT:
Meshtasticd configuration: also works with RP2040 boards in serial mode (-s flag)
- meshtastic --host 127.0.0.1 --set lora.region US
- meshtastic --host 127.0.0.1 --set lora.hop_limit 7
- meshtastic --host 127.0.0.1 --set mqtt.enabled true
- meshtastic --host 127.0.0.1 --set security.admin_key base64:<your key here>
- meshtastic --host 127.0.0.1 --set device.role ROUTER
- meshtastic --host 127.0.0.1 --set store_forward.enabled true
- meshtastic --host 127.0.0.1 --set store_forward.history_return_max 1000
- meshtastic --host 127.0.0.1 --set store_forward.history_return_window 1000
- meshtastic --host 127.0.0.1 --set store_forward.is_server true
- meshtastic --host 127.0.0.1 --set store_forward.records 1000
- flash via USB-C
- set bluetooth to none
- set lora to us-7-ok MQTT
- clone channels with set-URL via meshtastic CLI
- MQTT enable map, JSON
Migrated from Apple Server Wiki. Original page ID: 62H6s3W9