• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Low Power RF & Wireless Connectivity » Low Power RF ZigBee® Software & IEEE 802.15.4 Forum » How to obtain data of PANID and CHANNEL that are being used.
Share
Low Power RF & Wireless Connectivity
  • Forums
  • Announcements
  • Files
  • E2E Wiki
Options
  • Subscribe via RSS

Forums

How to obtain data of PANID and CHANNEL that are being used.

This question is answered
John Xu
Posted by John Xu
on Apr 11 2012 18:17 PM
Prodigy210 points

Hi,

 

I am new to Ti Z-Stack.  I start of writing a simple application:

1.  I set ZCD_NV_PANID to be 0xFFFF, which means dynamically create a PANID.

2.  I set ZCD_NV_CHANLIST to include all channels, which means I want the device to scan all channels to find the best one.

3.  I set ZCD_NV_APS_USE_EXT_PANID to be a valid extended id.

4.  I set ZCD_NV_LOGICAL_TYPE to be coordinator to start the network.

5.  I start the network by calling zb_StartRequest()

6.  Network is started successfully and zb_StartConfirm is called.

Now my question is how can I find out what PANID that the network is using and which Channel it is on??

Thanks

John

Z-Stack zigbee CC2530 Simple API ZigBee project z_stack cc2530 ZStack 2.3.0 SensorDemo CC2530 Z-Stack ZigBee СС2530
Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • YiKai Chen
    Posted by YiKai Chen
    on Apr 11 2012 21:24 PM
    Mastermind9640 points

    Hi John,

    Try to check zgConfigPANID, zgApsUseExtendedPANID, and zgDefaultChannelList after your ZB network is composed.

    Regards!

    YK Chen

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • John Xu
    Posted by John Xu
    on Apr 11 2012 21:41 PM
    Prodigy210 points

    Hi,

    In zb_StartConfirm() function, I checked those values: zgConfigPANID, zgApsUseExtendedPANID, and zgDefaultChannelList.  They are the same values as what I set to NV.

    For example, zgConfigPANID is 0xFFFF, and zgDefaultChannelList is 0x7FFF800.  They do not tell me what channel and PANID the device picks for the network...

    Did I check them in the wrong function? 

    I need to know after CC2530 successfully starts the network, what channel and PANID it picks...

    Please help!

    Thanks

    John

    ZigBee PRO zigbee cc2530zdk ZigBee 2006 ZStack PAN ID ZigBee project z_stack z_stack cc2530 ZStack 2.3.0 SensorDemo Z-Stack 2.3.0 CC2530 СС2530
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • YiKai Chen
    Posted by YiKai Chen
    on Apr 11 2012 22:18 PM
    Mastermind9640 points

    Hi John,

    You should check it after you receive ZDO_STATE_CHANGE and ( (XXX_NwkState == DEV_ZB_COORD) || (XXX_NwkState == DEV_ROUTER) || (XXX_NwkState == DEV_END_DEVICE) ) inside zclXXX_event_loop(), which should be located in your zcl_XXX.c.

    Regards!

    YK Chen

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • John Xu
    Posted by John Xu
    on Apr 11 2012 23:18 PM
    Prodigy210 points

    Hi YK,

    That is what I did.  My application is based on Sensor Demo applicaton.  zb_StartConfirm() is called when ZDO_STATE_CHANGE and iif(pMsg->status == DEV_END_DEVICE || pMsg->status == DEV_ROUTER || pMsg->status == DEV_ZB_COORD ) is TRUE. 

    As I mentioned, in zb_StartConfirm() I check zgConfigPANID, zgApsUseExtendedPANID, and zgDefaultChannelList.  And they are the same value as what I initially set.  They do not have the values to indicate which PANID and channel is picked by the stack...

    However, I did find out that global variable _NIB contains the correct information.  But I wonder should I directly check _NIB structure in zb_StartConfirm()???  And I cannot find any code that modifies the variable, but it does get updated....  Wonder where is the code that updates the variable???

    In addition, ZCD_NV_NIB does not contain all the data of _NIB, wonder why is that???

    Thanks

    John 

    ZigBee PRO zigbee cc2530zdk ZigBee 2006 ZStack PAN ID ZigBee project z_stack z_stack cc2530 ZStack 2.3.0 SensorDemo Z-Stack 2.3.0 CC2530 СС2530
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • YiKai Chen
    Posted by YiKai Chen
    on Apr 12 2012 00:13 AM
    Mastermind9640 points

    Hi John,

    Yes, you can read these information from _NIB. By the way, ZCD_NV_NIB only stores the short address of device and I also have no idea why TI only stores short address.

    Regards!

    YK Chen

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • John Xu
    Posted by John Xu
    on Apr 12 2012 00:50 AM
    Prodigy210 points

    Actually I am still confused...

    After the network is started, does "nwkLogicalChannel" in _NIB have the value that is the channel picked by Z-Stack?

    What is "channelList" in _NIB?  After the network is started, why does it have a different value (i.e. 0x00300000) than the one I saved to ZCD_NV_CHANLIST (i.e. 0x07FFF800)?

    ZigBee PRO zigbee cc2530zdk ZigBee 2006 ZStack PAN ID ZigBee project z_stack z_stack cc2530 ZStack 2.3.0 SensorDemo Z-Stack 2.3.0 CC2530 СС2530
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • John Xu
    Posted by John Xu
    on Apr 12 2012 11:38 AM
    Prodigy210 points

    Can anybody help?

    ZigBee PRO zigbee cc2530zdk ZigBee 2006 ZStack PAN ID ZigBee project z_stack z_stack cc2530 ZStack 2.3.0 SensorDemo Z-Stack 2.3.0 CC2530 СС2530
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Dirty Harry
    Posted by Dirty Harry
    on Apr 12 2012 11:53 AM
    Verified Answer
    Verified by John Xu
    Mastermind19350 points

    ZMAC to the rescue and Hi, Ho Silver, Away!


    #include "ZMAC.h"
    #include "zmac_internal.h"


      uint8 currChannel;
     
      (void)ZMacGetReq(ZMacChannel, &currChannel);

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • John Xu
    Posted by John Xu
    on Apr 12 2012 16:11 PM
    Prodigy210 points

    Hi Harry,

    Thanks for your help!  It works!!!  Now I can continue explore ZigBee using CC2530!

    One more question:  I can not find that API in any document (i.e. Z-Stack API reference only has two ZMac API listed ).  Is there a document that will list and explain all ZMac APIs?

    Thanks again! 

    John

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
TI E2E™ Community
  • Support Forums
  • Blogs
  • Videos
  • Groups
  • Site Support & Feedback
  • Settings
TI E2E™ Community Groups
  • TI University Program
  • Make the Switch
  • Microcontroller Projects
  • Motor Drive & Control
Other Communities
  • Deyisupport
  • Designsomething.org
  • beagleboard.org
  • TI on Element 14
  • TI on TechXchangeSM
Other Technical & Support Resources
  • WEBENCH® Design Center
  • Product Information Centers
  • Technical Documents
  • TI Design Network
  • TI Technical Articles
  • TI Training

All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
embedded processors, along with software, tools and the industry’s largest sales/support staff.

© Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy Policy | Terms of Use