A 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.
- Rust, you can install it using rustup
- A working instance of ThingsBoard
- A B-L072Z-LRWAN1 LoRa kit or an IoT-LAB Account
- An account on The Things Network
USAGE:
rusty-mqtt [OPTIONS] --TTN-port <RPORT> --server <SERVER> --topic <TOPIC> --username <USER_NAME>
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
-k, --TTN-port <RPORT> TTN MQTT server port [default: 1883]
-s, --server <SERVER> ThingsBoard MQTT server address [default: 0.0.0.0]
-t, --topic <TOPIC> TTN topic to subscribe
-p, --port <TPORT> ThingsBoard MQTT Server port [default: 1883]
-r, --TTN-address <TTN> TTN MQTT server address [default: eu1.thethings.network]
-u, --username <USER_NAME> ThingsBoard gateway device ACCESS_TOKEN
In 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.
In the TTN Application Console we must specify a custom decoder function like:
function Decoder(bytes, port) {
var result = "";
for (var byte in bytes){
result += String.fromCharCode(bytes[byte]);
}
return {"result": result };
}
cargo run --release -- -t "#" -u "A1_TEST_TOKEN" -r "eu1.cloud.thethings.network"
- The Things Network MQTT Documentation
I developed an HTML5 application using the Generic Sensor API that collects data from the accelerator sensor of the mobile phone. A User Activity Recognition model is executed both on the device (Edge-based approach) and ThingsBoard (Cloud-based approach).
The application is hosted using GitHub Pages and it's available here. You simply need to enter a ThingsBoard Device Access Token and after pressing the start button data from the accelerometer is sent to ThingsBoard using the Telemetry Upload HTTP API.
Assignment 1: The MQTT protocol using ThingsBoard, Rust and React
Assignment 2: How to setup an Async MQTT transparent bridge in Rust
Assignment 3: The LoRaWAN communication protocol using RIOT, ThingsBoard and Rust
Assignment 4: Generic Sensor API, Sensors For The Web!
Assignment 1: https://www.youtube.com/watch?v=6th-NgDjC1w&feature=youtu.be
Assignment 2: https://youtu.be/JiG8LkaZDtQ
Assignment 3: https://www.youtube.com/watch?v=bsJNijxUCw0
Assignment 4: https://www.youtube.com/watch?v=d5ZlM878lms