Try   HackMD

(IOTA TangleID) 空氣盒子教學

tags: iota
  • 本頁連結

    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →

  • twzjwang/airbox-with-iota

  • 修改自 HACK4U#4: Hack4u 87Live 課程教學

  • 透過分散式帳本 IOTA 代替 MQTT server

  • 空氣盒子應裝設在 : 室外、不會淋雨、通風良好處!

  • 空氣盒子

    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →

  • Hack4u 87 Live 現在使用 “啤酒軟體” 授權

     * --------------------------------------------------------------
     *“啤酒軟體授權”(第八十七版 又稱很 87 版):
     * 87Live所有貢獻者共同發起了本協議只要你還保留本協議文本,你可以使用此軟體做任何事。
     如果我們在某一天相遇了,而且你認為此軟體很有價值,你可以為我買一些啤酒或者珍珠奶茶來答謝,當然如果可以的話,我們可以順便一起吃個雞排,此外有人也喜歡吃蛋糕,叫我一定要寫進來。我們往後將會提供正面表列清單...
     * --------------------------------------------------------------
     * 請注意:未滿18歲禁止飲酒,開車不喝酒,喝酒不開車。

硬體教學

  • 項目

    • Realtek Ameba 8195開發版
    • MicroUSB傳輸線
    • SHT31 or BME280
      • 溫溼度模組
    • PlanTower PMS3003 (G3)
      • 粉塵感測器
    • 麵包板
    • 一些杜邦線和杜邦頭
    • 一些杜邦針
    • 24 Awg 的單心線 * 8
    • (選擇性) 1.25mm 8p 轉杜邦連接線
    • (選擇性) OLED SSD1306 模組
    • (選擇性) 3D列印的外殼
  • 接線 PMS3003 (G3)

    • (Ameba) → (PMS3003)
    • 5V → pin1
    • GND → pin2
    • D1(TX) → pin4
    • D0(RX) → pin5
    • Image Not Showing Possible Reasons
      • The image file may be corrupted
      • The server hosting the image is unavailable
      • The image path is incorrect
      • The image format is not supported
      Learn More →
  • 接線 SHT31 和 OLED

    • (Ameba) → (SHT31) → (OLED)
    • GND → GND → GND
    • 3.3V → VIN → VCC
    • SDA → SDA → SDA
    • SCL → SCL → SCL
    • 如果使用紫色 CJMCU BME280,將 SDO 接上3V3
    • Image Not Showing Possible Reasons
      • The image file may be corrupted
      • The server hosting the image is unavailable
      • The image path is incorrect
      • The image format is not supported
      Learn More →

參考:

安裝教學

1. [win10 用戶 only] 更新DAP Firmware

  1. 前往 https://www.amebaiot.com/change-dap-firmware/ 最下方下載 DAP_FW_Ameba_V12_1_2-2M

或直接下載 DAP_FW_Ameba_V12_1_2-2M (下載連結)

  1. 將開發板接上電腦

    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →

  2. 按住CON2旁邊的按鈕不放

  3. 按一下CON1旁邊的按鈕

  4. 放開在第一步按住的按鈕

    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →

  5. 此時會出現一個磁碟槽,上面的標籤為 “CRP DISABLED”

    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →

  6. 打開這個磁碟,裡面有個檔案 firmware.bin

  7. 用新的 DAP firmware 取代

  8. 將USB重新插拔,新的firmware就生效了。

參考: 如何更換DAP Firmware?

2. 安裝Driver

  1. 將 Micro USB 接上 Ameba 的 DAP+DC+serial port 那一孔,另一端接上電腦,在電腦上關閉檔案視窗

    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →

    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →

  2. 前往 https://os.mbed.com/handbook/Windows-serial-configuration#1-download-the-mbed-windows-serial-port 點選 Download latest driver 下載 ARM MBED CMSIS DAP driver

或直接下載 ARM MBED CMSIS DAP driver (下載連結)

  1. 安裝 driver
  2. 安裝完成後會在裝置管理員看到 mbed serial port
    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →

參考: Windows serial configuration

3. 安裝 Arduino IDE 及相關資源

  1. 下載安裝 Arduino IDE
  2. 打開 Arduino IDE,為了讓 Arduino IDE 找到 Ameba 的設定檔,先到 File -> Preferences
    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →
  3. 在 Additional Boards Manager URLs: 填入:
    https://github.com/Ameba8195/Arduino/raw/master/release/package_realtek.com_ameba_index.json
    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →
  4. 填完之後按 OK,然後因為改編輯器語言的關係,我們將 Arduino IDE 關掉之後重開
  5. Tools -> Board -> Boards Manager
    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →
  6. Boards Manager 裡,它需要約十幾秒鐘整理所有硬體檔案,如果網路狀況不好可能會等上數分鐘。每當有新的硬體設定,我們需要重開 Boards Manager,所以我們等一會兒之後,關掉 Boards Manager,然後再打開它,將捲軸往下拉找到 Realtek Ameba Boards,點右邊的 Install,這時候 Arduino IDE 就根據 Ameba 的設定檔開始下載 Ameba 所需要的檔案
    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →
  7. 將板子選成 Ameba,選取 tools -> Board -> Arduino Ameba,並選擇 port
    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →

    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →

參考: Ameba Arduino: Getting Started With RTL8195

4. 上傳程式到 Ameba

  1. 取得主程式 twzjwang/airbox-with-iota

如遇到錯誤請回報,並可使用 LASS 提供的主程式測試
https://drive.google.com/drive/folders/0B7CvSQoX2QQKdndwSmxQb0VjRUU

  1. 複製 lib 下的檔案到放到 我的文件\Arduino\library 資料夾

    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →

  2. main/main.ino 開啟專案

  3. 修改 config.h 內 wifi SSID ssid、wifi password pass、緯度gps_lat、經度 gps_lon

    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →

  4. 點選左上角 上傳 按鈕,上傳程式至開發板

    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →

  5. 點選右上角 序列埠監控視窗 ,開啟 serial monitor 並選擇 baud rate 為 38400

    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →

  6. 初始化 wifi 成功

  7. clientIDuuid請記下 uuid
    clientID 為 mac address 後 8 碼
    uuid 為 LASS + toTrytes(clientID)

  8. 讀 sensor 資料,編碼,發出聲明

查看感測紀錄

IOTA Tangle explorer

  1. uuidLASSPBUAUAXABBMBOBAB
    Tag (uuid + 'C') :LASSPBUAUAXABBMBOBABC
    https://thetangle.org/tag/LASSPBUAUAXABBMBOBABC

  2. Tangle explorerTag 搜尋

  3. 結果

  4. Message 選 Text 可看見相關資料

APIs

g0v零時空汙觀測網 [WIP]

https://airmap.g0v.asper.tw/v5/#/map