在上一篇文章里,我们介绍了LoRaWAN 节点和网关如何接入自己搭建的LoRaServer。这一篇讲的是节点和网关接入阿里LinkWAN平台。
网上有一些文章介绍是接入物联网平台https://iot.console.aliyun.com/,实际上现有平台已经做了更改,接入方式不再包含LoRa,而且物联网平台里的Topic和LoRaWAN Gateway SDK对比,并不一样,LinkWAN里的Topic则是一致的。
首先在linkwan注册 https://linkwan.console.aliyun.com/
节点、网关各一。
这里节点和网关还是https://blog.csdn.net/quending/article/details/86481598提到的一样,只是网关需要运行SDK【https://iot.console.aliyun.com/quick_start 选择SDK下载编译到网关里】,在此不展开了。
在管理控制台-物联网网络管理平台-认证实验室-设备调试下面申请网关和节点。
这一步较简单,截图如下:
修改网关EUI和三元组。运行mqtt和lora_pkt_fwd。
修改节点EUI和APPKEY。
由于手里现有的节点暂时不能修改EUI,现在不能入网成功了,需要找厂家要设置EUI接口。
先调试网关吧。
启动网关后,看到了该网关的设备信息。
这是网关的日志:
INFO: thread_gwmp_msg_uplink|837 :: received gwmp msg len: 12
INFO: publish_gwmp_msg_uplink|359 :: publish mqtt gwmp msg len: 12
INFO: event_handle|157 :: publish success, packet-id=140 checkCnt=130
INFO: callback_gwconfig_get|548 :: received mqtt msg: get
INFO: Received pkt from mote: 21729075 (fcnt=14267)
INFO: [filter] white list join filter is not enable
INFO: [filter] black list join filter is not enable
[up] gps_ref_valid:0,utc_ref_valid:0,lora_ref_valid:0
JSON up: {"rxpk":[{"tmst":627941044,"chan":5,"rfch":0,"freq":486.500000,"stat":1,"modu":"LORA","datr":"SF12BW125","codr":"4/5","lsnr":6.8,"rssi":-89,"size":23,"data":"AHWQciEcuzeVirwK1BGwp51vvltU2xo="}]}
INFO: thread_gwmp_msg_uplink|837 :: received gwmp msg len: 206
INFO: publish_gwmp_msg_uplink|357 :: publish mqtt gwmp msg: {"rxpk":[{"tmst":627941044,"chan":5,"rfch":0,"freq":486.500000,"stat":1,"modu":"LORA","datr":"SF12BW125","codr":"4/5","lsnr":6.8,"rssi":-89,"size":23,"data":"AHWQciEcuzeVirwK1BGwp51vvltU2xo="}]}, len: 206
INFO: event_handle|157 :: publish success, packet-id=141 checkCnt=131
INFO: thread_gwmp_msg_uplink|837 :: received gwmp msg len: 12
INFO: publish_gwmp_msg_uplink|359 :: publish mqtt gwmp msg len: 12
INFO: event_handle|157 :: publish success, packet-id=142 checkCnt=132
可以看到节点一直在尝试OTAA入网(fcnt=14267)。
节点虽然没有入网,也看到了节点调试选项很丰富,界面比较友好。例如发送MAC指令,直接在json里填入内容即可自动组帧发送,确实比较方便。