Tuto-Meshgram
Instal et config de Meshgram to Bridge Meshtastic and Telegram on Rpi4
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.
Projets alternatifs : https://github.com/search?q=meshtastic%20telegram&type=repositories
Résumé de l'installation avec prise en compte des 2 commentaires reçus par Email de Fabrice F4GXP
- Créer un BOT sur télégram https://t.me/BotFather (lien a activer sur son smartphone)
- Sur le Raspberry, suivre le process d’install décrit sur GitHub - gretel/meshgram https://github.com/gretel/meshgram
- Modifier le fichier de config comme indiqué, en tenant compte des 2 commentaires importants entre parentheses de Fabrice)
1. Clone the repo:
$ git clone https://github.com/gretel/meshgram.git $ cd meshgram
2. Set up a virtual environment:
$ python3 -m venv venv $ source venv/bin/activate
3. Install dependencies:
$ pip install -r requirements.txt
4. Configure the project: Create a config.yaml file in the config directory:
telegram:
bot_token: "your_bot_token_here"
chat_id: -1001234567890
authorized_users:
- 123456789 (# Regarder dans les logs du raspberry qui se connecte au bot, il faut alors ajouter son id ici !)
meshtastic:
connection_type: "serial" # or "tcp"
device: "/dev/ttyUSB0" # or "hostname:port" for TCP
default_node_id: "!abcdef12" (#Ici il faut mettre “^all” si l'on souhaite que les messages telegram partent vers tous les nodes non pas à un seul)
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:
$ 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
RESTRICTED ANNEXES
FAQ/common problems : This is a collection of common questions and answers from our friendly forum.
Error message :
Permission denied: ‘/dev/ttyUSB0’
This indicates an OS permission problem for access by your user to the USB serial port. Typically this is fixed by the following. Some Linux commands to overcome this issue.
- Method 1: Add your user to the group dialout
$ sudo usermod -a -G dialout $USER
or
$ sudo usermod -a -G dialout <username>
- Method 2: Another try would be to take ownership of this interface
$ sudo su $ cd /dev $ chown <username> ttyUSB0 $ exit
- Method 3: Last you can also start your telegram bot as root (Mauvaise méthode à éviter !)
$ sudo python3 meshmeharderbot.py
Cable Encore beaucoup de cable USB sont des mauvais cables DATA, a vérifier car parfois ils ont des disfonctionnement enc ours d’utilisation (faux contacts quand le raspberry bouge et les routines de refresh du bot telegram plantent,…)
Batterie : Efest avec 40Ah
