# Thesis Proposal
## Resource
### 1. Record Documents:
- [Latex Report](https://www.overleaf.com/9768623924kgsjnypzqjtd)
- [Drive](https://drive.google.com/drive/folders/1gkFuUaDfYcYuaBnZHFwNSHmS5IPD_qo3?usp=sharing)
- [Excel](https://docs.google.com/spreadsheets/d/1Ecr92ueYyZIiDekWYabv1HHH1_QWPjZinpPb085nXoU/edit?usp=sharing)
### 2. Reference:
- [Ref1]()
---
## Timeline
### MEETING: 10/10
Done
### 0. Design (clarify with instructor)
#### Sensor
- Collect data
- Transfer data to gateway via LoRa
#### Gateway
- Forward sensor data to network server
#### Network Server
- Contain many network applications, each of which has many topics (devices)
- MQTT broker
#### Application Server
- Subscribe and receive data from network server with one specific application
- Save data to database
- Stream payload data
- Handle request from end-use
#### End-User Application
- Provide interface via web, mobile app
- Request data to demonstrate & send control signal back to sensor device
### 1. Improve database:
Using PostgreSQL
Problem:
- Chưa hiểu database: Done
- Gửi database
- [x] List of entities
- [x] Conceptual models
- [x] Relational models
- [x] Implement DDL
- [ ] Communicate with Nodejs
- [ ] Test basic DML
### 2. EMQX:
Problem:
- emqx chưa connect được ttn
- Emqx có thay thế TTn ko?
- [ ] Study the machanism of TTN (Gô)
- [ ] Map TTN to EMQX (Gô)
- [ ] TLS/SSL
### 3. ~~Integrate Kafka (for later used)~~
Distributed server
Problem: None
- [ ] Draft
### 4. Application Server
Framework: Nodejs, React, Express
Suggest Firebase (Google)
Problem: none
- [ ] Study Nodejs, Firebase, Express & demo sth (Tiến) 16/10
- [x] [architecture](https://app.diagrams.net/#G1YcD88hIRYvsU6T3g4wqlf4AI5UlIV6tA)
- [ ] [Design Draft](https://app.diagrams.net/#G1e5R2BGtX5OMUjqkhXDb8iAYEmw-ZnpbL)
### MEETING: 13/10
Done
### QUICK MEETING: 16/10
- Done ERD.
- Plan a draft design of application server.
TODO:
- Mapping and implement on mySQL, connect with Nodejs server. (Tinh)
- Subscribe topic from TTN, publish to EMQX, create topic, store to mongoDB. User subscribe to EMQX. (Go)
- Mockup dashboard. (Tien)
Deadline to next week, update.
### MEETING WITH INSTRUCTOR: 22/10
Note: A button/icon for Vietnamese language conversion (users are mostly farmers)
- Nên có sẵn 1 main room, sau đó ng dùng có thể tạo thêm
- khi add mới device thì có tự động add vào room nào?
- Cho user add device thủ công vào room bất kỳ
- Tự động tạo widget mặc định ngay sau khi 1 device được add vào 1 room
- Thêm bản đồ trỏ tới địa chỉ
- edge computing: các node tiền xử lí
- [ ] [Slide]()
### QUICK MEETING: 31/10
**TODO:**
**Application layer**
| Work | Info | PIC | DL |
| ---- | ---- | ---- | --- |
| Stream server | - Try more devices<br>- Topic names management for devices<br> - Push to VPS - Try EMQX to TimescaleDB, store where? | Go | 1 week |
| Database | - Try TimescaleDB, port metadata DB to TimescaleDB | Tinh | 1 week |
| Dashboard | - Continue making dashboard, all draft pages | Tien | 1 week |
### QUICK MEETING: 20/11
Question for teacher:
- Map will so what?
- Register dev and account process?
Site map:
- Map will so what? Location of dev or somewhere?
- Delete add dev.
- How to make default page? Base on the dev list, make separated block to display value.
- Re-organize the dashboard to 2 state: show and edit.
### DEADLINE: 30/12
- Register dev: user add DEV ID to verify + admin add DEV.
- Account can register.
- Register by phone.
- Tim hieu xac thuc 2 lop./ cho max 5 nguoi dung.
- Location of dev (optional)
- nguoi mua nhap id -> xac thuc -> gan' owner cho thiet bi -> user get data.
- remove uplink rate, downlink rate.
- remove groups.
De cuong (6/12)
- Intro
- Motivation
- IoT app in these days (trình bày thực trạng)
- Thach thuc trong nong nghiep
- Related works (optional)
- What to do? our task
- Criteria
- gateway architecture
- non-gateway architecture
- LoRa
- History
- LoRaWAN
- MPIoT
- Solution proposal
- Design
- Platform
- Implemetation plan
- Gantt chart
Gantt Chart
- Basic database implementation
- Front-end implementation
- Back-end implementation of basic features
- Multicaster implementation
- Streaming broker implementation
- Database security Application
- Downlink message request integration
- Distributed database implementation
- Back-end implementation of advanced features
- Network server deployment
- System performance evaluation
- System improvement
- Report writing
- Presentation of thesis
Gantt Chart issues:
- Trien khai he thong la lam gi?
final presentation:
1. Introduction (3p)
* (1.5p)
* Purpose and Motivation
* Scope and Objectives (Go)
* (1.5p)
* Actualities of IoT applications (Tinh)
* Challenges for contemporary agriculture (Tinh)
2. Solution proposal (17p)
a. Testbed system design (1p)
b. Application server system design
* Application server (Go) (2p)
* Uplink message (Go) (1p)
* Streaming broker (Go) (1p)
* Database (Tinh) (4p)
* Web Application (Tien) (4p)
c. Platforms
* The Things Stack (TTS) - Network server (Go) (1p)
* EMQ X - MQTT broker (Go) (2p)
* Postgres and TimescaleDB (Tinh) (3p)
* Nodejs - Network application platform (Tien) (1p)
3. Next steps
Implementation plan
* Gantt chart (Go) (2p
**Presentation Timeline**
Introduction (2p)
(1.5p)
* Purpose and Motivation
* Scope and Objectives (Go)
(30s)
* Challenges for contemporary agriculture (Tinh)
(21p)
Solution proposal
a. Testbed system design (1p)
b. Application server system design
* Application server (Go) (2p)
* Uplink message (Go) (1p)
* Streaming broker (Go) (1p)
* Database (Tinh) (3p30)
* Web Application (Tien) (3p30)
b. Platforms
* The Things Stack (TTS) - Network server (Go) (2p)
* EMQ X - MQTT broker (Go) (1p30s)
* Postgres and TimescaleDB (Tinh) (3p)
* Nodejs - Network application platform (Tien) (1p)
Next step
Implementation plan
* Gantt chart (Go) (2p)
<hr>
# 2022 Update
## Reports
### 19/01/2022
Data Payload
- Remove unneccessary payload data (BatV, Work_mode)
### 13/02/2022
UI
- Edit the navbar collapse toggling (hide it entirely)
- Edit the battery column
- Configure to let the UI colormode and theme responding to browser and OS