Meshtastic Bot is a Python-based bot for interacting with Meshtastic devices. It listens for messages, processes commands, and responds with appropriate actions. This guide is focused on helping you run the bot as-is, with minimal setup.
The easiest way to run Meshtastic Bot is using Docker. This method requires minimal setup and keeps your environment clean.
- Ensure you have Docker and Docker Compose installed.
- Create a
.envfile in your project directory with the required environment variables:
MESHTASTIC_NODE_IP=your_meshtastic_node_ip
ADMIN_NODES=comma_separated_admin_node_ids
STORAGE_API_ROOT=https://meshflow.pskillen.xyz
STORAGE_API_TOKEN=your_storage_api_token from above site
# Optionally, you can upload to a second API as well
STORAGE_API_2_ROOT=your_storage_api_2_url
STORAGE_API_2_TOKEN=your_storage_api_2_token
services:
bot:
image: ghcr.io/pskillen/meshtastic-bot:latest
container_name: meshtastic-bot
restart: unless-stopped
env_file:
- meshtastic-bot.env
volumes:
- mesh_bot_data:/app/data
volumes:
mesh_bot_data:docker compose up -dThe bot will now run in the background. Data will be persisted locally in the mesh_bot_data Docker volume.
If you prefer to run the bot natively (e.g., for development or customization):
- Clone the repository:
git clone https://github.com/yourusername/meshtastic-bot.git cd meshtastic-bot - Install dependencies:
pip install -r requirements.txt
- (Optional) On Raspberry Pi:
sudo apt-get install libopenblas-dev
- Configure environment:
- Copy
.env.exampleto.envand fill in the required values.
- Copy
- Run the bot:
python main.py
The bot listens for messages and responds to commands as a direct message. You can interact with it via supported Meshtastic channels.
| Command | Description |
|---|---|
!help |
Displays a list of available commands |
!hello |
Displays information about the bot |
!ping |
Responds with "Pong!" |
!nodes |
Displays a list of connected nodes, stats, etc |
!whoami |
Displays information about the sender |
!tr |
Responds with a hop count followed by the Traceroute |
If you want to add new commands or responders, see the src/commands/ and src/responders/ directories. The codebase is structured for easy extension, but most users will not need to modify the code to run the bot.
- Commands: Add new command classes and register them in the command factory.
- Responders: Inherit from
AbstractResponderto handle public channel messages.
Contributions are welcome! Please fork the repository and submit a pull request.
This project is licensed under the MIT License.