This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2530 ZNP - Simple API - end device example

Other Parts Discussed in Thread: CC2530, MSP430F2274, Z-STACK

Is there an example somewhere of a simple end device using the simple API ?

I just want to connect to a known network and send a "I am alive message" every 30 secs. AF_ZDO

seems an overkill and no end-device example exists for SAPI.

I could muck around with the data structure settings but was hoping there was an example somewhere.

 

 

Madhu

  • Hi Madhu,

    What examples are you looking at?

    If your are running the ZNP on the CC2530 then there are two sets of examples actually.

    These simple examples from the wiki

    http://processors.wiki.ti.com/index.php/CC2530ZDK-ZNP-MINI

    There is also a set of application examples written for the MSP430F2274.  The MSP on the ZNP Mini-DK.  These are call ZAP examples on the Z-Stack page (Zigbee application processor).  There are quite a few accronyms unfortunately.

    http://processors.wiki.ti.com/index.php/CC2530ZDK-ZNP-MINI 

    Hopefully these might help you further.

    Cheers,
    Lisa

  • I am looking at the examples you suggested.

    the directory is called ZNP examples If you look at the sapi examples there is only one example_basic_comms_coordinator_sapi.c No end_device example. All such examples use AF_ZDO e.g example_simple_application_end_device_afzdo.c. Was hoping to write a simple SAPI end-device app.

    I guess these are the eaxmples from teh ZNP Mini page, referred to by the Wiki.

    http://www.ti.com/litv/zip/swrc211a

     

    My biggest concern is whether using simple API or AFZDO, I can restrict my code size

    to 4k or so. App is just an end device that sends a message every 30 secs. the router code

    in te above directory seems to be only 4.3k when compiled. I am hoping the simple API or

    AF ZDO from the larger examples do not bloat the code size.

    Once we get this working I hope to add some cool hobby projects for the 2530 ZNP !

    It is a fun part to work with.

    Madhu

  • I guess my question boils down to - can I get by with the mini kit examples for a simple end-device that just needs to join a network and send a message every 30 secs. Any profile will do so support for stuff like HA profile or smart energy profile is not needed.

    From the looks of it looks like the

    example_basic_comms_end_device_afzdo.c

     

    will work. I wish there was a guide to AF_ZDO for ZB novices.

    the data gest send to the default end point which I presume is the coordinator.

    I am assuming that I do not have to know the coordinator ID since it is the DEFAULT_ENDPOINT ?

     

    Would really appreciate an answer to this question since we plan to proto next week !

     

    Madhu

  • Hi Madhu,

    Well, I have not had a chance to verify the code size for you, but I do not see why you can not base things on that example.    If you only have an end device and coordinator, yes the messages will be sent between the two of them.

    Good luck with it all!  Unfortunately there are no further examples, than what I pointed you to, that I have to provide you.

    Cheers,
    Lisa

  • Thanks. I was somehow under the impression that Ihad to specify PAN ID and coordinator net addr. Was

    not sure if auto discovery worked for simple configurations.I have 8 end devices(each with a  single endpoint only) and one coordinator, not 1 + 1

    Still it  looks like that example should work.

    One thing still is not clear though. Where is teh PANID set ? Does teh ZNP default to ANY_PAN ? Can't see any call to setPanId().

     

    Once I get a better hang of things, will try to post a few working examples.

     

    Madhu

  • Hello Madhu, When using ZNP Mini Kit you can set the PAN ID by writing the configuration parameter ZCD_NV_PANID as explained in the ZNP Interface Specification document. This is included in the Z-Stack-2.4.0-1.4.0 install package at www.ti.com/z-stack. For the mini kit examples it is set to 0xFFFF which means when the coordinator makes a network it randomly chooses a PANID and when end-device or router join a network they do not look for a specific PAN ID to join to. If you want to set a particular PANID you need to write the configuration parameter. FOr ZNP mini kit examples there is a function void setPanID(unsigned int panID) which you can call before starting the network to set a particular PAN ID. Also, to better understand ZNP Mini Kit you can refer to the wiki pages at http://processors.wiki.ti.com/index.php/CC2530ZDK-ZNP-MINI Hope this helps, Regards, Suyash Jain
  • Thanks. I apologize for my utter "cluenessnes" about couple of basic Zigbee concepts. The fact that coordinators typically assign random PAN IDs and that there are multiple endpoints in a device ! I should really have read the standards before posting forum questions
    Coming back to issues technical, then if there are guaranteed to mutiple zigbee networks, then it is better for the Coordinator to set a fixed PANID right ?
    Otherwise discovery becomes an issue since you have to connect to each PAN and figure out if it is your network (inter PAN routing will not be possible in my case).
  • If you're going to be in an area with multiple networks, then you might just want to use a different encryption key. If you use a specific PAN ID (eg 0x1234) there's always a risk that another coordinator will use 0x1234 and you'll be screwed.

     

    There should be functions in znp_interface to set both the PAN ID and channel explicitly. I normally only use these features in testing, when I have multiple PANs set up and I want to keep the networks separate.

     

    --Derek (and author of the ZNP Mini Kit examples)