{"id":13834497,"url":"https://github.com/lrazovic/rusty-mqtt","last_synced_at":"2025-07-10T04:32:15.690Z","repository":{"id":91805540,"uuid":"249023238","full_name":"lrazovic/rusty-mqtt","owner":"lrazovic","description":"A simple MQTT transparent bridge between TheThingsNetwork and ThingsBoard. Written in Rust","archived":false,"fork":false,"pushed_at":"2021-08-30T12:20:17.000Z","size":99,"stargazers_count":15,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-08-05T14:15:28.101Z","etag":null,"topics":["bridge","iot","mqtt","rust","rusty-mqtt","thingsboard","ttn"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lrazovic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-03-21T17:10:24.000Z","updated_at":"2022-12-31T14:44:13.000Z","dependencies_parsed_at":"2024-01-15T18:46:46.157Z","dependency_job_id":"6f3d51ae-8b8f-400e-aa0b-100f13220c84","html_url":"https://github.com/lrazovic/rusty-mqtt","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lrazovic%2Frusty-mqtt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lrazovic%2Frusty-mqtt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lrazovic%2Frusty-mqtt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lrazovic%2Frusty-mqtt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lrazovic","download_url":"https://codeload.github.com/lrazovic/rusty-mqtt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225618850,"owners_count":17497592,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["bridge","iot","mqtt","rust","rusty-mqtt","thingsboard","ttn"],"created_at":"2024-08-04T14:00:35.795Z","updated_at":"2024-11-20T19:32:05.618Z","avatar_url":"https://github.com/lrazovic.png","language":"Rust","funding_links":[],"categories":["Integrations"],"sub_categories":["IoT systems"],"readme":"# rusty-mqtt\n\nA bridge between the MQTT broker of TTN and ThingsBoard in Rust built for the Internet of Things 19/20 course during the Engineering in Computer Science Master's Degree.\n\n## LinkedIn Profile\n\n[Leonardo Razovic](https://www.linkedin.com/in/leonardo-razovic-4b20b1121/)\n\n## Assignment 1/2/3\n\n### Prerequisites\n\n1. Rust, you can install it using [rustup](https://rustup.rs/)\n2. A working instance of [ThingsBoard](https://thingsboard.io/docs/user-guide/install/installation-options/)\n3. A [B-L072Z-LRWAN1 LoRa kit](https://www.st.com/en/evaluation-tools/b-l072z-lrwan1.html) or an [IoT-LAB](https://www.iot-lab.info/) Account\n4. An account on [The Things Network](https://www.thethingsnetwork.org/)\n\n### Usage\n\n```\nUSAGE:\n    rusty-mqtt [OPTIONS] --TTN-port \u003cRPORT\u003e --server \u003cSERVER\u003e --topic \u003cTOPIC\u003e --username \u003cUSER_NAME\u003e\n\nFLAGS:\n    -h, --help       Prints help information\n    -V, --version    Prints version information\n\nOPTIONS:\n    -k, --TTN-port \u003cRPORT\u003e        TTN MQTT server port [default: 1883]\n    -s, --server \u003cSERVER\u003e         ThingsBoard MQTT server address [default: 0.0.0.0]\n    -t, --topic \u003cTOPIC\u003e           TTN topic to subscribe\n    -p, --port \u003cTPORT\u003e            ThingsBoard MQTT Server port [default: 1883]\n    -r, --TTN-address \u003cTTN\u003e       TTN MQTT server address [default: eu1.thethings.network]\n    -u, --username \u003cUSER_NAME\u003e    ThingsBoard gateway device ACCESS_TOKEN\n```\n\nIn the `src` folder you need a file `credentials.rs` containing the _App ID_ and the _App Access Key_ from the **TTN Application Console**. You can modify and rename the `sample_credentials.rs` file as reference.\nIn the **TTN Application Console** we must specify a custom decoder function like: \n```js\nfunction Decoder(bytes, port) {\n  var result = \"\";\n  for (var byte in bytes){\n    result += String.fromCharCode(bytes[byte]);\n  } \n  return {\"result\": result };\n}\n```\n\n#### Example\n\n```bash\ncargo run --release -- -t \"#\" -u \"A1_TEST_TOKEN\" -r \"eu1.cloud.thethings.network\"\n```\n#### Usefull Links\n\n* The Things Network [MQTT Documentation](https://www.thethingsnetwork.org/docs/applications/mqtt/api/)\n\n## Assignment 4\n\nI developed an HTML5 application using the Generic Sensor API that collects data from the accelerator sensor of the mobile phone.\nA User Activity Recognition model is executed both on the device (Edge-based approach) and ThingsBoard (Cloud-based approach).\n\nThe application is hosted using [GitHub Pages](https://pages.github.com/) and it's available [here](https://lrazovic.github.io/rusty-mqtt/).\nYou simply need to enter a ThingsBoard Device [Access Token](https://thingsboard.io/docs/user-guide/ui/devices/) and after pressing the start button data from the accelerometer is sent to ThingsBoard using the Telemetry Upload HTTP API.\n\n## Blog Posts\n\nAssignment 1: [The MQTT protocol using ThingsBoard, Rust and React](https://medium.com/@LRazovic/mqtt-protocol-using-thingsboard-rust-and-react-9f0434bd206e)\n\nAssignment 2: [How to setup an Async MQTT transparent bridge in Rust](https://medium.com/@LRazovic/how-to-setup-an-async-mqtt-transparent-bridge-in-rust-4614ad705138)\n\nAssignment 3: [The LoRaWAN communication protocol using RIOT, ThingsBoard and Rust](https://medium.com/@LRazovic/the-lorawan-communication-protocol-using-riot-thingsboard-and-rust-bebe76b20177)\n\nAssignment 4: [Generic Sensor API, Sensors For The Web!](https://medium.com/@LRazovic/generic-sensor-api-sensors-for-the-web-6eacabe279be)\n\n## YouTube Videos\n\nAssignment 1: [https://www.youtube.com/watch?v=6th-NgDjC1w\u0026feature=youtu.be](https://www.youtube.com/watch?v=6th-NgDjC1w\u0026feature=youtu.be)\n\nAssignment 2: [https://youtu.be/JiG8LkaZDtQ](https://youtu.be/JiG8LkaZDtQ)\n\nAssignment 3: [https://www.youtube.com/watch?v=bsJNijxUCw0](https://www.youtube.com/watch?v=bsJNijxUCw0)\n\nAssignment 4: [https://www.youtube.com/watch?v=d5ZlM878lms](https://www.youtube.com/watch?v=d5ZlM878lms)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flrazovic%2Frusty-mqtt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flrazovic%2Frusty-mqtt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flrazovic%2Frusty-mqtt/lists"}