您的位置:首页 > 其它

目前使用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的代码。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: