20151126_jeffrey - silenceuncrio/diary GitHub Wiki

  • 0910 準備 IOT platform Development meeting
  • 1000 review again
  • 1330 會議記錄並遵照最新決議更新 mantis
  • 1525 幫助學生一同維護 mantis
  • 1705 IoT Platform communication 示意圖
  • 1835 action: 下禮拜要定義 control center 與 control box 間的溝通方式及格式

0910

已告知 Pioneer 關於 IOT platform meeting 的時間考慮到 Lun 只來早上
所以會在早上 10:30 或 11:00 舉行

根據上禮拜的信件我來發一個會議通知

  • 會議名稱: IoT Platform Development
  • 與會人員: Pioneer, jeffrey, jammy, ward, bob, brook, andy huang, andy hsu, lun
  • 主持人: jeffrey
  • 會議時間: 2015-11-26 10:30 ~ 11:30

趕快用筆電來 review 一下待會要說的內容

1000

review 了一遍
也順便再潤了一下比較念不順的句子
思考一下會議的過程可能會被問到什麼
準備一下答案

  • milestone 1 應該不用那麼久吧?
    • 因為是一開始跟大家一起 cowork, 學生們來的時間也少, 雖然我跟 Jammy 可以做多一點, 但也希望讓學生們有參與感
      進行了兩三個禮拜後會視情況再調整 我會依據 milestone 1 的進行狀況再調整 milestone 2 的 plan
  • 不是說要放在公司的 mantis 上嗎?
    • 會後我會整理到 mantis 上
    • 有為了這個案子申請了付費的 GitHub 帳號, 最多可以有 4 個 repository
      GitHub 上可以同時有 code, issue 和 wiki, 學生們在學校也已經習慣用 GitHub 交作業了
      所以學生們都有 GitHub 帳號, Jammy 也有
      我只要將這個專案設定成跟大家協同合作後, 他們便可以存取這專案
      爾後程式的 commit 或 issue 我們都很方便用 GitHub 這個平台來追蹤

1330

早上經過處長的一番指教之後, 最新的決議如下

  • 二月底做完 smart room 產品原型
  • 六月底做完 smart home 產品原型
  • 大原則是做出來的東西自己都會想買
  • information 寫在公司的 mantis

就先 follow 這些基本原則寫在 mantis 上

1525

幫每個學生在 mantis wiki 上建好文章大綱
讓他們在各自負責的段落裡充實該 wiki 的內容
告知 jammy 時得到的回塊是 wiki 該寫些什麼?
坦白說我也不知道怎麼回答他
總是帶一個小團隊...
就磨吧

Milestone 1 Assignment

  • Control Center
What Who When
Box communication Jeffrey 2015-12-01 ~ 2015-02-29
CGI Service Jeffrey 2015-12-01 ~ 2015-02-29
Sensor Module Jeffrey 2015-12-01 ~ 2015-02-29
Event Handler Jeffrey 2015-12-01 ~ 2015-02-29
Web UI Jeffrey 2015-12-01 ~ 2015-02-29
iOS APP Aaron 2015-12-01 ~ 2015-02-29
Android APP Jammy 2015-12-01 ~ 2015-02-29
  • Control Box
What Who When
Keypad Input Lun 2015-12-01 ~ 2015-02-29
door open sensor Ward 2015-12-01 ~ 2015-02-29
light detect sensor Andy Hsu 2015-12-01 ~ 2015-02-29
motion detector Brook 2015-12-01 ~ 2015-02-29
vibration detector Andy Huang 2015-12-01 ~ 2015-02-29
sound detector Bob 2015-12-01 ~ 2015-02-29
temperature detector Jammy 2015-12-01 ~ 2015-02-29
CO2 detector Jammy 2015-12-01 ~ 2015-02-29
BLE SensorTag Jammy 2015-12-01 ~ 2015-02-29

其實我指派給自己的東西蠻勇敢的

  • Box communication
  • CGI Service
  • Sensor Module
  • Event Handler
  • Web UI

這些東西都要在 JS9331 OpenWrt 上做出來
等於是要參考 openHAB 的架構來重新打造自己的 IoT Platform
當然 學生們 和 Jammy 都覺得 openHAB 看了那麼久都不用了喔
我下午也許會面臨到這樣的問題
不過在 OpenWrt 的平台做出像 openHAB 那樣的東西好處實在很多

  • 便宜
  • 技術全部掌握
  • 因應未來的客製化需求

這都是用 openHAB 所比不上的
雖然短期對 Jammy 和學生來說是個很高的門檻
不過這也是我表現的機會

說穿了
這架構等於是昇頻一直以來的 iCOS 的 IoT 版
我等於有一堆現成的東西可以用
萬一案子大了, 現有的同事要幫忙也非常容易 我就拿 iCOS 來開刀吧

1635

就 control center 這樣的角色到底實作在哪個平台做比較的話
就以我們 milestone 1 smart room 的網路架構來做比較
以最簡單的需求做假設

  • who - 我
  • where - 房間
  • what - 桌機(PC) 和 手機(Phone) 都要能上網

都做成最簡單的架構

         +----------+
         | Internet |  
         +-+--------+
           |
+----+   +-+---------+   +-------+
| PC +---+ AP Router +...+ Phone |
+----+   +---------+-+   +-------+
          .        |
          .        |   +--------------------------+
          .        +---+ Control Center - openHAB |
         .             +--------------------------+
          .
        +-.---------------+
        | IoT Control Box |
        +-----------------+

openHAB Solution 最少需要

  • AP Router
  • Control Center
  • Control Box
         +----------+
         | Internet |  
         +-+--------+
           |
+----+   +-+------------------------+   +-------+
| PC +---+ Control Center - OpenWrt +...+ Phone |
+----+   +-+------------------------+   +-------+
           .
           .
           .
         +-+-----------+
         | Control Box |
         +-------------+

OpenWrt Solution 只要

  • Control Center
  • Control Box

OpenWrt Control Center 等於有了下述的介面 LAN WAN Wi-Fi

這些都是 OpenWrt 的基本功能
實在不容小覷

1705

用這新的架構來畫一張 Communication 的示意圖
我們假設目前只有兩種 Sensor:

  • door open sensor
  • temperature detector
+----------------+   WAN   +----------+
| Control Center +---------+ Internet |
+--+--+----------+         +----------+
   .  | LAN: 192.168.0.250
   .  |
   .  |   +------------------+
   .  +---+ PC: 192.168.0.11 |
   .      +------------------+
   .
   .      +---------------------+
   .......+ Phone: 192.168.0.21 |
   .      +---------------------+
   .
   .      +----------------------------+
   .......+ Control Box: 192.168.0.201 | 
   .      +--+-------------------------+
   .         |
   .         |   +------------------+
   .         +---+ door open sensor |
   .             +------------------+
   .
   .      +----------------------------+
   .......+ Control Box: 192.168.0.202 | 
          +--+-------------------------+
             |
             |   +----------------------+
             +---+ temperature detector |
                 +----------------------+

我從桌機想知道現在門是開是關

PC 往 Control Center: 192.168.0.250 發 HTTP GET GET /door/ HTTP/1.1

Control Center 回應 PC: 192.168.0.11

HTTP/1.1 200 OK
...
Content-Type: application/json

{
  "module": "door",
  "open": "true"
}

這就是一個 JSON 資料格式
包含兩個資訊 "module": "door" 表示智是個門的模組 "open": "true" 表示開啟的狀態為真(就是門是開著啦)

我從手機想知道現在是溫室幾度

Phone 往 Control Center: 192.168.0.250 發 HTTP GET GET /temperature/ HTTP/1.1

Control Center 回應 Phone: 192.168.0.21

HTTP/1.1 200 OK
...
Content-Type: application/json

{
  "module": "temperature",
  "c": 28
}

JSON 資料格式包含兩個資訊 "module": "temperature" 表示這是個溫度模組 "c": 28 表示室溫為攝氏 28 度

在學生們離開前順便讓他們看一下

1835

跟處長報告一下今天的進度
也告知明天因病告假一天

離開前麻煩 Jammy 明天幫我照顧 Lun
就以 mantis 上的資訊為主

下禮拜我要開始定義 control center 與 control box 之間的溝通方式以及溝通格式
並提供教學讓整個團隊

  • 了解這樣的溝通方式
  • 未來能夠自己擴充不夠的資訊

發一封因病告假的 mail