目前使用Z-Stack未解决的一些问题
2013-10-08 16:56
387 查看
1. 终端子节点丢失后,路由父节点无法察知。这个问题将导致终端设备为设置NV_RESTORE的情况下反复入网,占用关联表。
思路:上一篇文章已经讲了收到来自子节点OTA消息视为有效,目前工程中ED不定时发起消息,所以该方法不太适用。最笨的办法是ED定时发一个DUMMY帧,在应用层(或在OS中添加一个TASK)来检索关联表,长时间未发送DUMMY的ED设备则视为丢失。
问题:考虑使用较低开销,若终端设备POLL RATE不为0的话,比较好的办法是通过POLL请求的源地址检索关联表进行标志,如关联表内设备长时间未发送POLL请求则视为丢失。问题在于使用POLL关键字对Z-STACK代码进行检索,仅列出ED端的POLL REQ及POLL RATE函数,未找到RTR端POLL REQ的处理代码。
2. MAX_POLL_FAILURE_RETRIES后,终端设备不能够重新加入网络。
思路:按照Z-STACK Developer's Guide所述,终端成为孤儿节点后将调用ZDO_SynIndicationCB()函数重新入网。实际代码中未找到ZDO_SynIndicationCB()被调用。目前工程也对孤儿节点进行了处理,不过是在sapi层调用restart函数。目前考虑使用ZDO_SynIndicationCB()替换restart()进行测试。
3. E2E上的一段问答:
Q:
I was working on a locating project. To slove parent address overflow issue, I disabled both router and end-device's NV_RESTORE option and made end-devices to send LEAVE request to its parent once the locating result data had been sent. Then the end-device
will reset itself. The parent node should remove the child from its association list at same time. Next round, the end-device will join network as new node to do next locating task.
It seems woking fine with less nodes quantity. Unfortunately, when apply this to a high amount router and end-devices in a work floor environment(100 routers and 50 end-devices), There're too many conflict in the air. too many beacon request and response.
too may route boardcast. Sometimes the LEAVE request cannot to process well. It causes the child address cannot be removed from parent's association list, so parent's children capacity went full (14 end-devices by default). The result is end device cannot
join network at all. To solve this, what I only can do: just reboot all routers to let them to "forget" their children.
My idea is let parent node to clean its child association list without reboot when it's association list goes full. I don't know what the correct way is to remove all end-device children without affecting to its router children. Please help. Code sample
will be highly appreciated.
A:
Below is some code I use to flush stale children that you can pick the bones out of if you want. It seems to work and I've not discovered any side effects(yet).
The childDevList[] is a structure I maintain to determin if the child is stale. You will want to devise your test for this.
Cheers.
static void FlushStaleNodes(void) {
for (uint8 x=0;x<NWK_MAX_DEVICES;x++) {
byte nr = AssociatedDevList[x].nodeRelation;
if (nr == CHILD_RFD || nr == CHILD_RFD_RX_IDLE || nr == CHILD_FFD || nr == CHILD_FFD_RX_IDLE) {
if (childDevList[x].isActive && childDevList[x].rxMsgCount == 0) {
childDevList[x].isActive = FALSE;
RemoveStaleNode(x);
}else {
childDevList[x].isActive = TRUE;
}
childDevList[x].rxMsgCount=0;
}
}
}
static void RemoveStaleNode(uint8 index) {
AddrMgrEntry_t addrEntry;
NLME_LeaveReq_t req;
// Set up device info
addrEntry.user = ADDRMGR_USER_DEFAULT;
addrEntry.index = index;
if (AddrMgrEntryGet( &addrEntry )) {
// Remove device
req.extAddr = addrEntry.extAddr;
req.removeChildren = TRUE;
req.rejoin = FALSE;
req.silent = FALSE;
NLME_LeaveReq( &req );
}
}
暂先总结以上问题,等有空再搞搞Z-Stack的代码。
思路:上一篇文章已经讲了收到来自子节点OTA消息视为有效,目前工程中ED不定时发起消息,所以该方法不太适用。最笨的办法是ED定时发一个DUMMY帧,在应用层(或在OS中添加一个TASK)来检索关联表,长时间未发送DUMMY的ED设备则视为丢失。
问题:考虑使用较低开销,若终端设备POLL RATE不为0的话,比较好的办法是通过POLL请求的源地址检索关联表进行标志,如关联表内设备长时间未发送POLL请求则视为丢失。问题在于使用POLL关键字对Z-STACK代码进行检索,仅列出ED端的POLL REQ及POLL RATE函数,未找到RTR端POLL REQ的处理代码。
2. MAX_POLL_FAILURE_RETRIES后,终端设备不能够重新加入网络。
思路:按照Z-STACK Developer's Guide所述,终端成为孤儿节点后将调用ZDO_SynIndicationCB()函数重新入网。实际代码中未找到ZDO_SynIndicationCB()被调用。目前工程也对孤儿节点进行了处理,不过是在sapi层调用restart函数。目前考虑使用ZDO_SynIndicationCB()替换restart()进行测试。
3. E2E上的一段问答:
Q:
I was working on a locating project. To slove parent address overflow issue, I disabled both router and end-device's NV_RESTORE option and made end-devices to send LEAVE request to its parent once the locating result data had been sent. Then the end-device
will reset itself. The parent node should remove the child from its association list at same time. Next round, the end-device will join network as new node to do next locating task.
It seems woking fine with less nodes quantity. Unfortunately, when apply this to a high amount router and end-devices in a work floor environment(100 routers and 50 end-devices), There're too many conflict in the air. too many beacon request and response.
too may route boardcast. Sometimes the LEAVE request cannot to process well. It causes the child address cannot be removed from parent's association list, so parent's children capacity went full (14 end-devices by default). The result is end device cannot
join network at all. To solve this, what I only can do: just reboot all routers to let them to "forget" their children.
My idea is let parent node to clean its child association list without reboot when it's association list goes full. I don't know what the correct way is to remove all end-device children without affecting to its router children. Please help. Code sample
will be highly appreciated.
A:
Below is some code I use to flush stale children that you can pick the bones out of if you want. It seems to work and I've not discovered any side effects(yet).
The childDevList[] is a structure I maintain to determin if the child is stale. You will want to devise your test for this.
Cheers.
static void FlushStaleNodes(void) {
for (uint8 x=0;x<NWK_MAX_DEVICES;x++) {
byte nr = AssociatedDevList[x].nodeRelation;
if (nr == CHILD_RFD || nr == CHILD_RFD_RX_IDLE || nr == CHILD_FFD || nr == CHILD_FFD_RX_IDLE) {
if (childDevList[x].isActive && childDevList[x].rxMsgCount == 0) {
childDevList[x].isActive = FALSE;
RemoveStaleNode(x);
}else {
childDevList[x].isActive = TRUE;
}
childDevList[x].rxMsgCount=0;
}
}
}
static void RemoveStaleNode(uint8 index) {
AddrMgrEntry_t addrEntry;
NLME_LeaveReq_t req;
// Set up device info
addrEntry.user = ADDRMGR_USER_DEFAULT;
addrEntry.index = index;
if (AddrMgrEntryGet( &addrEntry )) {
// Remove device
req.extAddr = addrEntry.extAddr;
req.removeChildren = TRUE;
req.rejoin = FALSE;
req.silent = FALSE;
NLME_LeaveReq( &req );
}
}
暂先总结以上问题,等有空再搞搞Z-Stack的代码。
相关文章推荐
- tcpdump抓包,然后使用tcpreplay进行回放,出现了一些问题,目前找不到答案,暂时先记录在这里
- TCMalloc的使用与源码剖析之九---------一些未解决的问题
- 在使用AndroidSwipeLayout发现的一些问题
- 【汇总】iOS开发及Xcode使用中遇到的一些报错问题汇总
- 关于jquery.AutoComplete插件的一些使用心得(编码问题,效率问题)
- 使用Entity Framework时要注意的一些性能问题
- MongoDB使用过程中的一些问题
- 使用spring boot+logback的一些编码问题整理
- reportviewer使用中的一些问题(转载)
- leetcode-cli的安装与使用以及未解决的问题
- [记录]在Linux中Oracle安装成功后,首次启动使用时,会出现的一些问题总结和解决办法
- 使用R做随机森林分类时遇到的一些基本问题
- 在使用oracle中遇到的一些问题
- Ionic3学习笔记(十四)使用 videogular2 实现视频播放以及遇到的一些问题
- Qt5中创建及使用自定义插件遇到的一些问题
- Pycharm使用的一些问题!!!
- maven使用过程中遇到过的一些问题,或者疑问.
- 使用Struts2标签时的一些问题
- 在使用WSAAsyncSelect中的搜集到的一些资料以及发现的一些问题
- 使用数组时注意的一些问题