1 of 51

2023/07/19

IoTtalk物聯網應用開發平台簡介�與 �IoTtalk 平台初體驗

蔡文能

交通大學 資工系

2 of 51

Agenda (綱要)

  • What is IoTtalk ?
  • Why using IoTtalk?
    • Easy to use / Deploy
    • Easy to write your own DA (Device Application)
    • Easy to customize / extend (manage Device Features/Device Models)
    • Easy to integrate with AI / Machine Learning
  • What can IoTtalk do for you ?
  • IoTtalk 系統平台各種應用 (Various Applications)� ● Demo / Practice using IoTtalk / Debug (trouble shooting)

2

3 of 51

What is IoTtalk ? (1/2)

3

  • IoTtalk: A Platform for IoT Applications Quick Development (GUI based)
  • A Web Application
  • A Website / A Server

  • 林一平教授研發團隊�National Chiao Tung University

Python + Flask + RESTful API

DHTML/JavaScript/jQuery

SQLite / MySQL, and …

4 of 51

What is IoTtalk? (2/2)

  • IoTtalk is an IoT device management tool
  • IoT management concept
    • Device Feature (設備功能)
      • The function or capability which an IoT can provide
    • Device Model (設備模型、類別)
      • A set of device features
      • A device model refers to �a specific product
    • Device name
      • The name of a specific product

4

Feature 1

Feature 2

Feature 3

Model

An IoT device

Name

G-sensor

Mic.

Display

Smartphone

For example:�Lin’s phone

5 of 51

Why using IoTtalk?

  • Simple and intuitive GUI
  • Applications can simply develop with lower efforts (Low code)
  • Application development without real devices is feasible
  • Easy to Deploy and Operate
  • Easy to write your own DA (Device Application)
  • Easy to Customize and Extend

5

6 of 51

Applications can simply develop with Lower efforts (Low code/No code)

  • Low code or No code required for simple application
    • Cyber Devices and Vpython Devices for your practice
    • API (many Languages) and Examples are provided on github.com/IoTtalk/

6

7 of 51

Application development without real devices is feasible

  • Simulation ON to simulate Input Devices
  • The simulator provides the numerical values as inputs

7

8 of 51

Easy to Deploy and Operate�Appliances/IoT Devices Connection�

8

Wi-Fi �Access Point

(with IoTtalk inside)

Air conditioner

iRobot

TV

Fan

Lighting

Smartphone

Connecting

Connecting

Connecting

Connecting

Connecting

Connecting

9 of 51

Easy to write your own DA (Device Application)

  • 建議先從Github.com/IoTtalk/ 的 Dummy_Device 範例入門
  • 參考 iottalk.vip/000/ 裡面的 (四)(五)(六)

9

10 of 51

Easy to Customize and Extend (1/2)

  • Reusable DF modules
    • Even they are different IoT devices (different DM)

10

11 of 51

Easy to Customize and Extend (2/2)

  • Reusable DM (Device Models)
  • Easy to Customize DM and/or Extend DM
    • Manage DF/DM using IoT device management tool

11

12 of 51

Easy to integerate with AI / Machine Learning

12

13 of 51

What can IoTtalk do for you ?

  • Learn IoT for fun
  • Do your school Project (高中/大學專題 ) using IoTtalk
  • Pursue a Master degree (碩士) or even a PhD degree (博士)
  • Do real Applications
    • See next page
  • And much more …

13

可用這練習: https://demo.iottalk.tw

14 of 51

IoTtalk 系統平台各種應用

(共五個影片)

14

15 of 51

農譯 AgriTalk 其它影片

15

https://www.agritalk.com.tw/pages/about-us//#相關影片分享

16 of 51

Turn On/Off a Bulb (1/3)

  • Create an IoT Application ..
    • For using a Remote_control to control a Bulb
    • Device Models used
      • Bulb -- use ODF : Luminance (亮度)
      • Remote_control – use IDFs:
        • 1 Knob (旋鈕) + 1 Switch (開關)
    • Create a new project or use old project
    • Import/Config a Bulb and a Remote_control
    • Connect from IDF to ODF (see Next page)

16

請用這練習: https://demo.iottalk.tw

Demo using iottalk

17 of 51

Turn On/Off a Bulb (2/3)

  • Connect from IDF to ODF

17

  • IDF on LEFT side
  • ODF on RIGHT side

請用這練習: https://demo.iottalk.tw

如果一個 Device�同時有 IDF 和 ODF,�在畫面上 ..�會拆成左右兩個圖 !

遙控燈泡 的 Project

Demo using iottalk

18 of 51

Turn On/Off a Bulb (3/3)

18

請用這練習: https://demo.iottalk.tw

    • Request DA: (on the IoTtalk HOME page)
      • a Remote_control + a Bulb
    • Bind(綁定或稱關聯) your Devices
    • Test your project ☺

Demo using iottalk

19 of 51

Step 0 Press Project Link (生出新網頁) then Select a project

19

Demo using iottalk (Step by Step)

請用這練習: https://demo.iottalk.tw

20 of 51

Press Project Link (生出新網頁) then Select a project

20

Step 1

Step 2

Demo using iottalk (Step by Step)

add a new project OR using your OLD project

21 of 51

Select an Input Device Model and Features

21

Step 3. Select a Device Model

Step 4. Select Device features, and an icon is appeared

22 of 51

Select an Output Device Model and Features

22

Step 5. Similar to Steps 3 and 4

23 of 51

Connect IDF to ODF (1/2)

Step 6. Draw a line to connect IDF and ODF

23

24 of 51

24

Connect IDF to ODF (2/2)

Step 7. Select the IDF function to set the connection logic

Step 8. Select the ODF function to set the connection logic

Step 9. Click joint point to check input TYPE and join function

25 of 51

Create Devices: Remote_control and Bulb

25

26 of 51

重大訊息

  • 因為 IoTtalk 改版目前把 Remote_control 拿掉了,�兩個解決方法:�(1)使用手動生出神密遙控器 (稍後投影片)�(2)抓 Remote_control 壓縮檔到自己電腦
    • 解壓縮
    • 進入子目錄修改 sa.txt 檔案內看要連哪個 server
    • 改好存檔後,滑鼠雙極擊 index.html 啟動網頁
    • 壓縮檔在 https://iottalk.vip/000/ 裡面提到遙控器處

26

27 of 51

Bind your Input and Output Device

Step 8. Bind your Input and Output Device

27

28 of 51

Test your IoTtalk Project

  • 用電腦或手機上的遙控器控制另ㄧ手機或電腦上的燈泡
  • 可以在 Project 網頁重新綁定另一個遙控器或另一個燈

  • 從iottalk首頁點 Bulb 生出網頁且它的 DA 會連入 IoTtalk server 註冊
  • 任何物聯網裝置的 DA (Device Application)程式都要連入IoTtalk server 註冊
    • 這樣你才可在 Project 網頁內點你的 DM 右上角四方型看到它們

28

29 of 51

體驗IoTtalk 詳細步驟與用法請參考

  • https://youtu.be/ptupVe_qnkY (用遙控器控制燈泡 12分鐘影片)
  • https://iottalk.vip/000#THROW (用手機隔空丟球)
  • 其它ㄧ些 使用 IoTtalk 相關影片
    • https://www.youtube.com/tsaiwn
  • 可在 youtube.com 內搜尋 iottalk + tsaiwn

        • https://iottalk.vip/000/ (IoTtalk使用手冊詳細網頁)

29

30 of 51

神秘遙控器 RemoteControl

  • Server網址/RemoteControl/自取名稱

30

31 of 51

31

神秘遙控器

32 of 51

  • 按 F5 刷新網頁

32

神秘遙控器

回到剛那頁

  • Server網址/RemoteControl/自取名稱

這可控制燈泡顏色

(當然燈泡(Bulb)要

勾選顏色功能)

33 of 51

思考+練習 不同方法開關燈泡 �用 Smartphone 開關 Bulb 燈泡 (1/2)

  • Input Device Model 選 Smartphone
    • 功能只要勾選 Acceleration (重力家速度感測器)
  • Output Device Model 選 Bulb
    • 功能只要勾選 Luminance (亮度)

33

34 of 51

思考+練習 不同方法開關燈泡 �用 Smartphone 開關 Bulb 燈泡 (2/2)

  • 手機翻正反面 (如果要用左右翻轉呢)
    • x1 左右翻
    • x2 前後翻
    • x3 正反翻

34

這 python 函數要寫啥?

注意 close 後要套用並Save

35 of 51

Demo using iottalk --�用 Smartphone 隔空丟球 Ball-Throw2

  • Input Device Model 選 Smartphone
    • 功能只要勾選 Acceleration (重力家速度感測器)
  • Output Device Model 選 Ball-Throw2

35

https://iottalk.vip/000#THROW (用手機隔空丟球)

36 of 51

隔空丟球 Ball throw2 (1/2)

36

注意頁面標籤�這裡的編號

https://iottalk.vip/000#THROW (用手機隔空丟球)

37 of 51

37

隔空丟球 Ball throw2 (2/2)

https://iottalk.vip/000#THROW (手機隔空丟球)

38 of 51

Troubleshoot your IoTtalk Project, (1/3)

  • Common ways to solve the problem(s)
    • Try FLUSH button first
    • Ensure Simulation Mode is OFF (ON to simulate input(s))
    • Make sure you have correct Association/Binding
    • Check all parameters with the Joint (connection LINE) LEFT Click Mouse
      • Sample / Variant; (取樣 / 變化值)
      • IDF function applied
      • Join function applied
      • ODF function applied

38

See the Fig. on next Slide

初學Python 可參考: https://iottalk.vip/6/

39 of 51

Check all parameters with the Joint (connection LINE)

39

40 of 51

Troubleshoot your IoTtalk Project, (2/3)

  • Some Common problems in IoTtalk project
    • Warning SIGN appears (出現驚嘆號警告)
      • The Device bound to/associated with is GONE
      • You Applied WRONG Function(s) – IDF function/Join function/ODF function
      • Error(s) in your Python Function
    • Device Register Fail (向 IoTtalk 伺服器註冊失敗)
      • If you can modify the DA program,�Use a specific Device Name (d_name); ( NOT DM_NAME )
        • 例如 d_name 最好含有你學號末三碼以方便綁定
      • If you RUN multiple copies, also Note the Registration Address
      • DELETE devices NOT used in Device Monitor Page if necessary

40

可用這練習: https://demo.iottalk.tw

Click the Warning SIGN to see what happened

41 of 51

Troubleshoot your IoTtalk Project, (3/3)

  • More Common ways to solve the problem(s)
    • Monitor Data Flow on the Joint: : RIGHT Click the Joint
      • From IDF through Joint to ODF; check RAW value/Scaling value
      • Turn ON Simulation to simulate
      • RANGE of IDF/ODF value (scaling or Not scaling)
      • If necessary, DELETE the Joint (LINE), and then Reconnect it
        • Turn OFF Simulation (recommended)
        • DELETE the Joint (LINE); then Reconnect it/them
        • Check all parameters again; Press Save after applying function(s)
      • Press FLUSH button again
      • Make sure Simulation Mode is OFF if you want to test real input(s)

41

See the Fig. on next Slide�You may have multiple IDF and/or multiple ODF

42 of 51

Monitor Data Flow on the Joint: : RIGHT Click the Joint

42

43 of 51

Check Auto Scaling (for ODF) (1/3)

43

萬ㄧ看不到, 必須從 DFM / DMM 查看 (Bulb 的 ODF)

Device Feature Management / Device Model Management

( 這樣, 不必改 Server, 就可以擴充 IoTtalk 系統)

44 of 51

Check Auto Scaling (for ODF) (2/3)

可以從 DFM / DMM 查看甚至修改 (Bulb 的 ODF)

44

45 of 51

Check Auto Scaling (for ODF) (3/3)

45

[0, 0] 則表示不會 auto Scaling

46 of 51

using iottalk

46

謝謝捧場

tsaiwn@cs.nctu.edu.tw

蔡文能

47 of 51

重要參考網頁

  • HTML
    • https://tsaiwn.weebly.com 網頁相關 > 簡單的教學
    • GOOGL 搜尋 HTML + w3school
  • JavaScript
    • https://iottalk.vip/static/ab.html � (檢視網頁原始碼,大略看 JavaScript 寫的幾 A 幾 B 遊戲)
    • GOOGL 搜尋 javascript + w3school

47

48 of 51

行星運動

48

49 of 51

地球公轉

49

50 of 51

隔空乒乓球

50

51 of 51

單擺運動

51

這個單擺的程式與 DM 對應故意弄成有問題