【智控万物】Node RED 树莓派物联网之Dashboard
【学习资料】dashboard简介与输入型仪表板控件的使用:https://blog.csdn.net/geek_monkey/article/details/80755899?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-3&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-3
【学习练习】
使用的是Windows10下的Node RED
部署后,使用http://127.0.0.1:1880/ui/查看
【树莓派练习】
https://v.youku.com/v_show/id_XNDY2NjQzNjAwMA==.html
【node-red 对接图灵机器人】
以下是导出的json:
[{"id":"b8cba949.172578","type":"tab","label":"流程1","disabled":false,"info":""},{"id":"6fc368b1.5ed4d8","type":"ui_tab","z":"","name":"TAB","icon":"dashboard","disabled":false,"hidden":false},{"id":"d3f0e284.fc0cf","type":"ui_group","z":"","name":"Group","tab":"6fc368b1.5ed4d8","order":1,"disp":true,"width":"6","collapse":false},{"id":"b8c4b9e9.251c68","type":"ui_base","theme":{"name":"theme-light","lightTheme":{"default":"#0094CE","baseColor":"#0094CE","baseFont":"Arial Black,Arial Black,Gadget,sans-serif","edited":true,"reset":false},"darkTheme":{"default":"#097479","baseColor":"#097479","baseFont":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif","edited":false},"customTheme":{"name":"Untitled Theme 1","default":"#4B7930","baseColor":"#4B7930","baseFont":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif"},"themeState":{"base-color":{"default":"#0094CE","value":"#0094CE","edited":false},"page-titlebar-backgroundColor":{"value":"#0094CE","edited":false},"page-backgroundColor":{"value":"#fafafa","edited":false},"page-sidebar-backgroundColor":{"value":"#ffffff","edited":false},"group-textColor":{"value":"#1bbfff","edited":false},"group-borderColor":{"value":"#ffffff","edited":false},"group-backgroundColor":{"value":"#ffffff","edited":false},"widget-textColor":{"value":"#111111","edited":false},"widget-backgroundColor":{"value":"#0094ce","edited":false},"widget-borderColor":{"value":"#ffffff","edited":false},"base-font":{"value":"Arial Black,Arial Black,Gadget,sans-serif"}},"angularTheme":{"primary":"indigo","accents":"blue","warn":"red","background":"grey"}},"site":{"name":"Node-RED Dashboard","hideToolbar":"false","allowSwipe":"false","lockMenu":"false","allowTempTheme":"true","dateFormat":"DD/MM/YYYY","sizes":{"sx":64,"sy":64,"gx":6,"gy":6,"cx":6,"cy":6,"px":0,"py":0}}},{"id":"ca034400.572178","type":"ui_text","z":"b8cba949.172578","group":"d3f0e284.fc0cf","order":3,"width":0,"height":0,"name":"小鹿回答","label":"小鹿回答:","format":"{{msg.payload}}","layout":"row-left","x":740,"y":1040,"wires":[],"inputLabels":["内容"]},{"id":"b334c2b2.f7cac","type":"http request","z":"b8cba949.172578","name":"图灵对话","method":"POST","ret":"obj","paytoqs":false,"url":"http://openapi.tuling123.com/openapi/api/v2","tls":"","persist":false,"proxy":"","authType":"","x":340,"y":1140,"wires":[["c131929a.b46a","2db96f9e.798a7"]]},{"id":"713631fc.36cb3","type":"json","z":"b8cba949.172578","name":"","property":"payload","action":"obj","pretty":false,"x":510,"y":1040,"wires":[["b334c2b2.f7cac"]]},{"id":"da8c44fd.f72a48","type":"inject","z":"b8cba949.172578","name":"信息","topic":"信息","payload":"{ \t\"reqType\":0, \"perception\": { \"inputText\": { \"text\": \"text6174\" }, \"inputImage\": { \"url\": \"imageUrl\" }, \"selfInfo\": { \"location\": { \"city\": \"北京\", \"province\": \"北京\", \"street\": \"信息路\" } } }, \"userInfo\": { \"apiKey\": \"06c515993ed74e8e9ae1aa63a80ab9ac\", \"userId\": \"sxs12345678\" } }","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":130,"y":1060,"wires":[["124d0b9a.c926e4"]]},{"id":"c131929a.b46a","type":"debug","z":"b8cba949.172578","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":530,"y":1200,"wires":[]},{"id":"61ab0b78.653c34","type":"ui_button","z":"b8cba949.172578","name":"","group":"d3f0e284.fc0cf","order":12,"width":0,"height":0,"passthru":false,"label":"发送信息","tooltip":"","color":"","bgcolor":"","icon":"","payload":"{ \t\"reqType\":0, \"perception\": { \"inputText\": { \"text\": \"text6174\" }, \"inputImage\": { \"url\": \"imageUrl\" }, \"selfInfo\": { \"location\": { \"city\": \"北京\", \"province\": \"北京\", \"street\": \"信息路\" } } }, \"userInfo\": { \"apiKey\": \"06c515993ed74e8e9ae1aa63a80ab9ac\", \"userId\": \"sxs12345678\" } }","payloadType":"str","topic":"","x":120,"y":1000,"wires":[["124d0b9a.c926e4"]]},{"id":"2db96f9e.798a7","type":"change","z":"b8cba949.172578","name":"返回内容","rules":[{"t":"set","p":"payload","pt":"msg","to":"$lookup($lookup($lookup(payload, \"results\"),\"values\"),\"text\")\t","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":520,"y":1140,"wires":[["dc089b76.209778","ca034400.572178"]]},{"id":"dc089b76.209778","type":"debug","z":"b8cba949.172578","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":730,"y":1140,"wires":[]},{"id":"124d0b9a.c926e4","type":"change","z":"b8cba949.172578","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"text6174","fromt":"str","to":"content","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":350,"y":1040,"wires":[["713631fc.36cb3"]]},{"id":"7673af3d.a49f1","type":"ui_text_input","z":"b8cba949.172578","name":"对话输入","label":"对话输入","tooltip":"","group":"d3f0e284.fc0cf","order":13,"width":0,"height":0,"passthru":true,"mode":"text","delay":"0","topic":"对话输入","x":120,"y":920,"wires":[["15bb209d.d5a61f"]]},{"id":"15bb209d.d5a61f","type":"function","z":"b8cba949.172578","name":"信息处理","func":"var content=flow.get('count');\nflow.set('content',msg.payload);\nmsg.payload='{ \t\"reqType\":0, \"perception\": { \"inputText\": { \"text\": \"text6174\" }, \"inputImage\": { \"url\": \"imageUrl\" }, \"selfInfo\": { \"location\": { \"city\": \"北京\", \"province\": \"北京\", \"street\": \"信息路\" } } }, \"userInfo\": { \"apiKey\": \"06c515993ed74e8e9ae1aa63a80ab9ac\", \"userId\": \"sxs12345678\" } }';\nreturn msg;","outputs":1,"noerr":0,"x":300,"y":920,"wires":[["124d0b9a.c926e4"]]}]
【导入】
可将以上内容在其它机器的Node-red导入
【节点信息】
感谢分享 Node-RED 相关内容
页:
[1]