A powerful and easy-to-use relay between Meshtastic devices and Matrix chat rooms, allowing seamless communication across platforms
 
 
Go to file
Jeremiah K add017bc06 Fix formatting issues when relaying msgs msh2msh 2023-04-18 20:49:37 -05:00
.gitignore Update .gitignore 2023-04-18 10:24:44 -05:00
README.md Adding custom keys to Matrix messages 2023-04-18 14:06:00 -05:00
main.py Fix formatting issues when relaying msgs msh2msh 2023-04-18 20:49:37 -05:00
requirements.txt initial commit 2023-04-17 19:50:28 -04:00
sample_config.yaml Adding custom keys to Matrix messages 2023-04-18 14:06:00 -05:00

README.md

Meshtastic <=> Matrix Relay

Simple relay between Meshtastic and a Matrix homeserver.

Installation

Clone the repo

git clone https://github.com/geoffwhittington/meshtastic-matrix-relay.git

Setup

In the directory create a Python virtualenv:

python3 -m venv .pyenv

Activate the virtualenv and install dependencies

source .pyenv/bin/activate
pip install -r requirements.txt

Configuration

Create a config.yaml in the directory with the appropriate values. A sample is provided below:

matrix:
  homeserver: "https://example.matrix.org"
  access_token: "reaalllllyloooooongsecretttttcodeeeeeeforrrrbot"
  bot_user_id: "@botuser:example.matrix.org"
  room_id: "!someroomid:example.matrix.org"

meshtastic:
  connection_type: serial  # Choose either "network" or "serial"
  serial_port: /dev/ttyUSB0  # Only used when connection is "serial"
  host: "meshtastic.local" # Only used when connection is "network"
  channel: 0
  meshnet_name: "Your Meshnet Name" # This is displayed in full on Matrix, but is truncated when sent to a Meshnet
  display_meshnet_name: true

logging:
  level: "debug"

Run

After activating the virtualenv:

source .pyenv/bin/activate

Run the following on the command-line:

python main.py

For example,

$ python main.py
INFO:meshtastic.matrix.relay:Starting Meshtastic <==> Matrix Relay...
INFO:meshtastic.matrix.relay:Connecting to radio at meshtastic.local ...
INFO:meshtastic.matrix.relay:Connected to radio at meshtastic.local.
INFO:meshtastic.matrix.relay:Listening for inbound radio messages ...
INFO:meshtastic.matrix.relay:Listening for inbound matrix messages ...