博 主
进入zhiganglet的首页
博客名称:ZigBee学习笔记
日志总数:84
评论数量:117
访问次数:70305
建立时间:2008年3月24日
导 航
首页(84)
ZigBee学习笔记(9)
C51学习(2)
VC/C++(1)
在路上--励志人生(5)
ARM嵌入式系统(1)
论坛新帖
日 历
«July 2009»
1234
567891011
12131415161718
19202122232425
262728293031
公 告
记录成长的脚印,分享失败、成功的智慧。( 大部分日志转自网络,如有侵权,即删。)
日 志
·深入浅出畅谈Zigbee 一...
·MCS-51单片机地址指针及其应...
·C51单片机内存优化--转
·X光信息收集
·对52RD博客很失望
·嵌入式学习网站推荐
·无线系统设计的关键步骤
·我不相信做技术没有未来!(...
·some problems abo...
·ZigBee近况
评 论
zigbee369深圳无线谷早改名为深圳无线龙了··我们无线...(6-18)
52RD网友请问深圳无线谷公司提供的C51RF-3-CC2430无线...(5-21)
52RD网友very good!我看完后,感觉他讲的非常清...(4-23)
fjxsos(游客) 不错...(4-9)
风中的鹰(游客)平凡的不平凡!一个公司能长久就是看组成之基-...(3-27)
52RD网友平凡的不平凡!一个公司能长久就是看组成之基-...(3-27)
52RD网友marked by 007slm(1-3)
52RD网友谢谢了。我到处找这个东西(不想为了这些去买99...(12-30)
wuqi8有参考价值。  (12-20)
kingrain提到就改进(12-17)
链 接
[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.

 阅读全文(637) | 回复(1)


评 论
 1楼 52RD网友(游客) 发表于 2009-4-23 11:31:00
  very good!我看完后,感觉他讲的非常清楚,好像国内很少有这样的帖子 这几篇英文我转载了 谢谢
9 1 :

发表评论
昵 称: 匿名
验证码: 1226