This repository contains shell scripts designed to administer Meshtastic nodes operating as a gateway in conjunction with a Raspberry Pi (or Orange Pi). The scripts primarily focus on retrieving and dumping configurations from Meshtastic nodes via either Wi-Fi (TCP/IP) or USB-serial connections.
dump_meshtastic_config.sh
: A bash script to fetch all configuration settings from a Meshtastic node via Wi-Fi (TCP/IP) and save them to a timestamped text file.dump_USB_meshtastic_config.sh
: A bash script to fetch all configuration settings from a Meshtastic node via USB-serial connection and save them to a timestamped text file.
To use these scripts, you will need a Raspberry Pi (or similar SBC) configured with:
- Raspberry Pi OS (or another Debian-based Linux distribution).
- Git to clone this repository.
- Python 3 with
venv
installed. - A Python virtual environment for the Meshtastic CLI tools.
- Meshtastic CLI installed within the virtual environment (version 2.6.x is confirmed compatible with these scripts).
- Udev rules set up to allow your user to access USB-serial ports without
sudo
. - A Meshtastic node (e.g., T-Beam, T1000-E) connected via USB or accessible via Wi-Fi on your network.
Follow these steps to set up and run the scripts on your Raspberry Pi:
Navigate to your home directory or desired location and clone the repository:
cd ~
git clone https://github.com/IBICO74/Meshtastic-python-script.git
cd Meshtastic-python-script
It is highly recommended to use a virtual environment for Python projects.
python3 -m venv ~/meshtastic_venv
source ~/meshtastic_venv/bin/activate
pip install meshtastic pyserial --upgrade # pyserial is still needed for meshtastic CLI
deactivate # Deactivate venv when done with installation
Before running the scripts, you must edit them to point to the correct node (IP for Wi-Fi, port for USB).
-
For Wi-Fi-connected node (
dump_meshtastic_config.sh
): Open the script:nano dump_meshtastic_config.sh
Change the lineNODE_IP="172.19.228.23"
to the IP address of your Wi-Fi-connected Meshtastic node. -
For USB-connected node (
dump_USB_meshtastic_config.sh
): Open the script:nano dump_USB_meshtastic_config.sh
Change the lineNODE_PORT="/dev/ttyACM0"
to the correct serial port your USB node is connected to (e.g.,/dev/ttyACM1
).
chmod +x dump_meshtastic_config.sh
chmod +x dump_USB_meshtastic_config.sh
Before running, always activate your virtual environment:
source ~/meshtastic_venv/bin/activate
Then, run the desired script:
./dump_meshtastic_config.sh
# Or
./dump_USB_meshtastic_config.sh
The scripts will print status to the terminal and save a complete configuration dump to a timestamped text file (e.g., meshtastic_config_backup_YYYYMMDD_HHMMSS.txt
) in your home directory.
If you have improvements, bug fixes, or new scripts you'd like to share, feel free to submit pull requests to this repository.
This project is licensed under the GPL-3.0-only License.