You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
82 lines
2.2 KiB
82 lines
2.2 KiB
3 years ago
|
## Node-Red
|
||
|
|
||
|
https://nodered.org/
|
||
|
|
||
|
`Node-Red`是基于Nodejs的轻量级事件驱动引擎。可以运行在低配置的网络边缘硬件上,例如树莓派。
|
||
|
|
||
|
<img src="imgs/边缘网关NodeRed应用/image-20211102100042605.png" width="600"/>
|
||
|
|
||
|
[容器启动](https://nodered.org/docs/getting-started/docker)
|
||
|
|
||
|
```sh
|
||
|
docker run -it -p 1880:1880 -v node_red_data:/data --name mynodered nodered/node-red
|
||
|
```
|
||
|
|
||
|
访问 http://10.8.30.37:1880/
|
||
|
|
||
|
第一个流的例子:
|
||
|
|
||
|
<img src="imgs/边缘网关NodeRed应用/image-20211102102818859.png" width="600"/>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
## 边缘网关中的应用
|
||
|
|
||
|
安装mqtt代理mosquitto
|
||
|
|
||
|
ubuntu上安装:
|
||
|
|
||
|
```sh
|
||
|
1. 安装启动mqtt代理服务
|
||
|
服务器上安装 mosquito:
|
||
|
apt-get install mosquitto
|
||
|
启动代理:
|
||
|
mosquitto -d
|
||
|
|
||
|
p.s. mosquito默认启用1883端口,如需设置其他端口,使用 –p参数(更多参数 查看 mosquito help)
|
||
|
```
|
||
|
|
||
|
|
||
|
|
||
|
`mosquitto.conf`
|
||
|
|
||
|
```conf
|
||
|
persistence true
|
||
|
persistence_location /mosquitto/data/
|
||
|
log_dest file /mosquitto/log/mosquitto.log
|
||
|
listener 1883 0.0.0.0
|
||
|
```
|
||
|
|
||
|
```sh
|
||
|
$ docker run -it -p 1886:1883 -p 9001:9001 -v mosquitto.conf:/mosquitto/config/mosquitto.conf -v /mosquitto/data -v /mosquitto/log eclipse-mosquitto
|
||
|
```
|
||
|
|
||
|
|
||
|
|
||
|
## 云边协同的初步设计
|
||
|
|
||
|
基于以太Thing为单位,可以将配置下发到边缘进行配置和采集(一个边缘网关可以绑定多个thing)。
|
||
|
|
||
|
Thing下如果包含振动设备,需要将振动设备的配置提取和映射到go-daas匹配的格式,启动daas进行采集和上报。
|
||
|
|
||
|
云端应该能够进行配置下发和查看同步的状态。
|
||
|
|
||
|
*边缘上可以进行相关采集配置(离线配置),并根据配置内容上报云端。如果出现冲突状态,需要人为介入进行解决。
|
||
|
|
||
|
*平台产品原型、协议的更改,不会触发边缘配置的同步,会造成上下配置不统一的问题;
|
||
|
|
||
|
|
||
|
|
||
|
## 附
|
||
|
|
||
|
发现一家做智能楼宇的物联网公司Go-IoT。https://www.go-iot.io/dingo
|
||
|
|
||
|
![image-20211102101046721](imgs/边缘网关NodeRed应用/image-20211102101046721.png)
|
||
|
|
||
|
|
||
|
|
||
|
![image-20211102101658396](imgs/边缘网关NodeRed应用/image-20211102101658396.png)
|
||
|
|
||
|
![image-20211102101831138](imgs/边缘网关NodeRed应用/image-20211102101831138.png)
|