Solutions to problem statements provided by SRA, VJTI
Implementing MQTT communication protocol aided by data compression and json manipulation using mosquitto library in C.
Consider you have deployed various sensors in your office like temperature, pressure, gas, smoke, motion, proximity, etc. These sensors are present on different floors and rooms with 50 edge boards. You need to get the sensor readings to a single device like your mobile phone. Also, since sensors will be working the whole day, the size of data will increase tremendously. Considering that you need at least one week's data to provide the user with some statistics, you will have to compress and store the data on the user's device.
- About the Project
- Getting Started
- Usage
- Results and Demo
- Future Work
- Troubleshooting
- Contributors
- Acknowledgements and Resources
- License
The basic idea of this project is to understand MQTT protocol and this functioning and manipulating large data with minimal space and efficent storage. The project is done using mosquitto library in C. It can also be achieved using the Paho library in C++.
.
├── publisher.c # Publishes the data i.e in our case various SENSORS
├── subscriber.c # subscribes to the data using MQTT service
├── data
│ ├── device1
| ├── temperature.txt # -40 to 110 degree Celcius (upto 2 decimal places)
| ├── humidity.txt # 0% to 100% (upto 3 decimal places)
| ├── air_pressure.txt # 3 to 300 psi (integer)
| └── ph.txt # 0 to 14 (upto 1 decimal place)
| └── device2
| ├── distance.txt # 0 to 100m (upto 2 decimal places)
| └── switch_state.txt # “ON” or “OFF”
│
├── src # Source files (alternatively `lib` or `app`)
├── ...
├── test # Test files (alternatively `spec` or `tests`)
├── ...
├── LICENSE
├── README.md
├── Setup.md # If Installation instructions are lengthy
└── todo.md # If Future developments and current status gets lengthy
### Installation
1. Clone the repo
```sh
git clone https://github.com/dhairyashah1/Sra-Assignments.git
How to run the driver code
- See todo.md for seeing developments of this project
- Using multithreading to create various bots
- Generating Random JSON
- Implementing Compression Algorithm
- Compiling all code
- Common errors while configuring the project
Errors tend to occur while library installation. Kindly download as per your system configurations.
- SRA VJTI Eklavya 2020
- Vedant Paranjape
- MQTT using mosquitto
- Multithreading using C
- JSON for learning c-json
...