AndyChiangSH / aiot0531

aiot hw05

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

aiot0531

物聯網 - hw05

步驟

1. Clone這個專案

https://github.com/AndyChiangSH/aiot0531.git

2. 安裝所需套件

pip install -r requirements.txt

3. 建立 APP & 使用 HEROKU postgres

  • 註冊HEROKU帳號 (我本來就有了)
  • 新增一個APP
  • 新增外掛功能 heroku postgres

4. 使用 HeidiSQL 連線至 postgres DB

Postgresql >> Settings >> Database Credentials 取得資料庫資訊

5. 引用資料庫 (db/postgre.db)

6. 將資料庫資訊加入 app.py

myserver = "<fill-in-Heroku-Postgredb-DB-sever>"
myuser = "<fill-in-Heroku-Postgredb-DB-user>"
mypassword = "<fill-in-Heroku-Postgredb-DB-pwd>"
mydb = "<fill-in-Heroku-Postgredb-DB-db>"

7. 在本機測試

8. Push到GitHub

git push origin master

9. HEROKU連結到GitHub

10. 自動部署

11. 完成!

https://aiot0531.herokuapp.com/

成果

1. Random vs. AI

  • Random

  • AI

高 -> 綠色 低 -> 紅色

2. 額外顯示溫度和濕度的數據

About

aiot hw05


Languages

Language:HTML 60.2%Language:Python 39.6%Language:Procfile 0.2%