LoraWan 的第一个网关与设备

LoraWan 数据走向
可以先看一下下面的数据图

从节点到网关是通过无线传输,也就是 lora 协议。LoraWan 网关接收到数据后将其转化为网络数据通过 MQTT/UDP 发送给服务器。
本文使用 ChirpStack 演示。
开始配置
创建 NS
登陆到 dashboard 后首先创建一个 network-server,由于我已经创建过,因此显示了已经存在的数据。

会切换到新增 ns 的页面

如果是 docker-compose 部署的则填写chirpstack-network-server:8000
,如果修改了 NS 的端口,这里的 8000 端口也需要修改。
创建 service-profile

名称可随意填写,network-server 的填写是一个下拉列表,会显示刚才创建的 NS,只填写两个带*
的必填项就可以了,填写完后点击右下角按钮提交。
创建 device-profile


这个页面主要的信息是LoRaWAN MAC version
这个字段
创建完后在 device-profile 的列表点击进入刚才创建的 device-profile,需要更新一下内容,允许 OTAA 功能。


如果你需要 classB 则可以点击右边 classB 的选项,勾上即可,classC 同理。
到目前为止配置的内容基本上已经完成了,接下来就是添加网关和设备了。
添加网关信息

主要的信息就是网关 ID 以及 network-server profile

网关的 ID 以瑞科的网关为例

如果没有找到网关 ID 找相关的网关产品的技术支持
帮忙即可。 接下来开始添加设备。
创建应用
在添加设备之前需要创建应用,而设备是放在应用之下的,这样做的原因主要是用来对设备进行分类。比如 A 类型的传感器放在一个应用下,B 类型的传感器放在另一个应用下。亦或者是根据场地进行分类,总而言之,应用是ChirpStack
设计用来对数据的隔离的,这是ChirpStack
的概念,不属于LoraWan
的范畴。


创建完必填的内容后点击右下角按钮确认创建。
然后在应用列表就可以看到刚才创建的应用了,点击应用名称
进去,开始创建设备。

添加设备

依然是填写完必填项后点击右下角按钮确认添加。

重要的是devEUI
,这是lora模块
上的 ID,务必填写正确。
填写完后会跳转到设备信息页面,继续填写APPKEY

填写完成后点击右下角按钮确认。
到目前为止网关和设备都添加完了,只需要在网关配置一下数据上传的内容,将网关接收到的数据上传到LoraWan Server
就可以了。(网关配置内容具体情况找网关产品技术支持帮忙
)
设备的信息中有一个DEVICE DATA
,可以在LoraWan Server
上查看设备上传到服务器的数据。
注意:设备没有数据时不会显示内容.


到目前为止数据都走通了,从设备发送数据到网关,网关将数据上传到服务器,服务器查看到数据。
关注公众号:四颗咖啡豆,第一时间获取更新

版权声明: 本文为 InfoQ 作者【LanLiang】的原创文章。
原文链接:【http://xie.infoq.cn/article/b06a26986dd14b5b5e5c3ffb1】。文章转载请联系作者。
评论