上傳data至AllThingsTalk

這次我們利用Advanced Weather Sensor (SW01 )收集數據,再以WI-FI CORE(CW01) 上傳至AllThingsTalk.
所需用料 :
micro:bit x 1
micro:bit brigde IM01 x 1
WI-FI CORE(CW01) x1
Advanced Weather Sensor (SW01 ) x 1
xChips Connector x 2
usb cable x 1
micro:bit coding platform : https://makecode.microbit.org/
AllThingsTalk platform : https://www.allthingstalk.com/
WI-FI CORE(CW01) + Advanced Weather Sensor (SW01 )接駁方法 :
詳細接駁教學請看此 : 按我

AllThingsTalk setup :

1.按下這個Playgroud

2. 選取「CONNECT A DEVICE」

3. 選取「XinaBox XK01 Starter Kit」
然後就可以進入編程部份
編程部份 :

1. 在CW01 block中選取 「with token " " and device-id " "」

2. 把它放在 connect to WiFi 下
至於 token 跟 device-id 要填什麼請看下圖

3. 返回AllThingsTalk 頁面 , 按「SETTINGS」

4. 按下「Authentication」.

5. 把「Device ID」複制到device ID , 「Device Tokens」複製到「token」.

6. 用這個Code經WI-FI CORE(CW01)發送數據 , 可以從CW01 block中找到.

7.利用button A 經WI-FI CORE(CW01)發送SW01 humidity的數據到ATT.
on button B 來show value , 目標是確認數據有沒有成功發出.
成功的話會看到humidity的數值.
ATT asset 要怎樣填請看下圖 :


8. 在Asset 頁面中可以找到各數據的代表數字
舉個例 , Humidity 就是 3 .
成功的話在「LIVE」會看到humidity的數據.
發傳成功時,micro:bit的LED screen會出現一瞬間的「✓」.
** 注意 : 要按下「Humidity」/你要顯示的數據 , 等它變亮才會在圖表顯示