代码拉取完成,页面将自动刷新
This is an IoT platform developped using flask where people can veiw the temperature, humidity and gaz state
Some photos about this project:
git clone
the project then cd
into the directoryvirtualenv -p /usr/bin/python3 venv
or python -m venv venv
to create a virtual environmentsource venv/bin/activate
pip install -r requirements/base.txt
to install the app libaries and it dependenciesapt install mosquitto
sudo apt-get update && apt-get install mysql-server
sudo mysql
to enter to the database.env
.env-mysql
app/config/py
migtatnois/alembic.ini
filessqlalchemy.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
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。