{"id":39405853,"url":"https://github.com/tago-io/mqtt-relay","last_synced_at":"2026-02-05T21:04:21.182Z","repository":{"id":245005045,"uuid":"805183558","full_name":"tago-io/mqtt-relay","owner":"tago-io","description":"TagoIO | MQTT Relay","archived":false,"fork":false,"pushed_at":"2025-12-17T17:07:24.000Z","size":218,"stargazers_count":4,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-12-21T05:36:34.232Z","etag":null,"topics":["iot","mqtt","tagoio"],"latest_commit_sha":null,"homepage":"https://help.tago.io/portal/en/kb/articles/tagoio-mqtt-relay","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tago-io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-05-24T03:48:58.000Z","updated_at":"2025-12-17T17:00:47.000Z","dependencies_parsed_at":"2025-03-06T17:39:45.212Z","dependency_job_id":null,"html_url":"https://github.com/tago-io/mqtt-relay","commit_stats":null,"previous_names":["tago-io/mqtt-relay"],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/tago-io/mqtt-relay","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tago-io%2Fmqtt-relay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tago-io%2Fmqtt-relay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tago-io%2Fmqtt-relay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tago-io%2Fmqtt-relay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tago-io","download_url":"https://codeload.github.com/tago-io/mqtt-relay/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tago-io%2Fmqtt-relay/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28528106,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T00:39:45.795Z","status":"online","status_checked_at":"2026-01-18T02:00:07.578Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["iot","mqtt","tagoio"],"created_at":"2026-01-18T03:30:26.768Z","updated_at":"2026-01-18T03:30:27.292Z","avatar_url":"https://github.com/tago-io.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cbr/\u003e\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://assets.tago.io/tagoio/tagoio.png\" width=\"250px\" alt=\"TagoIO\"\u003e\u003c/img\u003e\n\u003c/p\u003e\n\n# TagoIO | MQTT Relay\n\nThis software bridges your MQTT Broker and the TagoIO platform, allowing seamless integration and data flow. It's a fast, open-source, and scalable solution written in Rust.\n\n## Table of Contents\n\n- [Introduction](#introduction)\n- [Features](#features)\n- [Getting Started](#getting-started)\n  - [Prerequisites](#prerequisites)\n  - [Installation](#installation)\n  - [Configuration](#configuration)\n  - [Running the Relay](#running-the-relay)\n- [Docker Setup](#docker-setup)\n  - [Image Variants](#image-variants)\n- [CLI Commands](#cli-commands)\n  - [`init`](#init)\n  - [`start`](#start)\n- [Configuration File and Environment Variables](#configuration-file-and-environment-variables)\n- [License](#license)\n\n## Introduction\n\nThe TagoIO MQTT Relay connects to your MQTT Broker on predefined topics and redirects the information to TagoIO Devices. It uses TagoIO Integration Network and Connector, alongside an [Authorization Key](https://admin.tago.io/devices/authorization) from your TagoIO Profile.\n\n## Features\n\n- **Written in Rust**: Fast and reliable performance.\n- **Open Source**: Available on GitHub for community contributions.\n- **Scalable**: Easily handles increasing data loads.\n- **Docker Support**: Simplifies deployment and scaling.\n\n## Getting Started\n\n### Prerequisites\n\nBefore you begin, ensure you have:\n\n- A TagoIO account.\n- Access to an MQTT Broker (e.g., HiveMQ, EMQX).\n\n### Installation\n\n1. **Download the Binary**: Get the `tagoio-relay` binary from the [GitHub releases page](https://github.com/tago-io/mqtt-relay/releases/latest).\n2. **Set Permission Rights**: Give the binary executable permissions:\n   ```sh\n   chmod +x tagoio-relay\n   ```\n3. **Resolve Malicious Software Alert (macOS)**: Follow [Apple Support](https://support.apple.com) instructions if you encounter a malicious software alert.\n4. **Verify Installation**: Check if the `tagoio-relay` is working properly:\n   ```sh\n   ./tagoio-relay --help\n   ```\n\n### Configuration\n\n1. **Create a Network in TagoIO**:\n   - Navigate to [Integrations](https://admin.tago.io/integrations/network) in your TagoIO [Profile](https://help.tago.io/portal/en/kb/articles/198-profiles) and create a new Network.\n   - Enter the [Middleware Endpoint](#middleware-endpoint-optional) for your Relay (Optional, allows publishing from TagoIO to the Relay).\n   - Enable Serial and write a Payload Parser:\n     ```js\n     // The Payload Parser runs every time a message is received from the Broker\n     if (Array.isArray(payload)) {\n        // Relay sends the \"payload\" variable by default\n       const payload_received = payload.find(x =\u003e x.variable === \"payload\");\n       // Extract the serial from the last element of the topic (e.g., /device/SERIAL)\n       serial = payload_received?.metadata.topic.split(\"/\").pop();\n     }\n     ```\n\n2. **Generate Network Token**: Generate and save the Network Token.\n3. **Create a Connector**: Create a Connector for your Network.\n4. **Generate Authorization**: Navigate to [Devices \u003e Authorizations](https://admin.tago.io/devices/authorization) in TagoIO and generate an authorization token.\n5. **Create a Device**: Create a Device with a Serial to use later on the Broker.\n6. **Set Up an MQTT Broker**: Create or use a public MQTT Broker.\n7. **Gather Broker Details**: Obtain the Address, Port, and Credentials of your MQTT Broker.\n\n### Running the Relay\n\n1. **Initialize Config File**:\n   ```sh\n   ./tagoio-relay init\n   ```\n2. **Edit Config File**: Modify the generated `.tagoio-mqtt-relay.toml` as described in the [Configuration File and Environment Variables](#configuration-file-and-environment-variables).\n\n3. **Start the Relay**:\n   ```sh\n   ./tagoio-relay start\n   ```\n4. **Publish Messages to Broker**: Publish messages to the Broker on your chosen topics and see them forwarded to your TagoIO device.\n\n## Docker Setup\n\nTo run the TagoIO MQTT Relay using Docker, use the following command:\n\n```sh\ndocker run -p 3001:3001 -it --rm --name my-test tagoio/relay start --no-daemon\n```\n\nSpecific docker documentation can be found on the [Docker Hub page](https://hub.docker.com/r/tagoio/relay).\n\n### Image Variants\n\n- **tagoio/relay:latest**: Main image for general use.\n- **tagoio/relay:\u003cversion\u003e**: Specific version of the image.\n- **tagoio/relay:bookworm**: Based on Debian Bookworm.\n- **tagoio/relay:alpine**: Based on Alpine Linux.\n- **tagoio/relay:\u003cversion\u003e-\u003cdistribution\u003e**: Specific version of the image for a specific distribution.\n\n## CLI Commands\n\nThe CLI has two main commands: `init` and `start`.\n\n### `init`\n\nGenerates the `.tagoio-mqtt-relay.toml` file required for setting up the Relay.\n\n```sh\ntagoio-relay init [--config-path /path/to/config]\n```\n\n### `start`\n\nStarts the MQTT Relay service.\n\n```sh\ntagoio-relay start [--verbose info,error,mqtt,network] [--config-path /path/to/.tagoio-mqtt-relay.toml]\n```\n\n## Configuration File and Environment Variables\n\nTo configure the TagoIO MQTT Relay, you can either use environment variables or edit the `.tagoio-mqtt-relay.toml` file directly. Below are the available configuration parameters:\n\n### `.tagoio-mqtt-relay.toml`\n\nThe `.tagoio-mqtt-relay.toml` file generated by the `init` command contains the Relay parameters. By default the file is located at `~/.config/.tagoio-mqtt-relay.toml` (Mac/Linux) or `/root/.config/.tagoio-mqtt-relay.toml` (Linux/Docker).\n\nHere is a reference:\n```toml\n[relay]\nnetwork_token=\"Your-Network-Token\"\nauthorization_token=\"Your-Authorization-Token\"\n\n# TagoIO API URL - Use the appropriate endpoint:\n# United States East 1: https://api.us-e1.tago.io/\n# Europe West 1: https://api.eu-w1.tago.io/\n# Default (US): https://api.tago.io\n# TagoIO Deploy (dedicated single-tenant instance): e.g -\u003e https://api.xxxxx.tagoio.net\ntagoio_url=\"https://api.tago.io\"\n\n# The Relay will listen on this port for incoming messages from TagoIO\ndownlink_port=\"3001\"\n\n[relay.mqtt]\nclient_id=\"tagoio-relay\"\ntls_enabled=false\naddress=\"localhost\"\nport=1883\nsubscribe=[\"/tago/#\", \"/topic/+\"]\nusername=\"my-username\"\npassword=\"my-password\"\n\n# TLS Certificates for the MQTT Broker (optional)\n# broker_tls_ca=\"\"\n# broker_tls_cert=\"\"\n# broker_tls_key=\"\"\n```\n### Environment Variables\nThe environment variables can be set directly in the shell, and they will override the values provided in the `.tagoio-mqtt-relay.toml` file. Use it as alternative in case you don't want to use or edit the configuration file.\n\n```sh\nexport TAGOIO__RELAY__NETWORK_TOKEN=\"Your-Network-Token\"\nexport TAGOIO__RELAY__AUTHORIZATION_TOKEN=\"Your-Authorization-Token\"\n\n# TagoIO API URL - Use the appropriate endpoint:\n# United States East 1: https://api.us-e1.tago.io/\n# Europe West 1: https://api.eu-w1.tago.io/\n# Default (US): https://api.tago.io\n# TagoIO Deploy (dedicated single-tenant instance): e.g -\u003e https://api.xxxxx.tagoio.net\nexport TAGOIO__RELAY__TAGOIO_URL=\"https://api.tago.io\"\n\nexport TAGOIO__RELAY__DOWNLINK_PORT=\"3001\"\n\n# MQTT Client Settings\nexport TAGOIO__RELAY__MQTT__CLIENT_ID=\"tagoio-relay\"\nexport TAGOIO__RELAY__MQTT__TLS_ENABLED=\"false\"\nexport TAGOIO__RELAY__MQTT__ADDRESS=\"localhost\"\nexport TAGOIO__RELAY__MQTT__PORT=\"1883\"\nexport TAGOIO__RELAY__MQTT__USERNAME=\"my-username\"\nexport TAGOIO__RELAY__MQTT__PASSWORD=\"my-password\"\nexport TAGOIO__RELAY__MQTT__BROKER_TLS_CA=\"\"\nexport TAGOIO__RELAY__MQTT__BROKER_TLS_CERT=\"\"\nexport TAGOIO__RELAY__MQTT__BROKER_TLS_KEY=\"\"\n\n# Subscribe to multiple topics\nexport TAGOIO__RELAY__MQTT__SUBSCRIBE=[\"/device/#\"] \n\n# Change the path to the configuration file\nexport TAGOIO__RELAY__CONFIG_PATH=\"/root/.config/.tagoio-mqtt-relay.toml\"\n```\n\n### Middleware Endpoint (Optional)\nThe Middleware Endpoint allows the TagoIO MQTT Relay to receive messages from TagoIO through a secure TLS connection. This feature is optional but can be very useful for advanced integrations.\n\nThe Relay comes with pre-set TLS certificates configured during build time, so you don't need to set them up manually.\n\n#### Setting Up the Middleware Endpoint\n\n1. **Public HTTPs Endpoint:**:\n   Ensure that you have a public HTTPs endpoint that TagoiO can reach.\n2. **Configure the Downlink Port:**\n  The default port for the Middleware Endpoint is 3001, but you can change this by setting the downlink_port in your (configuration file)[#configuration-file-and-environment-variables].\nRepl\n3. **Local Testing**:\n  For local testing, you can use tools like ngrok or tailscale to expose your local server to the internet securely. Ensure to run the relay with the `--unsafe-mode` flag.\n\n  ```sh\n  tagoio-relay start --unsafe-mode\n  ```\n\n  **Using Ngrok:**\n  ```bash\n  ngrok http https://localhost:3001\n  ```\n\n  **Using Tailscale:**\n  ```bash\n  tailscale funnel 3001\n  ```\n4. **Network Middleware Endpoint:**\n   To enable the Middleware Endpoint, you need to set the field `Middleware Endpoint` in your Network at TagoIO to the generated URL (e.g., https://abcd1234.ngrok.io) as your Middleware Endpoint in TagoIO.\n\n## License\n\nThe TagoIO MQTT Relay is licensed under the Apache License. See the [LICENSE](./LICENSE) file for more details.\n\n---\n\nThank you for using TagoIO MQTT Relay! If you have any questions or need further assistance, feel free to reach out via [GitHub Issues](https://github.com/tago-io/mqtt-relay/issues) or our [community forum](https://community.tago.io). 🚀\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftago-io%2Fmqtt-relay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftago-io%2Fmqtt-relay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftago-io%2Fmqtt-relay/lists"}