====Meshtastic====
===Mestastic Linux===
Using the [[interfaces:wavesharehat|Wareshare Hat]] for RPi.
==Raspberry Pi Zero 2W / Pi 3B==
__Kernel configuration__
dtparam=spi=on
dtoverlay=spi0-0cs
enable_uart=1
__Kernel command line__
console=tty1 root=PARTUUID=xxxxxxxx-02 rootfstype=ext4 fsck.repair=yes rootwait cfg80211.ieee80211_regdom=GB
__Meshtastic__
Lora:
Module: sx1262 # Waveshare SX126X XXXM
DIO2_AS_RF_SWITCH: true
CS: 21
IRQ: 16
Busy: 20
Reset: 18
GPS:
SerialPath: /dev/ttyS0
Logging:
LogLevel: debug # debug, info, warn, error
Webserver:
Port: 443 # Port for Webserver & Webservices
RootPath: /usr/share/doc/meshtasticd/web # Root Dir of WebServer
__Runit__
systemctl stop meshtasticd
systemctl disable meshtasticd
systemctl mask meshtasticd
#! /bin/bash
sleep 1
#LOG
exec 2>&1
ulimit -aH
#RUN
mkdir -p /var/lib/meshtasticd
cd /var/lib/meshtasticd
exec /sbin/meshtasticd -d /var/lib/meshtasticd -c /etc/meshtasticd/config.yaml
===Command Line Interface===
==Setup==
sudo apt install python3-full
== Install==
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
==Update==
~/.venvs/meshtastic/bin/python -m pip install --upgrade meshtastic
===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
===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!"
===Info===
These are some parameters which can be used to sniff
the LoRa radio with [[:tools:rtlsdr|RTL-SDR]].
region=EU_868, name=LongFast
freqEnd: 869.4000.250000 MHz
numChannels: 1 x 250.000kHz
Radio frequency: 869.525024
===Resources===
[[https://meshtastic.org/|Meshtastic homepage]]
[[https://meshtastic.org/docs/software/linux-native/|Meshtastic Linux]]
[[https://meshtastic.org/docs/hardware/devices/raspberry-pi/|Meshtastic Raspberry Pi Pico]]
[[https://github.com/meshtastic/firmware/releases|Meshtastic releases]]
[[https://github.com/meshtastic/network-management-client|Meshtastic network manager]]
[[https://meshtastic.org/docs/configuration/tips/|Meshtastic Tips]]
[[https://www.youtube.com/watch?v=6UwWQSTCr_I|Meshtastic Linux setup]]