2023年3月6日 星期一

Node-RED UI 和儀表板技術 BASIC

 Node-RED UI 和儀表板技術

BASIC

https://nodered-dashboards.gitbook.io/node-red-dashboards/workshop/basics-1

Node-RED 是一個非常棒的工具,可以讓原型製作變得更快更容易!Node-RED 非常容易上手,對於想要編寫和理解編程的初學者來說是一個很好的工具
Node-RED 提供了許多工具和插件,幾乎支持與編程相關的所有內容。它可用於 API、數據庫、IOT、IBM 的 Node-RED 介紹、WebSockets、電子郵件、腳本、圖像處理、雲計算、邊緣計算、創建網站等等,人們可以想到基於 NodeJS 來做。
在您的 IBM Cloud 帳戶上設置 Node-RED 後,您可以創建您的第一個流

創建流程的步驟

步驟 1. 添加註入節點

Inject 節點允許您將消息注入到流中,方法是單擊節點上的按鈕,或設置注入之間的時間間隔。
將一個從調色板拖到工作區。
打開邊欄(Ctrl-Space,或通過下拉菜單)並選擇“信息”選項卡。
選擇新添加的 Inject 節點以查看有關其屬性的信息及其作用的描述。

步驟 2. 添加調試節點

Debug 節點會導致任何消息顯示在 Debug 側邊欄中。默認情況下,它只顯示消息的有效負載,但也可以顯示整個消息對象。

第 3 步。將兩者連接在一起

通過在一個節點的輸出端口與另一個節點的輸入端口之間拖動,將 Inject 和 Debug 節點連接在一起。

步驟 4. 部署

此時,節點只存在於編輯器中,必須部署到服務器上。
單擊部署按鈕。就那麼簡單。
選擇 Debug 側邊欄選項卡後,單擊 Inject 按鈕。您應該在邊欄中選擇 Hello World。讓我們用它做一些更有用的事情。

步驟 5.添加功能節點

Function 節點允許您通過 JavaScript 函數傳遞每條消息。
在 Inject 和 Debug 節點之間連接 Function 節點。您可能需要刪除現有的電線(選擇它並點擊鍵盤上的刪除)。
雙擊 Function 節點打開編輯對話框。



[{"id":"cc99ef2d9fb031d9","type":"debug","z":"c809dfa94056ae98","name":"debug 59","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":580,"y":120,"wires":[]},{"id":"08601382e08925f8","type":"inject","z":"c809dfa94056ae98","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"Hello World","payloadType":"str","x":190,"y":120,"wires":[["cc99ef2d9fb031d9"]]}]



[{"id":"9eeed4475841eae0","type":"inject","z":"c809dfa94056ae98","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"Hello World","payloadType":"str","x":190,"y":180,"wires":[["3a33818f0b74be80"]]},{"id":"cc99ef2d9fb031d9","type":"debug","z":"c809dfa94056ae98","name":"debug 59","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":580,"y":120,"wires":[]},{"id":"3a33818f0b74be80","type":"function","z":"c809dfa94056ae98","name":"function 13","func":"var newString = msg.payload.replace(\"World\",\"Everyone , I hope you enjoy Node Red \");\nreturn {payload : newString};\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":370,"y":180,"wires":[["cc99ef2d9fb031d9"]]},{"id":"08601382e08925f8","type":"inject","z":"c809dfa94056ae98","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"Hello World","payloadType":"str","x":190,"y":120,"wires":[["cc99ef2d9fb031d9"]]},{"id":"f5ad359bfb82194a","type":"debug","z":"c809dfa94056ae98","name":"debug 60","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":920,"y":120,"wires":[]}]

沒有留言:

張貼留言

2024_09 作業3 以Node-Red 為主

 2024_09 作業3  (以Node-Red 為主  Arduino 可能需要配合修改 ) Arduino 可能需要修改的部分 1)mqtt broker  2) 主題Topic (發行 接收) 3) WIFI ssid , password const char br...