Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use? #1

Open
D4rk4 opened this issue Oct 28, 2022 · 1 comment
Open

How to use? #1

D4rk4 opened this issue Oct 28, 2022 · 1 comment

Comments

@D4rk4
Copy link

D4rk4 commented Oct 28, 2022

Hello, I have a T-ECHO device without wifi, may I bridge this device connected to a serial port with a regular MQTT meshtastic server with two-way communication with other nodes?
If yes, may you provide a config example for a device connected via /dev/ttyACM0?

@geoffwhittington
Copy link
Owner

geoffwhittington commented Dec 5, 2022

Thank-you for your question. You have inspired me to add a couple of sample configs under the directory use-cases. With the latest 0.6 you should be able to connect with the following config.

In this example, the bridge listens for all radio messages on radio1 connected on /dev/ttyACM0. When a packet is detected it publishes only TEXT_MESSAGE_APP messages to a certain MQTT topic meshtastic/radio-network1. Simultaneously, it listens for all messages posted to the same topic on the same MQTT server. It simply forwards the packet to all radios in the mesh. If the MQTT message contains a full packet with a proper to you could leave out the to: in the yaml.

There are ways of rewriting the messages using the bridge but this should illustrate what you're requesting. As this is a work-in-progress I expect some feedback and we can iterate over what works/doesn't work. Thanks for trying this experimental bridge.

To run: copy this to config.yaml and run python main.py.

devices:
  - name: radio1
    serial: "/dev/ttyACM0"
mqtt_servers:
  - name: external
    server: broker.hivemq.com
    port: 1883
    topic: meshtastic/radio-network1
    pipelines:
      mqtt-to-radio:
        - radio_message_plugin:
            device: radio1
            to: "^all"
pipelines:
  pipeline1:
    - debugger:
        log_level: debug
  radio-to-mqtt:
    - message_filter:
        app:
          allow:
            - "TEXT_MESSAGE_APP"
    - mqtt_plugin:
        name: external
        topic: meshtastic/radio-network1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants