Giter VIP home page Giter VIP logo

mmrelaynode's Introduction

MMRELAYNODE

A Dockerized Relay for Meshtastic and Matrix featuring an Integrated Virtual Meshtastic Node communicating via MQTT

Introduction

This project utilizes a virtual node built using Meshtastic firmware. It emulates the capabilities of a physical device, facilitating direct communication with a conventional mesh network through the firmware's built-in MQTT functionality.

The relay operations are provided by the Meshtastic <=> Matrix Relay project.

Discover more about Meshtastic on their official site: https://meshtastic.org.

Installation & Setup

This project consists of two containers mmrealynode-app and mmrelaynode-device. Start by copying docker-compose-sample.yaml to docker-compose.yaml and tailor it to your needs.

For container setup:

git clone https://github.com/mate-dev/mmrelaynode.git
cd mmrelaynode && git submodule update --init
docker compose -f "docker-compose.yaml" up -d --build
docker compose restart

Important: Restart the containers after the initial launch. This reboot enables the virtual Meshtastic node to apply the changes from the MESHTATIC_COMMAND_X: commands after being executed by the script.

Additional Operational Commands

To view outputs from command_wrapper.py & MESHTASTIC_COMMAND_X commands:

docker exec -it mmrelaynode-app cat /home/mesh/app/command_output.txt

These commands are executed only upon the first launch of the container. To re-execute, remove the flag file and restart the container.

To remove the flag file:

docker exec -it mmrelaynode-app rm /home/mesh/app/.commands_executed

For script modifications and rebuilding containers from scratch, use:

docker compose down --volumes
docker compose build --no-cache
docker compose up -d --force-recreate 

Health Check

A Python script in the app container can sometimes hang due to a connection problem with the device container, halting its operation. Therefore, it's worth adding a health check that monitors the app container logs and restarts the container if an error is detected.

The simplest way to perform the check is to use cron, which will check the logs every minute. To do this, we go into edit mode with crontab -e and add the path to the healthcheck.sh file (remember to leave the last line empty).

user@server$ crontab -e

# m h  dom mon dow   command
* * * * * /bin/bash /path/to/file/mmrelaynode/healthcheck.sh

mmrelaynode's People

Contributors

mate71pl avatar jeremiah-k avatar

Stargazers

Dominik Antal avatar Michael sanderlin avatar  avatar John Hollowell avatar  avatar  avatar  avatar  avatar Cotteux avatar  avatar noah avatar  avatar

Watchers

 avatar noah avatar  avatar  avatar

mmrelaynode's Issues

Error after losing connection with node

2023-12-06 11:53:28 +0000 INFO:Matrix:Syncing with server...
2023-12-06 11:53:28 +0000 INFO:Meshtastic:Relaying message from stef4nek to radio broadcast
2023-12-06 11:53:28 +0000 ERROR:Matrix:Error syncing with server: Data payload too big
2023-12-06 11:54:34 +0000 INFO:Matrix:Syncing with server...
2023-12-06 11:54:34 +0000 INFO:Meshtastic:Relaying message from PanBoczek to radio broadcast
2023-12-06 11:54:34 +0000 ERROR:Matrix:Error syncing with server: Data payload too big
2023-12-06 11:55:37 +0000 INFO:Matrix:Syncing with server...
Exception in thread Thread-629:
Traceback (most recent call last):
File "/usr/local/lib/python3.11/threading.py", line 1045, in _bootstrap_inner
self.run()
File "/usr/local/lib/python3.11/threading.py", line 1401, in run
self.function(*self.args, **self.kwargs)
File "/home/mesh/.local/lib/python3.11/site-packages/meshtastic/mesh_interface.py", line 632, in callback
self._sendToRadio(p)
File "/home/mesh/.local/lib/python3.11/site-packages/meshtastic/mesh_interface.py", line 690, in _sendToRadio
self._sendToRadioImpl(toRadio)
File "/home/mesh/.local/lib/python3.11/site-packages/meshtastic/stream_interface.py", line 115, in _sendToRadioImpl
self._writeBytes(header + b)
File "/home/mesh/.local/lib/python3.11/site-packages/meshtastic/tcp_interface.py", line 72, in _writeBytes
self.socket.send(b)
BrokenPipeError: [Errno 32] Broken pipe

Build problem

Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v2, actions/setup-python@v2. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
The following actions uses node12 which is deprecated and will be forced to run on node16: actions/checkout@v2, actions/setup-python@v2. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.