Responsible for receivng data data from LocalRpi using MQTT. Stores data in database implemented using sqlite3. Receives data requests from MobileApp using MQTT then fetches data from database and sends it to MobileApp. Hosts mosquitto broker for MQTT. Implemented on RPI 4B board.
Uses SQLite as a database engine. Database is directly created and handled from Rust code using rusqlite.
Is implemented using eclipse paho.mqtt.rust. Uses AsynClient for subscribing and publishing with help of tokio for rust asynchronous runtime. Subscribing and parsing messages is implemented using message callback. Mosquitto broker is being hosted directly on RPI.
Protobuf files are generated during cargo build process and are put in target
directory. For more information about generation process of proto files look at build.rs or rust-protobuf docs.
sudo apt-get install build-essential curl git sqlite3 protobuf-compiler cmake libssl-dev mosquitto
chmod 777 setup_mosquitto_broker.sh
sudo setup_mosquitto_broker.sh
curl https://sh.rustup.rs -sSf | sh
RUST_LOG=info cargo run
- Protobuf
- Implement database
- Implement CREATE TABLES for devices and lamp_data
- Implement SELECT/INSERT requests for devices and lamp_data
- Implement SELECT requests for lamp_data depending on device_name, timestamp
- Unit tests for all free functions
- Implement MQTT
- Mosquitto broker
- find and add MQTT library
- Handler for some MQTT library
- specify topics and payloads
- Unit tests for all free functions
- Integrate database with MQTT
- update README