• 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 » About the poll rate of end device
Share
Low Power RF & Wireless Connectivity
  • Forums
  • Announcements
  • Files
  • E2E Wiki
Options
  • Subscribe via RSS

Forums

About the poll rate of end device

This question is answered
licheng Li
Posted by licheng Li
on Apr 13 2012 02:34 AM
Prodigy220 points

Hi,

can i change the poll rate,QueuedPollRate,ResponsePollRate of END DEVICE and take effect in run-time without reset CC2530ZNP or resart ZIGBEE stack?

Poll Rate END DEVICE
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 13 2012 02:59 AM
    Mastermind8990 points

    Hi Licheng,

    You can use NLME_SetPollRate(), NLME_SetQueuedPollRate(), and NLME_SetResponseRate() to change polling rate, queuedpollrate and resplonsepollrate of end device anytime when you need to.

    Regards!

    YK Chen

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • licheng Li
    Posted by licheng Li
    on Apr 13 2012 04:59 AM
    Prodigy220 points

    YiKai Chen

    Hi Licheng,

    You can use NLME_SetPollRate(), NLME_SetQueuedPollRate(), and NLME_SetResponseRate() to change polling rate, queuedpollrate and resplonsepollrate of end device anytime when you need to.

    Regards!

    YK Chen

    Thank you,but i am using the CC2530ZNP spi interface in the design,does the ZNP support the NLME APIs?As far as i know,it only supports the simple API,AF API and ZDO API.

    Regards.

    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 13 2012 10:46 AM
    Suggested Answer
    Mastermind19350 points

    For these 3 poll rates, you can changes them on the ZNP from the Application Processor (ZAP) side by writing to their corresponding NV item. Use this ZAP API:

    uint8 znp_nv_write(uint16 id, uint8 ndx, uint8 len, void *buf)

    So for the poll rate:

    uin16 newPollRate = 2000;  // Poll every 2 seconds.

    (void)znp_nv_write(ZCD_NV_POLL_RATE, 0, 2, &newPollRate);

    Be careful when changing the poll rates - FFD devices only hold indirect messages for 6-7 seconds by default:

    -DNWK_INDIRECT_MSG_TIMEOUT=7

     

     

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • licheng Li
    Posted by licheng Li
    on Apr 13 2012 21:58 PM
    Prodigy220 points

    Thanks,

    but it seens that this only will take effect after resetting the ZNP chip or restarting the ZSTACK,not immediately.

    Regards.

    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 13 2012 22:02 PM
    Suggested Answer
    Mastermind19350 points

    I agree, it does seem like it would only take effect after a reset, but it is effected immediately as well - take a look at the function MT_SysOsalNVWrite() in mt_sys.c:

      /* Set the Z-Globals value of this NV item. */
      zgSetItem( nvId, (uint16)nvItemLen, pBuf );

    That is the magic line that makes it effective immediately.

     

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • licheng Li
    Posted by licheng Li
    on Apr 14 2012 02:35 AM
    Prodigy220 points

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • licheng Li
    Posted by licheng Li
    on Apr 16 2012 03:52 AM
    Prodigy220 points

    Hello Harry,

    I had done the simple test,but the result is that it seens the codes didn't take effect.

    My simple codes is something like these:

          if((*recvBuf).msgData[4]=='A')
          { 
            setPollRate(10);      
          }

         else if((*recvBuf).msgData[4]==B')
          { 
            setPollRate(1000);      
          }

    I am sure when in running and the ((*recvBuf).msgData[4]=='A') is TRUE,the ‘setPollRate(10)’ had been run,but the CC2530ZNP still kept the default pollRate(1000ms).And if i setPollRate(10) in the znpInit() function,the pollRate could be changed succefully.

    So,did i miss something?

    Regards.

    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 18 2012 15:02 PM
    Suggested Answer
    Mastermind19350 points

    Hello - I do not see 'setPollRate()' in the ZAP code base; so perhaps it is your own function and there is a problem in that function? I just re-verified that my suggestion works to dynamically change the POLL_RATE of an end device via the MT API.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • licheng Li
    Posted by licheng Li
    on Apr 18 2012 20:10 PM
    Prodigy220 points

    Hello,the setPollRate() is the function is the CC2530ZNP mini KIT example codes,

    void setPollRate(unsigned int pollRate)
    {
    //    if ((pollRate == 0) || (pollRate > 65000))
    //    {
    //        znpResult = -1;
    //        return;
    //    }
    #ifdef ZNP_INTERFACE_VERBOSE    
        printf("Setting ZCD_NV_POLL_RATE to %u\r\n", pollRate);
    #endif
        znpBuf[0] = ZB_WRITE_CONFIGURATION_LEN + ZCD_NV_POLL_RATE_LEN;
        znpBuf[1] = MSB(ZB_WRITE_CONFIGURATION);
        znpBuf[2] = LSB(ZB_WRITE_CONFIGURATION);
       
        znpBuf[3] = ZCD_NV_POLL_RATE;
        znpBuf[4] = ZCD_NV_POLL_RATE_LEN;
        znpBuf[5] = LSB(pollRate);
        znpBuf[6] = MSB(pollRate);
       
        znpResult = sendMessage();

    }

    I found out this function only will take effect after the CC2530ZNP reset or ZSTACK restart.

    And i didn't check the ZAP code,because i used ZNP firmware.I do know what is the difference between the ZAP firmware and the ZNP firmware.But in the ZNP firmware codes,i checked the MT_SYS.C and the function MT_SysOsalNVWrite(uint8 *pBuf),according the doucument CC2530ZNP interface, i could not figure out how to use this function to change the poll rate.Could you show me the way with example codes?I appreciate that.

    And I already had a solution actually,i modified the MT_SYS.C, and added on my own function with cmd 0x2150,I named this function MT_SysSetPollRate(pBuf).This function would call the NLME_SetPollRate, NLME_SetQueuedPollRate,NLME_SetResponseRate to change the poll rate in run-time and take effect immediately.This is the working way i had found so far.

     void MT_SysSetPollRate(uint8 *pBuf)
    {
      uint8 str[]="OK";
      uint16 val1=1000;
      uint16 val2=100;
      uint16 val3=100;
     
      /* Skip over RPC header */
      pBuf += MT_RPC_FRAME_HDR_SZ; 
      val1 = BUILD_UINT16(pBuf[0], pBuf[1]);
      val2 = BUILD_UINT16(pBuf[2], pBuf[3]);
      val3 = BUILD_UINT16(pBuf[4], pBuf[5]);
      
      NLME_SetPollRate( val1 );
      NLME_SetQueuedPollRate( val2 );
      NLME_SetResponseRate( val3 );    
      
      /* Build and send back the response */
      MT_BuildAndSendZToolResponse(((uint8)MT_RPC_CMD_SRSP | (uint8)MT_RPC_SYS_SYS), MT_SYS_SET_POLL_RATE, 2,str);
    }

    Regards.

    poll rate
    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 18 2012 20:42 PM
    Verified Answer
    Verified by licheng Li
    Mastermind19350 points

    Hello - unfortunately, I do not have any experience working with the ZNP mini-kit code. Although from the snippet that you show, I see that the poll rate is not being changed the way that I recommended, which would be to invoke this via ZAP (ZNP Application Processor, or "host" computer, controlling the ZNP as a network slave device) code:

    (void)znp_nv_write(ZCD_NV_POLL_RATE, 0, 2, &newPollRate);

    The body of ZAP code is downloaded from here:

    http://www.ti.com/tool/z-stack

    swrc173.zip (57.0MB) - contains ZStack-ZAP-MSP430-1.0.4.exe (the ZigBee Applications processor to be used with MSP430 product family).

    So, what is znp_nv_write()? It is intuitive from the name: a request to write to an NV item on the ZNP. How to implement a write to NV on the ZNP from the host application via the MT API? Use the MT_SYS_OSAL_NV_WRITE command. The item that we want to write is the poll rate: ZCD_NV_POLL_RATE or item id 0x0024. Let's set it to 5000 instead of the default of 1000.

    So building the SREQ MT message should be this:

    SOP  LEN  MT_RPC_CMD_SREQ-MT_RPC_SYS_SYS  MT_SYS_OSAL_NV_WRITE  ZCD_NV_POLL_RATE Offset Len Value FCS

    0xFE 0x06 0x21 0x09 0x24 0x00 0x00 0x02 0x88 0x13 0x93

    It helps to look at the files MT.h & MT_RPC.h.

     

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Sreekesh Padmanabhan
    Posted by Sreekesh Padmanabhan
    on Jul 27 2012 12:44 PM
    Intellectual515 points

    Hi licheng Li

    Did you get it working in CC2530 ZNP Mini. I get the following pulses in between my 4 sec transmission intervals:

    I want to minimize those mini peaks to say once, between those 4 seconds, any ideas pls help!!!

    Iam using CC2530 ZNP Mini

    -Sree

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • licheng Li
    Posted by licheng Li
    on Jul 29 2012 20:25 PM
    Prodigy220 points

    Hi, it is the CC2530 ZNP Mini which i am using,and i didn't found any problem.

    What code did you use in your problem?

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Sreekesh Padmanabhan
    Posted by Sreekesh Padmanabhan
    on Jul 29 2012 22:06 PM
    Intellectual515 points

    Hi Li,

    Iam also using CC2530 ZNP Mini, running simple application code.

    I had put up the same question in another forum to which I got the response to consider the the poll rate. Posting one of the posts in that query here:

    I read about ZCD_NV_POLL_RATE and figured out, it is set by void setPollRate(unsigned int pollRate) function in znp_interface.c, however amazingly there is no call to that function in Simple Application - End Device code (searched manually and ctrl+F deep search). So I manually included the following lines of code in startZnp (@znp_simpleapp_utils.c) after znpReset

        setPollRate(2000);
        if (znpResult != ZNP_SUCCESS)
            return -11;/**/

    which provides me this plot:

    which was earlier, (before the above manual setPollRate(2000) inclusion):

    While that is certainly a difference in the plot, I couldnt map the 2000mS, and more importantly, how is that 1Sec interval set by default with no call to setPollRate in original Simple Application - End Device. Atleast, if I know the root of that 1Sec interval and how it is set (since setPollRate is not called exclusively), I could further dig around.

    -Sree

    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