Skip to content

eleazarmeza/IOT

Repository files navigation

🚀 IOT Equipo Pótamo 🚀

🔥 App and Network deployment to allow messaging in crisis 🔥

Project about the deployment of a group of drones in which they connect to form a wifi Network that helps people connect with their Android devices and lets them send messages to ask for help or let emergency services about their situation. The project is based in the MQTT (Mosquitto protocol) which allows an intermitent connection, which is helful during crisis where commercial or usual networks tend to be offline.

🚨 Flooding crisis 🚨

App Screenshot

🌐 Motivation 🌐

Disasters and catastrophes wreak havoc on people, communities, and entire cultures around the world every year. They are expected to increase in frequency in the future, which is alarming. Natural disasters like tornadoes, hurricanes, earthquakes, floods, wildfires, mudslides, or droughts can happen, or they can be created by people (e.g., mass shootings, chemical spills, or terrorist attacks). The behavioral health of individuals and communities depends on their ability to prevent disasters and traumatic events, to respond to them, and to recover from them.

Photo

Photo

People may react in a variety of ways when faced with a disaster, many of which are normal reactions to difficult circumstances. After a calamity, most people demonstrate resilience. Resilience is the capacity to overcome obstacles and persevere under difficult circumstances. Fortunately, resilience in catastrophe recovery is commonplace rather than exceptional, and people frequently show this ability. supportive tools. But with the technology as a resource that allows for damage assessment, real-time information gathering and rapid response, as well as mapping affected areas and analyzing them to see what kind of assistance victims need we could better manage catastrophes.

An example that the Mexican students can identify with is the earthquake in September 19 of 2017, in which the signal was down and nobody was able communicate or send messages if they were in an emergency or safe. Even our school collapse, nowadays we have a new campus after 5 years but the fear and the psychological damage that this caused and other recent earthquakes can make many people can collapse and shock. This made all the students at that time that earthquakes are not a game, because some of them had to take out people from the collapsed buildings. In the old tes de buildings were connected by a bridge and also all the bridges collapsed and buildings were very damaged.

App Screenshot

Other example that touches everyone was the case of a school called Enrique Rebsamen, this was a school of kids that also collapse in the earthquake already said , this school was full of kids and with irregularities in their structure and official documents. Many kids die and not all the kids could be taken out, nowadays this building continues collapse and the owner of the school is fugitive.

App Screenshot

Another example in which Brazilians students can identify are the floodings that are very dangerous but normally regular. It’s normal the feeling that in one second all your things and life can disappear or change. In Brazil, the flooding leaves damage and takes a lot of lives and communication can change a lot of things because the people can advise the next towns the situation that is going to happen in seconds.

App Screenshot

Introdrucing Specifically about floods, many people around the world live in zones that are more prone to floodings than others, we have taken the challenge to help all those people around the world that in case of emergency they may need to communicate, and we are aiming to create a system based on a network mounted in drones, to help people connect to send messages through that network in order to let people contact emergency services an to let them know where they are and what they need.

App Screenshot

After we see and live this kind of catastrophes, we are in a position of changing and create something that can help to avoid some hard situations.It's a very interesting and important challenge to achieve.

Photo

Photo

📋 Deliverables 📋

  • Step 1 Project Setup

Firts we had to identify the technical and non-technicals requirements of the projects with the required documents and set a GitHub

  • Step 2 Client and Edge Stage

In this deliverable we configured the emulation scenario and we implemented the android client with the requiered brokers

Photo

Here is the link for the Step 2: https://youtu.be/xLfU2teIvqk

  • Step 3 Cloud Stage

For this step we had to implement the broker in the cloud which received the messages from the broker and with an integration with the SQL database

Photo

Photo

Here is the link for the Step 3: https://youtu.be/vPZWJWIKPw4

✒️ Authors ✒️


Armando

Cristobal

Jenny

Mariana

Samuel

Pablo

Carolina

Alfredo

📋 Basic Configuration 📋

A virtual Machine in Linux is essential, for this purpose we used Azure.

You may want to use it, for that it is required to open the next ports:

HTTP : 80 (for websockets)

MQTT: 1883 to 1886 (for tests)

On our machine (Mac for example) we need to install:

Termius. This will handle all terminal connections needed.

It is required to install all the software below on the virtual Machine:

sudo apt update (to update ubuntu)

sudo apt upgrade (to upgrade ubuntu)

MQTT. Since it's the protocol used

sudo apt-get install mosquitto

sudo apt-get install mosquitto-clients

sudo apt clean

Then we configure mosquitto

cd /etc/mosquitto

cp mosquitto.conf mosquitto.conf.orig

nano mosquitto.conf

The file should look like this to allow anonymous connections:

allow_anonymous true

pid_file /var/run/mosquitto.pid

persistence true

persistence_location /var/lib/mosquitto/ log_dest file /var/log/mosquitto/mosquitto.log log_dest stdout

include_dir /etc/mosquitto/conf.d

Then we can run it

mosquitto -c mosquitto.conf -v

Mysql. It's where the database will be stored and. handled

sudo apt install mysql-server

mysql -p (to login with password)

sudo mysql -uroot (to login as root)

We need to clone the database or create it from the ground.

clone it with:

git clone http://github.com/luisglz/eventsDB.git

Now, we go to mqsql and:

create database events;

We create a superUser:

Grafana-Server. For the dashboard

sudo apt-get install -y adduser libfontconfig1

wget https://dl.grafana.com/enterprise/release/grafana-enterprise_9.3.1_amd64.deb

sudo dpkg -i grafana-enterprise_9.3.1_amd64.deb

Nginx. To redirect from port 80 to the host on port 3000, basically we do it for Grafana.

sudo apt install nginx

in nginx we need to configure: sites-available by adding to it a new doc:

sudo touch grafana

nano grafana

where we add:

server{

listen 80;

listen (::]:80;

location / {

proxy_pass http://localhost:3000/;

proxy_set_header Host $host;

proxy_set_header X-Forwarded-For $remote_addr;

}

}

then we create a link

sudo ln -s /etc/nginx/sites-available/grafana /etc/nginx/sites-enabled/

so we delete default in sites-enabled: sudo rm default

we restart the server with: sudo systemctl restart nginx

For grafana, we need to create a dashboard

Once everything is running we can start the software:

node broker.js node publisher.js node subscriber.js

And we can check on mysql how it gets new coordinates.

Finally we can start grafana dashboard to see coordinates.

We might aid ourselves by running:

sudo systemctl status mqsql To know if software is active

sudo systemctl start grafana-server To start any program that might be inactive

📌 Used By 📌

This project is used by the following Universities:

  • Tecnológico de Monterrey (México)
  • Instituto Tecnológico de Aeronáutica (Brazil)

Logo

Logo

📖 Lessons Learned 📖

What did you learn while building this project? What challenges did you face and how did you overcome them?

🛠 Skills 🛠

Python, Azure, Java

📄 Features 📄

  • Android APP
  • Python code
  • Azure Virtual Machine