树莓派3b Node-red dashboard 第一个测试程序

代码:

[{
	"id": "15d4e229.de9d2e",
	"type": "function",
	"z": "e3aca2b9.00ea7",
	"name": "temperature",
	"func": "str=msg.payload;\nmsg.payload=str.substring(5,9);\nreturn msg;",
	"outputs": 1,
	"noerr": 0,
	"x": 470,
	"y": 296.5,
	"wires": [
		["7a0ba386.d5fc24"]
	]
}, {
	"id": "7a0ba386.d5fc24",
	"type": "ui_gauge",
	"z": "e3aca2b9.00ea7",
	"name": "",
	"group": "d6ccf1c9.b74398",
	"order": 0,
	"width": 0,
	"height": 0,
	"gtype": "gage",
	"title": "CPU. Temp",
	"label": "℃",
	"format": "{{value}}",
	"min": 0,
	"max": "80",
	"colors": ["#00b500", "#e6e600", "#ca3838"],
	"seg1": "",
	"seg2": "",
	"x": 679,
	"y": 333.5,
	"wires": []
}, {
	"id": "bf50d228.72e178",
	"type": "inject",
	"z": "e3aca2b9.00ea7",
	"name": "",
	"topic": "",
	"payload": "",
	"payloadType": "date",
	"repeat": "1",
	"crontab": "",
	"once": false,
	"onceDelay": 0.1,
	"x": 104,
	"y": 305.5,
	"wires": [
		["db3ed94d.c4bdb"]
	]
}, {
	"id": "db3ed94d.c4bdb",
	"type": "exec",
	"z": "e3aca2b9.00ea7",
	"command": "vcgencmd measure_temp",
	"addpay": false,
	"append": "",
	"useSpawn": "false",
	"timer": "",
	"oldrc": false,
	"name": "temp",
	"x": 255,
	"y": 312,
	"wires": [
		["15d4e229.de9d2e"],
		[],
		[]
	]
}, {
	"id": "d6ccf1c9.b74398",
	"type": "ui_group",
	"z": "",
	"name": "tem",
	"tab": "8d45c1ce.10593",
	"disp": true,
	"width": "6",
	"collapse": false
}, {
	"id": "8d45c1ce.10593",
	"type": "ui_tab",
	"z": "",
	"name": "Temp",
	"icon": "dashboard"
}]

导入代码过程:

浏览器输入:http://172.16.0.12:1880

IP请根据你自己服务器的IP填写

点击node-red页面右上菜单(红色圈圈),如图:

在弹出的菜单中选择"导入"

粘贴本文上面的代码到下图红框处

粘贴好后点击页面右下角的"导入"按钮即可生成如下"流程图"

在chrome浏览器新建标签页,然后地址栏输入

http://172.16.0.12:1880/ui

显示效果如图

程序保存就是"导出" .

本文程序参考了https://blog.csdn.net/hu5566798/article/details/81058485的代码,在此表示感谢!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

armcsdn

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值