Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gretel/meshgram
This project implements a bridge between a Meshtastic node and a Telegram group chat, allowing for the exchange of messages and locations between the two platforms.
https://github.com/gretel/meshgram
asyncio meshtastic python telegram telegram-bot
Last synced: 3 days ago
JSON representation
This project implements a bridge between a Meshtastic node and a Telegram group chat, allowing for the exchange of messages and locations between the two platforms.
- Host: GitHub
- URL: https://github.com/gretel/meshgram
- Owner: gretel
- Created: 2024-07-01T16:06:43.000Z (6 months ago)
- Default Branch: dev
- Last Pushed: 2024-07-11T21:46:22.000Z (6 months ago)
- Last Synced: 2024-07-12T00:22:34.368Z (6 months ago)
- Topics: asyncio, meshtastic, python, telegram, telegram-bot
- Language: Python
- Homepage:
- Size: 33.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# π Meshgram: Bridging Meshtastic and Telegram π
Connect your Meshtastic mesh network with Telegram group chats! π‘π¬
## π Features
- π Supports both serial and TCP connections to Meshtastic devices
- π Automatic reconnection to Meshtastic device
- π¦ Message queuing and retry mechanism
- π Command to send bell notifications to Meshtastic nodes
- π Real-time status updates for nodes (telemetry, position, routing, neighbors)
- πΊοΈ Location sharing between Telegram and Meshtastic
- π User authorization for Telegram commands
- π Optional logging to file and syslog## π Requirements
- Python 3.12+ π
- Dependencies:
- `envyaml`: For YAML configuration file parsing with environment variable support
- `meshtastic`: Python API for Meshtastic devices
- `python-telegram-bot`: Telegram Bot API wrapper
- `pubsub`: For publish-subscribe messaging pattern## π Quick Start
1. **Clone the repo:**
```bash
git clone https://github.com/gretel/meshgram.git
cd meshgram
```2. **Set up a virtual environment:**
```bash
python3 -m venv venv
source venv/bin/activate
```3. **Install dependencies:**
```bash
pip install -r requirements.txt
```4. **Configure the project:**
Create a `config.yaml` file in the `config` directory:
```yaml
telegram:
bot_token: "your_bot_token_here"
chat_id: -1001234567890
authorized_users:
- 123456789meshtastic:
connection_type: "serial" # or "tcp"
device: "/dev/ttyUSB0" # or "hostname:port" for TCP
default_node_id: "!abcdef12"
local_nodes:
- "!abcdef12"
- "!12345678"logging:
level: "info"
level_telegram: "warn"
level_httpx: "warn"
use_syslog: false
syslog_host: "localhost"
syslog_port: 514
syslog_protocol: "udp"
```5. **Run Meshgram:**
```bash
python src/meshgram.py
```## π‘ Telegram Commands
- `/start` - Start the bot and see available commands
- `/help` - Show help message
- `/status` - Check the current status of Meshgram and Meshtastic
- `/bell [node_id]` - Send a bell notification to a Meshtastic node
- `/node [node_id]` - Get information about a specific node
- `/user` - Get information about your Telegram user## π€ Contributing
We welcome contributions! π Please open an issue or submit a pull request if you have any improvements or bug fixes.
Happy meshing! π