关于Zstack2.5.1 EndDevice或Router自动重发问题

各位大神好!近日我基于Zstack2.5.1的Simple Application Interface例程做了个EndDevice(ZED)定时上报传感器数据的工具。




ZR1,ZED1,ZED2 (直连ZC)


ZR2,ZED3 , ZED4 , ZED5 (经ZR1连接ZC)


ZED6,ZED7,ZED8 (先经ZR2,在经ZR1连接ZC)


1. ZC偶尔会收到连续2条或3条间隔约10-30ms的重复数据(ZED1~8都有出现过,但似乎经Router会频繁点),经分析是z-stack自动重发的数据,而非AF_DataRequest被重复调用所致。


2. 与问题1类似,但重发间隔变为约6s左右,经分析同样也是z-stack自动重发。


3. ZR1与ZR2有时会自动交换位置,是什么原因造成的?


* f8wConfig.cfg
* Compiler command-line options used to define a TI Z-Stack ZigBee device.
* To move an option from here to the project file, comment out or delete the
* option from this file and enter it into the "Define Symbols" box under the
* Preprocessor tab of the C/C++ Compiler Project Options. New user defined
* options may be added to this file, as necessary.
* Each macro is prefixed with '-D'. The entries are to be constructed as if
* they are to be on the compiler command line invocation (which they are).
* NOTE: The RHS (Right-Hand-Side) must be quoted if there are embedded blanks.
* See the DEFAULT_KEY definition for an example.

/* Enable ZigBee-Pro */

/* Set to 0 for no security, otherwise non-0 */

/* Enable the Reflector */

/* Default channel is Channel 11 – 0x0B */
// Channels are defined in the following:
// 0 : 868 MHz 0x00000001
// 1 – 10 : 915 MHz 0x000007FE
// 11 – 26 : 2.4 GHz 0x07FFF800
//-DMAX_CHANNELS_868MHZ 0x00000001
//-DMAX_CHANNELS_915MHZ 0x000007FE
-DDEFAULT_CHANLIST=0x04000000 // 26 – 0x1A
//-DDEFAULT_CHANLIST=0x02000000 // 25 – 0x19
//-DDEFAULT_CHANLIST=0x01000000 // 24 – 0x18
//-DDEFAULT_CHANLIST=0x00800000 // 23 – 0x17
//-DDEFAULT_CHANLIST=0x00400000 // 22 – 0x16
//-DDEFAULT_CHANLIST=0x00200000 // 21 – 0x15
//-DDEFAULT_CHANLIST=0x00100000 // 20 – 0x14
//-DDEFAULT_CHANLIST=0x00080000 // 19 – 0x13
//-DDEFAULT_CHANLIST=0x00040000 // 18 – 0x12
//-DDEFAULT_CHANLIST=0x00020000 // 17 – 0x11
//-DDEFAULT_CHANLIST=0x00010000 // 16 – 0x10
//-DDEFAULT_CHANLIST=0x00008000 // 15 – 0x0F
//-DDEFAULT_CHANLIST=0x00004000 // 14 – 0x0E
//-DDEFAULT_CHANLIST=0x00002000 // 13 – 0x0D
//-DDEFAULT_CHANLIST=0x00001000 // 12 – 0x0C
//-DDEFAULT_CHANLIST=0x00000800 // 11 – 0x0B

/* Define the default PAN ID.
* Setting this to a value other than 0xFFFF causes
* ZDO_COORD to use this value as its PAN ID and
* Routers and end devices to join PAN with this ID
/* Minimum number of milliseconds to hold off the start of the device
* in the network and the minimum delay between joining cycles.

/* Mask for the random joining delay. This value is masked with
* the return from osal_rand() to get a random delay time for
* each joining cycle. This random value is added to NWK_START_DELAY.
* For example, a value of 0x007F will be a joining delay of 0 to 127
* milliseconds.

/* Minimum number of milliseconds to delay between each beacon request
* in a joining cycle.

/* Mask for the random beacon request delay. This value is masked with the
* return from osal_rand() to get a random delay time for each joining cycle.
* This random value is added to DBEACON_REQUEST_DELAY. For example, a value
* of 0x00FF will be a beacon request delay of 0 to 255 milliseconds.

/* Jitter mask for the link status report timer. This value is masked with the
* return from osal_rand() to add a random delay to _NIB.nwkLinkStatusPeriod.
* For example, a value of 0x007F allows a jitter between 0-127 milliseconds.

/* in seconds; set to 0 to turn off route expiry */

/* This number is used by polled devices, since the spec'd formula
* doesn't work for sleeping end devices. For non-polled devices,
* a formula is used. Value is in 2 milliseconds periods

/* Default indirect message holding timeout value:
* 1-65535 (0 -> 65536) X CNT_RTG_TIMER X RTG_TIMER_INTERVAL

/* The number of simultaneous route discoveries in network */

/* The maximum number of retries allowed after a transmission failure */

/* Max number of times retry looking for the next hop address of a message */

/* Number of times retry to poll parent before indicating loss of synchronization
* with parent. Note that larger value will cause longer delay for the child to
* rejoin the network.

/* The number of items in the broadcast table */

/* The maximum number of groups in the groups table */

/* Number of entries in the regular routing table plus additional
* entries for route repair

/* Maximum number of entries in the Binding table. */

/* Maximum number of cluster IDs for each binding table entry.
* Note that any value other than the default value may cause a
* compilation warning but Device Binding will function correctly.

/* Default security key. */
-DDEFAULT_KEY="{0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F, 0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0D}"

/* Reset when ASSERT occurs, otherwise flash LEDs */

/* Set the MAC MAX Frame Size (802.15.4 default is 102) */

/* Minimum transmissions attempted for Channel Interference detection,
* Frequency Agility can be disabled by setting this parameter to zero.

/* Compiler keywords */
-DCONST="const __code"

* The following are for End Devices only


/* The number of milliseconds to wait between data request polls to the coordinator. */

/* This is used after receiving a data indication to poll immediately
* for queued messages…in milliseconds.

/* This is used after receiving a data confirmation to poll immediately
* for response messages…in milliseconds

/* 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.

Viki Shi:


YiKai Chen:


xiansheng Meng:

回复 Viki Shi:



最后,对於2 我是最困惑的,原则上重发很快会发生,但为何会等了6s才重发呢?有没哪个底层参数是影响这个间隔的?谢谢!

YiKai Chen:

回复 xiansheng Meng:


xiansheng Meng:

回复 YiKai Chen:


xiansheng Meng:

回复 xiansheng Meng:



xiansheng Meng:

回复 YiKai Chen:


YiKai Chen:

回复 xiansheng Meng:


xiansheng Meng:

回复 YiKai Chen:

是的,我截取的就是出现重发附近时刻的数据,并且以下图ZED (0x5ae6)为说明对象的,发生重发是10:58:31和10:58:37.

YiKai Chen:

回复 xiansheng Meng:

我Wireshark看到的packet no.跟time,看起來跟你的不一樣,所以不知道要查哪些封包

未经允许不得转载:TI中文支持网 » 关于Zstack2.5.1 EndDevice或Router自动重发问题
分享到: 更多 (0)