# 如何在QIoT Suite Lite 中的Rule(Node-red)中安裝新的Plugin(以Webduino及CHT IoT為範例) 本教學教您如何使用QIoT Suite Lite 中的Rule(Node-red)UI介面安裝及手動安裝上架至Node-red官方第三方Plugin,以及手動安裝zip檔案非npm架上做使用,此處教學將以安裝webduino plugin以及CHT IoT Plugin做示範。 **關於Webduino 可參考 : https://webduino.io/** **關於CHT IoT 可參考 : https://iot.cht.com.tw/iot/** ## UI介面安裝Node-red官方(npm)架上Plugin 1. 在QIoT Suite Lite IoT Application中選擇您的IoT Application,切換至Rule頁面 2. 點擊畫面右上角選單符號,點擊`Manage palette` : ![](https://i.imgur.com/JnSRu2g.png) 3. 點擊Install頁籤,在搜尋欄位搜尋您想要安裝的plugin名子,最後點擊`install` : ![](https://i.imgur.com/DGmYFJG.png) 4. 跳出警告訊息,因為每種Plugin有不同的安裝方式,建議參考各個Plugin說明在行安裝,點擊`Install` : ![](https://i.imgur.com/00XhGft.png) 5. 安裝完成後即出現會綠色方框,若出現紅色方框代表此Plugin不支援,請參考此Plugin安裝說明,另外若安裝成功卻沒有node出現請先重新整理頁面即會出現 : ![](https://i.imgur.com/poJY77v.png) ![](https://i.imgur.com/DWyVrRl.png) 另外若您需要繼續操作Webduino後續步驟,可參考此官方教學: [https://tutorials.webduino.io/zh-tw/docs/socket/useful/node-red-twitter.html](https://tutorials.webduino.io/zh-tw/docs/socket/useful/node-red-twitter.html) **安裝 Webduino Node-RED 節點** 之第三步驟 ![](https://i.imgur.com/X5PLi5U.png) ## 手動安裝Node-red npm 架上Plugin 1. SSH進入NAS 2. 進入`qiot-node-red` Container : ```bash system-docker exec -ti qiot-node-red bash ``` 3. 移動資料夾到`node_modules`目錄 : ```bash cd /usr/local/lib/node_modules/node-red/node_modules/ ``` 3. 安裝Node-red Plugin : ```bash npm install node-red-contrib-webduino ``` 6. 重新啟動所有的Node-red執行程序 : ```bash supervisorctl restart all ``` 7. 最後即可在Node-red node列表中看見新增加的Node : ![](https://i.imgur.com/DWyVrRl.png) 另外若您需要繼續操作Webduino後續步驟,可參考此官方教學: [https://tutorials.webduino.io/zh-tw/docs/socket/useful/node-red-twitter.html](https://tutorials.webduino.io/zh-tw/docs/socket/useful/node-red-twitter.html) **安裝 Webduino Node-RED 節點** 之第三步驟 ![](https://i.imgur.com/X5PLi5U.png) ## 手動安裝Zip檔案,非架上Node-red Plugin 1. SSH進入NAS 2. 進入`qiot-node-red` Container : ```bash system-docker exec -ti qiot-node-red bash ``` 3. 安裝相關套件 : ```bash apt update && apt install unzip wget ``` 4. 下載Plugin檔案(此處以CHT IoT為範例)並解壓縮 : ```bash wget https://iot.cht.com.tw/iot/developer/resources/iot/download/NodeRED/node-red-contrib-CHT.zip unzip node-red-contrib-CHT.zip ``` 5. 移動資料夾到`node_modules`目錄 : ```bash mv node-red-contrib-CHT /usr/local/lib/node_modules/node-red/node_modules/ ``` 6. 重新啟動所有的Node-red執行程序 : ```bash supervisorctl restart all ``` 7. 最後即可在Node-red node列表中看見新增加的Node : ![](https://i.imgur.com/ecAtjgp.png) 另外若您需要繼續操作CHT IoT後續步驟,可參考Node中相關使用說明,以及CHT IoT官方網站 : [https://iot.cht.com.tw/iot/developer/](https://iot.cht.com.tw/iot/developer/) ###### tags: `Tutorial`