This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AssociatedDevList表相关问题

Other Parts Discussed in Thread: CC2530

1.assocCnt,终端每断电重启一次,会加1,如果加到FF会有什么后果吗?

2.通过timeoutCounter去判断终端是否在线(终端会定期POLL),如果某些终端直接被移走了,

我也不知道他们的地址信息,我该如何在AssociatedDevList里删除这些终端的信息以释放空间给新的终端加入?

  • 1、满了以后其他终端会加不进,所以要避免同一终端反复入网,或者定期清一下关联表
    2、可以通过AssocRemove()删除,参考:e2echina.ti.com/.../385616
  • 你如果不用Stack 自带的Childaging,你就需要自己做心跳包的逻辑,超时收不到心跳包就去移除。
  • byte AssocRemove( byte *extAddr );
    extAddr这个地址我不知道啊,不知道这个地址的话怎么删除以及离线或者以及损坏的终端
  • 问题来了?你地址都不知到你怎么确定设备不在线,所以如上所述尽量不要自己搞用childaging就行。

    具体去看code:

    // Child aging management default values
    // Values are specified in table of nwk_globals.h module
    //timeoutValue[15]
    //    10, // 0	10 seconds
    //     2, // 1	2 minutes
    //     4, // 2	4 minutes
    //     8, // 3	8 minutes
    //    16, // 4	16 minutes
    //    32, // 5	32 minutes
    //    64, // 6	64 minutes
    //   128, // 7	128 minutes
    //   256, // 8	256 minutes
    //   512, // 9	512 minutes
    //  1024, // 10	1024 minutes
    //  2048, // 11	2048 minutes
    //  4096, // 12	4096 minutes
    //  8192, // 13	8192 minutes
    // 16384 // 14	16384 minutes
    //
    // This value is used by the parent ROUTER
    #if !defined ( NWK_END_DEV_TIMEOUT_DEFAULT )
      #define NWK_END_DEV_TIMEOUT_DEFAULT  8    // Default value per ZigBee core specification is 8
    #endif
       
       
    //Timeout after which an EndDevice will be removed from from the indirect MAC messages queue
       // NOTE: End devices which poll rate is slower than this will not receive the leave request
    #if !defined ( NWK_END_DEVICE_LEAVE_TIMEOUT )   
      #define NWK_END_DEVICE_LEAVE_TIMEOUT 9  
    #endif
    
    // Value used by END DEVICE when sending End Device Timeout Request
    // This is an index into table timeoutValue[] defined in nwk_globals.c
    #if !defined ( END_DEV_TIMEOUT_VALUE )
      #define END_DEV_TIMEOUT_VALUE   8   // Default value per ZigBee core specification is 8
    #endif
    
    // Value used by END DEVICE when sending End Device Timeout Request
    #if !defined ( END_DEV_CONFIGURATION )
      #define END_DEV_CONFIGURATION   0     // Per ZigBee Core spec R21, 0 is the only valid value
    #endif

    当然你自己可以搞一个逻辑。

  • 我的思路是:
    需要删除离线终端的时候,把AssociatedDevList查询一遍,
    对非0xFFFF的表,我再判断timeoutCounter,如果一段时间一直没有恢复到初始值,
    我就把该终端删了,所以在这里可以看到终端的短地址,但是extAddr这个地址怎么看?
    我们上面的思路可有问题?
  • 可以先通过段地址来获取关联表里的设备

    associated_devices_t *AssocGetWithAddress( byte *extAddr, uint16 shortAddr )

    但是感觉你要做无用功,这个设备管理客户不用操作的,你可以设置时间长短。
  • 终端一定时间没和协调器通信,协调器会把该终端放到NotmyChild里,
    在NotmyChild里再倒计时,如果还是没有通信,就会把该终端删了
    1.NotmyChild的counter时间是多长时间?哪里设置?
    2.双方都开启NV,如果终端断电了,过了几天才修复,那么该终端就要重新恢复出厂再入网?
    3.掉线问题,仿真发现,终端刚入网的时候AssociatedDevList[].devStatus为0x08,但是过一会就变为了0x68,
    此时该终端就会出现每各几分钟就掉线重连问题,每次重连assocCnt就会加1,但是不掉线的终端一直是0x08,
    不明白为什么变为0x68,变了之后为什么又经常掉线?
  • 终端一定时间没和协调器通信,协调器会把该终端放到NotmyChild里,
    在NotmyChild里再倒计时,如果还是没有通信,就会把该终端删了
    1.NotmyChild的counter时间是多长时间?哪里设置?
    2.双方都开启NV,如果终端断电了,过了几天才修复,那么该终端就要重新恢复出厂再入网?
    3.掉线问题,仿真发现,终端刚入网的时候AssociatedDevList[].devStatus为0x08,但是过一会就变为了0x68,
    此时该终端就会出现每各几分钟就掉线重连问题,每次重连assocCnt就会加1,但是不掉线的终端一直是0x08,
    不明白为什么变为0x68,变了之后为什么又经常掉线?
  • 你有看我让你看的那部分code吗,那里面写的清楚各种timeout。你第三个问题请你抓包看看,或者换个设备,我认为有可能是你硬件问题。
  • CC2530终端模块的链接如下:

    PCB天线,4DB

    https://item.taobao.com/item.htm?spm=a230r.1.14.54.41757d3cmpE567&id=538155647949&ns=1&abbucket=10#detail

    抓包如下“”:

    抓包1517.psd

  • 我测试了一下,之前终端数量为20个,现在关了10个,基本上就不会掉线了,
    怀疑是不是终端和协调器直接数据交互太频繁导致协调器没有响应,
    所有终端就频繁的掉线重新?协调器和终端之间除了控制的时候会有命令,
    正常情况下是不发数据的,现在是不控制的时候就频繁掉线

    下面是参数
    /****************************************
    * The following are for End Devices only
    ***************************************/

    -DRFD_RCVC_ALWAYS_ON=TRUE

    /* The number of milliseconds to wait between data request polls to the coordinator.(默认1000) */
    -DPOLL_RATE=3000

    /* This is used after receiving a data indication to poll immediately
    * for queued messages...in milliseconds.(默认100)
    */
    -DQUEUED_POLL_RATE=1000

    /* This is used after receiving a data confirmation to poll immediately
    * for response messages...in milliseconds(默认100)
    */
    -DRESPONSE_POLL_RATE=1000

    /* This is used as an alternate response poll rate only for rejoin request.
    * This rate is determined by the response time of the parent that the device
    * is trying to join.(默认440)
    */
    -DREJOIN_POLL_RATE=1000

    /* Rejoin retry backoff silent period timer duration in milliseconds - default 15 minutes according to HA test spec */
    -DREJOIN_BACKOFF=60000

    /* Rejoin retry backoff scan timer duration in milliseconds - default 15 minutes according to HA test spec */
    -DREJOIN_SCAN=60000

    /* Latest sample apps use LED4 and do not use S1 switch (默认-DENABLE_LED4_DISABLE_S1)*/
  • 既然你选择使用-DRFD_RCVC_ALWAYS_ON=TRUE 不如用router,此外打上补丁看看:
    processors.wiki.ti.com/.../Zigbee_Known_Issues_and_Proposed_Fixes