Susukuda_Apps is precise sensing and analytics solution integrating IoT with IOTA for dairy farm production and supply chain. You can read the Wiki https://github.com/radhyahmad/Susukuda_Apps/wiki for more details of this project.
IoT2Tangle file is node-sensor source code built with C++ in platformIO. Precise sensing is an IoT monitoring system using ESP32 Lolin to collect and measure CO2, air temperature, humidity, pressure, and liquid temperature, integrated with IOTA Tangle.
Streams-mqtt-gateway-master is source code for data streams to the tangle, you can download on https://github.com/iot2tangle/Streams-mqtt-gateway.
You can watch the demo of our deployment:
We have developed IoT and IOTA integration to measure CO2, air temperature, air humidity, liquid temperature, and theair pressure inside the containers of the milk storage, which ensure the freshness and quality of milk for expanding agricultural solutions to the cold chain, especially dairy farm. By using the latest technologies, the actual condition of the containers will be automated by adjusting the IoT systems, sensors, and clouds. It could be used for a long time in dairy farms to approach the supply chain. With real-time analytics, it is aimed to simplify the sampling process for quality control, maximize precision and efficiency, and provide the customers with the ability to monitor their products remotely. To achieve milk storage safety and eliminates milk waste, caused by non-efficient storage, is essential to monitor temperature-controlled rooms in order to ensure specified health and quality. The brand owner is confident that the product is transported and arrives at the right temperature.
Value:
- Simplifying the time-consuming process of storage monitoring.
- Improve quality control.
- Minimizing human errors.
- Optimizing precision and better practice.
Impact:
- Help dairy farmers grow their business, by improving the safety of their products.
- Provides dairy farms with the ability to monitor, organize and face any imminent risk, by alerting on time and suggesting them corrective action that have to be done to avoid any product spoilage.
If you want more detailed information regarding streams-mqtt-gateway, check the official page https://github.com/iot2tangle/Streams-mqtt-gateway.
We have updated some code to this source code.
https://github.com/radhyahmad/Susukuda_Apps/tree/main/Streams-mqtt-gateway-master(update)
Preparation
Install rust if you don't have it already, find the instructions here https://www.rust-lang.org/tools/install
Make sure you also have the build dependencies installed, if not run:
sudo apt install build-essential
sudo apt install build-essential
sudo apt install pkg-config
sudo apt install pkg-config
sudo apt install libssl-dev
sudo apt install libssl-dev
sudo apt install cmake
sudo apt install cmake
sudo apt update
sudo apt update
Installing the MQTT broker
In case you don't have a MQTT broker running yet, you can run one locally with Mosquitto:
sudo apt install mosquitto
sudo apt install mosquitto
If you don't want to set authentication for users run:
mosquitto
mosquitto
To enable authentication through usernames and passwords, follow the steps in http://www.steves-internet-guide.com/mqtt-username-password-example/
Installing the streams-mqtt-gateway
Download the Repository:
git clone https://github.com/iot2tangle/streams-mqtt-gateway.git
git clone https://github.com/iot2tangle/streams-mqtt-gateway.git
Configure the streams-gateway:
nano config.json
nano config.json
Set the whitelisted_device_ids to include all the device IDs specified in their respective configuration files. Leave username, password empty ("") if your borker does not require authentication. Set the username, password if you are connecting to an authenticaded broker. Set the borker_ip, broker_port to match the location on the broker, (default MQTT port is 1883). Change topic, node, mwm, local_pow if needed
Runnig the Gateway:
Run the streams-gateway:
cargo run --release
cargo run --release
This starts the server which will forward messages from the devices to the Tangle
The Output will be something like this:
Starting.... Channel root: "47d504e1a825e142dd899dda81ff787c7cfad3b83977feec3545eaef4315c8a50000000000000000:fd93e57d937910f429cdd211" To read the messages copy the channel root into https://explorer.iot2tangle.io/ Listening for topic iot2tangle on http://localhost:1883
Starting.... Channel root: "47d504e1a825e142dd899dda81ff787c7cfad3b83977feec3545eaef4315c8a50000000000000000:fd93e57d937910f429cdd211" To read the messages copy the channel root into https://explorer.iot2tangle.io/ Listening for topic iot2tangle on http://localhost:1883
Starting.... Channel root: "47d504e1a825e142dd899dda81ff787c7cfad3b83977feec3545eaef4315c8a50000000000000000:fd93e57d937910f429cdd211" To read the messages copy the channel root into https://explorer.iot2tangle.io/ Listening for topic iot2tangle on http://localhost:1883
Starting.... Channel root: "47d504e1a825e142dd899dda81ff787c7cfad3b83977feec3545eaef4315c8a50000000000000000:fd93e57d937910f429cdd211" To read the messages copy the channel root into https://explorer.iot2tangle.io/ Listening for topic iot2tangle on http://localhost:1883
To send data to the server you can use cURL, make sure the ip and port are the same as in the config.json file, and that they point to the broker:
mosquitto_pub -h localhost -p 1883 -u -P -t "iot2tangle" -m '{ "iot2tangle": [ { "sensor": "Gyroscope", "data": [ { "x": "4514" }, { "y": "244" }, { "z": "-1830" } ] }, { "sensor": "Acoustic", "data": [ { "mp": "1" } ] } ], "device": "DEVICE_ID_1", "timestamp": "" }'
mosquitto_pub -h localhost -p 1883 -u -P -t "iot2tangle" -m '{ "iot2tangle": [ { "sensor": "Gyroscope", "data": [ { "x": "4514" }, { "y": "244" }, { "z": "-1830" } ] }, { "sensor": "Acoustic", "data": [ { "mp": "1" } ] } ], "device": "DEVICE_ID_1", "timestamp": "" }'
Set values for -u -P to spsecify the username and the password for an authenticated broker.
Susukuda Infrastructure (IoT Integrated with IOTA) through Stream MQTT GatewayThe Tech: Susukuda_apps infrastructure is a network sensor system consisting of the ESP32 microcontroller (MCU) built-in/integrated with WiFi module as internet connectivity and raspberry as IoT edge device (MQTT-Streams) programmed in the Linux Operating System on computers, which is used to measure CO2, air temperature, humidity, pressure, and liquid temperature on the production process of dairy farm supply chain. The standard communication protocol (Machine to Machine) used is MQTT to send all of the data from sensors to the local server (MQTT-streams). Communication between edge-device raspberry, IOTA tangle network, and web-dashboard could be made remotely.
By using IOTA, the monitoring and control system is also directly connected and recorded in the cloud database. All data from the sensors connected to cloud computing is visualized in time-series data. The application process is used to manage all of the data in the database in order to access device id, location, production activity details, and local time. Real-time data of all processes can be visualized using either a mobile application or web dashboards. Streams-mqtt-gateway-master is source code for data streams to the tangle, you can download on https://github.com/iot2tangle/Streams-mqtt-gateway.
The pool server is a worker getting data from IOT2Tangle every 1 hour where the main node always performs to process the data from IoT2Tangle.
The dashboard of Data Visualization
You can read and run how to deploy tangle with pooling data server Susukuda Dashboard.pdf
You can read and run the program from the folder
Susukuda Dashboard
Demo:
Comments