原创 some problems about Z-stack

2010-6-5 15:56 4458 1 1 分类: 通信
[ZigBee学习笔记]some problems about Z-stack
 Rcikli 发表于 2008-10-29 16:47:00




 

some problems about Z-stack






Hi, i am learning the SimpleApp, one of the examples from Z-stack, but i encountered some problems. i could understand how the messages flow on a device, but the LEDs on CC2430DB confuse me. i don't why they blinks, and which part of program controls them! In the sensor data collection application, i could see that afer joining the network successfully LED2(red) will blink fastly, and after binding with the coordinator LED1(Green) will blink fastly. but the source code in file simpleSensor.c only showes that function myApp_StartReporting() will set LED1 on after binding. why dose it blink quickly? could anybody give me a reason?  or please tell me how to find the program which controls the LEDs blinking if you can! thanks a lot!


 



 Hi Dasheng,


An excellent way of understadning Z-Stack sample application would be to monitor the packet exchange between nodes using our packet sniffer.  The toggle is due to the SAPI_ReceiveDataIndication which is called everytime you receive a message,  AF_INCOMING_MSG_CMD in the ProcessEvent loop of SAPI. This function calls again the  zb_ReceiveDataIndication(..) and in here if you receive the toggle message cluster you will toggle the LED. 


void zb_ReceiveDataIndication( uint16 source, uint16 command, uint16 len, uint8 *pData  )
{
  if (command == TOGGLE_LIGHT_CMD_ID)
  {
    // Received application command to toggle the LED
    HalLedSet(HAL_LED_1, HAL_LED_MODE_TOGGLE);
  }
}



 

 

 



Hi LPRF_Rocks,


My former problem has been resolved. I found that there is a denfination of POWER_SAVING in IAR's compile option so that LED1 will be blinking instead of always on. There is a explination in document " Simple API for Z-Stack " for this phenomena. If I delete POWER_SAVING then LED1 will be turned on and always be on after the sensor node has binded with collector node successfully. 


But now i encounter another problem which is the same problem that ahmad  had already asked. when i use the collector node to collect information from five sensor nodes,  i find that two sensor nodes are assigned with the same short network address, which may be 0x7972, 0x7970, or 0x796f. the same problem will appear even if i only use four sensor nodes. i found this problem from the HyperTerminal on my PC which can receive the informtion sent by collector through serial port. when I use a CC2430DB as packet sniffer to watch the data pakets over the air, i found that some  sensor nodes were really assigned with identical short address. My Z-stack version is ZStack-1.4.3-1.2.1, and my hardware platform is CC2430ZDK. So can you give me some adveices on how to resolve this problem? thanks a lot!  


 

 

 



Hi ahmad,


 I suddendly know the reason of our problem when i try to check the IEEE address of each sensor node. I encountered  the same problem as yours in this morning,  and i was confused too. But just now i suspect that the reason may be  their IEEE addresses are identical, so i use SmartRF Flash Programmer to check each node's IEEE address, and i found that i am right. Two nodes' IEEE address were both 27 26 25 24 23 22 00 00, so when they join the network they will get the same short address. And this IEEE address is assigned by function zmain_ext_addr(), which use the following sentence to get a random number and assign this random number to the lower two bytes of the IEEE address.


AtoD = HalAdcRead (HAL_ADC_CHANNEL_7, HAL_ADC_RESOLUTION_10);


Unfortunately, the randomness of upper function is limited. So sometimes two or more nodes will get the same IEEE address. if you give each node a different IEEE address by SmartRF Flash Programmer or some other tools, then the problem will not appear again.


文章评论0条评论)

登录后参与讨论
相关推荐阅读
zhiganglet_333973054 2011-09-20 13:46
尚普咨询:我国医械行业四大发展趋势
出处http://news.hc3i.cn/art/201108/15454.htm     医疗器械行业作为高新技术最具发展潜力的产业之一,近年来,随着我国新医改投入、人口老龄化和健康保健服务重视程...
zhiganglet_333973054 2011-09-20 13:44
国内医疗器械企业发力高端市场
出处http://news.hc3i.cn/art/201109/15685.htm   我国市场近年来迅猛发展,规模已达到1000亿元,不过,全球市场规模却早已超过3000亿美元,为国内市场的20倍...
zhiganglet_333973054 2011-09-20 13:41
无线定位技术在医院中的应用
转自http://news.hc3i.cn/art/201109/15751.htm   【HC3i报道】如今,移动临床已成为医院无线网络应用的最重要的组成部分,很多医院在无线网络应用方面都是以临床为...
zhiganglet_333973054 2010-07-30 13:27
SDRAM工作原理和S3C2410 SDRAM扩展控制器配置方法(转)
 原帖:http://hi.baidu.com/www100/blog/item/38c5a9ef56323e1cfdfa3c53.html       SDRAM的工作原理、控制时序、及相关控制器...
zhiganglet_333973054 2010-07-30 13:25
S3C2410存储器扩展(1)——SDRAM
       由于S3C2410是32位处理器(指令一次能够操作32位数据(运算器一次可以处理32位数据);通用寄存器多是32位寄存器;处理器内部数据通道也是32位的;处理器外部数据总线宽度通常是3...
zhiganglet_333973054 2010-07-29 13:28
港剧经典台词
外景:深圳某一市场猪肉摊前。某女甲:你以为你匿喺度就揾唔到你咩?冇用架!你啲咁出色嘅难忍(男人),无论喺边度,都好似漆黑中嘅萤火虫一样,咁鲜明,咁出众。你忧郁嘅眼神,唏嘘嘅须根,神乎其技嘅刀法,同埋嗰...
我要评论
0
1
1
2
3
4
5
6
7
8
9
0
关闭 热点推荐上一条 /2 下一条