This is an old revision of the document!


Meshtastic

CLI

apt install python3-full
mkdir -p ~/.venvs
python3 -m venv ~/.venvs/meshtastic
~/.venvs/meshtastic/bin/python -m pip install pytap2
~/.venvs/meshtastic/bin/python -m pip install meshtastic

Add ~/.venvs/meshtastic/bin to $PATH

meshtastic --port /dev/ttyACM2 --set lora.region EU_868
meshtastic --port /dev/ttyACM2 --noprot

Messages

This setup sends and receives messages on the CLI on a Pi Pico attached to /dev/ttyACM2

Receive

Install

git clone https://github.com/brad28b/meshtastic-cli-receive-text
cd meshtastic-cli-receive-text
~/.venvs/meshtastic/bin/python -m pip install -r requirements.txt

Prepend the following the each python script and edit the IP address and/or serial port in each script.

#! /bin/bash
"exec" "`dirname $0`/python" "$0" "$@"

Copy scripts into the venv.

chmod +x *.py
cp *.py ~/.venvs/meshtastic/bin

Listen

read_messages_serial.py
Using serial port: /dev/ttyACM2
Initializing SerialInterface to get node info...
Node info retrieved.
Parsing node info...
Node info parsed.
Node List:
{'num': '!0342a02e', 'user': {'shortName': 'Pico'}}
{'num': '!014fdb61', 'user': {'shortName': 'RPi'}}
Subscribed to meshtastic.receive
SerialInterface setup for listening.
RPi: Hello World!
Send

Direct message

meshtastic --port /dev/ttyACM2 --dest \!014fdb61 --sendtext "Hi!"

Channel message

meshtastic --port /dev/ttyACM2 --ch-index 1 --sendtext "Hello!"

Channel

meshtastic --port /dev/ttyACM2 --ch-set name "XXX" --ch-index 1
Connected to radio
Set name to HOME
Writing modified channels to device

meshtastic --port /dev/ttyACM2 --ch-set psk base64:xxx --ch-index 1 
Connected to radio
Writing modified channels to device

Info

These are some parameters which can be used to sniff the LoRa radio with RTL-SDR.

region=EU_868, name=LongFast

freqEnd: 869.4000.250000 MHz

numChannels: 1 x 250.000kHz

Radio frequency: 869.525024

Resources

This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies