Skip to content

Latest commit

 

History

History
104 lines (76 loc) · 2.82 KB

INSTRUCTIONS.md

File metadata and controls

104 lines (76 loc) · 2.82 KB

Instructions

The relay works on Linux, macOS, and Windows and requires Python 3.9+.

Installation

Clone the repository:

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

Setup

  1. Create a Python virtual environment in the project directory:

    python3 -m venv .pyenv
  2. Activate the virtual environment:

    • Linux/macOS:
      source .pyenv/bin/activate
    • Windows:
      .pyenv\Scripts\activate
  3. Install dependencies:

    pip install -r requirements.txt

Configuration

Create a config.yaml in the project directory based on the sample_config.yaml.

Usage

Run the relay with the virtual environment activated:

python main.py

Example output:

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 ...
INFO:meshtastic.matrix.relay:Processing matrix message from @bob:matrix.org: Hi Alice!
INFO:meshtastic.matrix.relay:Sending radio message from Bob to radio broadcast
INFO:meshtastic.matrix.relay:Processing inbound radio message from !613501e4 on channel 0
INFO:meshtastic.matrix.relay:Relaying Meshtastic message from Alice to Matrix: [Alice/VeryCoolMeshnet]: Hey Bob!
INFO:meshtastic.matrix.relay:Sent inbound radio message to matrix room: #someroomid:example.matrix.org

Persistence (Linux)

To run the relay automatically on startup:

  1. Copy the systemd service file:
    mkdir -p ~/.config/systemd/user
    cp tools/mmrelay.service ~/.config/systemd/user/
  2. Enable and start the service:
    systemctl --user enable mmrelay.service
    systemctl --user start mmrelay.service

Dockerized Versions (Unofficial)

If you would prefer to use a Dockerized version of the relay, there are unofficial third-party projects available. Please note that these are not officially supported, and issues should be reported to their respective repositories. For more details, visit the Third Party Projects page.

Development

Contributing

Contributions are welcome! We use Trunk for automated code quality checks and formatting. Please run Trunk checks before submitting pull requests.

Setting Up Trunk

  1. Install Trunk:

    curl -fsSL https://get.trunk.io | bash
  2. Initialize Trunk:

    trunk init
  3. Run checks and fix issues:

    trunk check --all --fix

For more details, see the Trunk documentation.