This is an IoT platform developped using flask where people can veiw the temperature, humidity and gaz state
Some photos about this project:
- install python
git clone
the project thencd
into the directory- run
virtualenv -p /usr/bin/python3 venv
orpython -m venv venv
to create a virtual environment - activate it using
source venv/bin/activate
pip install -r requirements/base.txt
to install the app libaries and it dependencies- you must install mosquitto as mqtt server accept arduino data
apt install mosquitto
- you need to have mysql server installed in your machine, if you are working in linux just typr
sudo apt-get update && apt-get install mysql-server
- type
sudo mysql
to enter to the database - app sql config in
.env
.env-mysql
app/config/py
migtatnois/alembic.ini
files - example:
sqlalchemy.url = mysql+pymysql://iot_platform:secret@localhost:3306/iot_platform_db
mysql+pymysql://db_user:db_user_passwd@lP:port/db_name
- .....
After installing, run the server using ./start.sh
Access the running app in a browser at the URL written to the console (most likely http://localhost:5000)
You can set the recipient and sender of the alert mailbox in the file policy/bot.py
# example file
# /etc/nginx/sites-available/arduino-web
server{
listen 80;
server_name 127.0.0.1; #you ip address or name address
location / {
proxy_pass http://127.0.0.1:5000;
proxy_set_header Host $proxy_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
set nginx enable
ln -s /etc/nginx/sites-available/arduino-web /etc/nginx/sites-enabled/
sudo systemctl enable nginx --now