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.

Help on CC2530 Zigbee P2P network

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

I'm a neophyte to the CC2530 and wireless communication in general. I am working on a project where I'm trying to make a network using Zigbee for 2 SmartRF05EB boards. I want it to be peer to peer if I scale it to more number of boards. Because master and slave isn't suitable for me. I need a way to start off somehow. I've checked the software examples given by TI and I've understood how the Basic RF and Zigbee transmission and receiving works.

Also, I've downloaded Z-stack Home 1.2.2. But many people are using just Z-Stack 2.5.1, which I can't seem to find and every link to 2.5.1 is taking me to the Z-Stack Home 1.2.2 page with other Z-Stack versions. Can anyone give me any ideas on how  to start off with a peer to peer network? Keep in mind, I'm working on  two boards first. So, I just need to know how to modify the Basic RF code for transmission and receiving so that it can constantly transmit the information from the hyperterminal and also receive information from the other module alternately.

I'm using IAR to code.

Please help me.

Thanks in advance.

  • What do you mean peer to peer? Do you intend to use ZED to ZED communication? In Zigbee mesh network, ZED to ZED communication needs to go through parent node. By the way, Z-Stack 2.5.1 is obsolete and is not available on TI web side. Why do you have to use this obsolete version? It is recommended to use latest Z-Stack.
  • By "peer to peer", I mean that I don't want a coordinator in my network. I want my nodes to act as independent modules who are on the same level, without a parent node. Is that possible? I'm only using two SmartRF05EB boards at the moment to communicate with each other. So, how do I modify my Basic RF code (in reference to swru214) such that I can get both my modules to communicate with each other by sending each other instructions?

    Because as of now, I've fully understood the Light Switch code(also given in swru214) but only one module transmits in this case and the other one receives and toggles the LED. I want both to be transmitting and receiving instructions to each other. But I don't know how to go forward with that.

    Also, I haven't downloaded Z-Stack 2.5.1, but I did download Z-Stack Home. Is that the best for Zigbee on the CC2530? Or shall I get Z-Stack Gateway or any other version?
  • Example in swru214 is like you see, one way communication. If you want two way communication, you have to use Zigbee. However, ZED to ZED communication would need parent node and there must be coordinator to form Zigbee network. According to my experience, Z-Stack home 1.2.2 is most suitable for Zigbee on CC2530.
  • So two way communication is all that I'm looking for right now, so I'll be using Zigbee itself, not ZED to ZED. So, will I be needing a coordinator for this as well? And are there any codes out there I can refer to for two way communication on the CC2530 or is there a way of modifying the Basic RF code given in swru214 to make it two-way instead of one way?
  • Yes, you have to use coordinator in Zigbee network. If you only need simple two-way communication with Zigbee, you can download and install Z-Stack Mesh 1.0.0. There is GenericApp which shows you how to send "hello world" between coordinator and device.

  • Okay. One last thing. I want to be able to take the input through UART from my hyperterminal (e.g PC) and be able to send it through Zigbee and I want to be able to do it two ways. So, will all this be sufficient? Or is there some extra software I can use?
  • Z-Stack Mesh is sufficient for your application.
  • Okay, thank you very much! Also, can you send me a link about ZED to ZED communication? I'm not able to find anything about it after searching on Google.

  • What information do you need about ZED to ZED communication?
  • Oh, when I'm compiling the Generic App, the following error is occuring:
    [Og007]: Assembler list file generation not allowed in this version of the compiler
    65 errors like this are popping up for various files like hal_startup.c, hal_sleep.c and hal_timer.c and such which are included in the GenericApp workspace. Any suggestions? I am using IAR Embedded Workbench 7.2 Code size restricted license.

  • You have to use IAR 8.30 to build Z-Stack mesh example.
  • Hi, again. I've updated to IAR Workbench 9.2 and I'm still getting the same error. I'm using the 4KB Kickstarter version.

  • You have to download IAR EW8051 V8.30 from www.iar.com/.../ti-wireless

  • No. The error is persisting. It's the same error even on V8.3.

    Error code [Og007]: Assembler list file generation not allowed in this version of compiler

  • Try to remove and install Z-Stack Mesh 1.0.0 again.
  • Okay. I switched to the 30 day evaluation license instead of the 4 KB size restricted one and it's working now. Thank you so much for your help.
  • You are welcome and good to know it works now.
  • Hello, again. Does GenericApp on Z-Stack Mesh use Zigbee RF4CE or the normal Zigbee itself?

  • Z-Stack mesh uses normal Zigbee.
  • Hi, YiKai.

    I've made quite some progress in my project but I've come across yet another problem. In GenericApp, When I downloaded the code and I start debugging it on two boards and use Packet Sniffer, I observe that the data "Hello World" is being transferred with exactly an interval of 15 seconds between each transmission. The weird thing is, the value of txMsgDelay doesn't alter the interval. It is ALWAYS 15 seconds regardless of any value of txMsgDelay. Even the default value of 5000 which came with the code is supposed give you an interval of 5 seconds, but it is always 15 seconds. I can't seem to understand why. 

    I suspect it has something to do with the function osa_timer_Ex, which is supposed to give you a delay in milliseconds. But an insight from a professional will be appreciated. 

  • Do you modify anything on GenericApp? I have tested it dozens times and never see this problem. I suggest you using a clean GenericApp example and test again.
  • I only modified the number of end devices and clusters to 1. Nothing else. Thing is, it's supposed to transmit every 5 seconds, right? Well, in Packet Sniffer I've observed that it's transmitting every 15 seconds and changing the value of GENERICAPP_SEND_MSG_TIMEOUT isn't affecting the interval.

    Like when I change the value to 1000, it's supposed to transmit every 1 second. But it still transmits every 15 seconds regardless of the value.
    I've checked in another thread too, someone reported that even their GenericApp is transmitting every 15 seconds instead of 5.
  • I just test GenericApp using Z-Stack Mesh 1.0.0 and there is no problem to receive Hello world in 5 seconds duration. After I change GENERICAPP_SEND_MSG_TIMEOUT to 15000 on both ZC and ZED, the "Hello World" message is sent and received every 15 seconds.
  • I'll try reinstalling Z-Stack then.

    Do I have to write seperate codes for ZC and ZED? Because I dumped the same GenericApp code onto both ZC and ZED.

    What modifications should I make to the original code to dump it into ZC and ZED?

    And in Packet Sniffer, does MAC payload refer to the "Hello World" message?

  • GenericApp.c and GenericApp.h is shared by ZC and ZED. You only need to revise GENERICAPP_SEND_MSG_TIMEOUT to 15000 or any value you want and rebuild both ZED and ZC. Download ZED and ZC FW to two different SmartRF05EB+CC2530EM to test again.
  • I tested on a fresh code, I reinstalled Z-Stack Mesh 1.0.0 and used the new code with no alterations. It's still transmitting every 15 seconds.
  • Can you attach your sniffer log?
  • This is without changing any of the code. 

  • Please attach psd file to me.
  • Your ZED doesn't join ZC in the sniffer log. There is no message would be sent if ZED doesn't join ZC. Please read section 4.2. Running the Generic Application of Z-Stack Generic Application User's Guide.pdf in C:\Texas Instruments\Z-Stack Mesh 1.0.0\Documents
  • How can we tell if the ZED to ZC connection and binding is successful from the data in the PSD log?

    I've read the section 4.2 also of the document you suggested and I've tried it step by step of what they said. This is what I did, please correct me if I'm wrong:

    1) I switched on one board and dumped the unchanged GenericApp code onto the board. So, this is supposed to my coordinator. It's saying that the Energy scan failed but the LED 3 switches on anyways and it displays: "Zigbee Coord Network ID: (Random Number)".. The IEEE address is not displayed.

    2) I switched the other board on which I want to be a router. I dumped the same GenericApp code onto it and I want it to be a router, the document said it'll automatically become a router and connect to coordinator but that doesn't happen. Instead, it says: "Zigbee Coord Network ID: (Random Number)". The IEEE address is not displayed on this board's LCD as well.

    3) I push the joystick to the write for SW2, to bind both devices. I push the joystick to the right on the Coordinator first and the LED1 (Green) lights up. I push joystick on my router too within seconds to the right, the LED1 (green) lights up.  It's supposed to light up LED 4 when they bind, but absolutely nothing happens.

    4) Both devices' LCDs' display the message: "Zigbee Coord Network ID: (Random Number)". Random Numbers are different on both boards. Only this happens, there's no "Hello World" displayed on LCD with number of packets received. And we get the same PSD log with this as well. I don't understand what the problem is.

  • 1. TI packet sniffer is not good at showing binding information. I would suggest you using Ubiqua Packet Analyzer.

    2. It shows "Zigbee Coord Network ID: (Random Number)" in you step 2 and this is incorrect. I think you don't build GenericApp for router correctly. You have to choose RouterEB project in workspace. If you make it correct, it would show "Router: XXXX" on LCD.

  • Yeah, I made another copy of GenericApp folder and instead of excluding the configuration file for Router (f8wRouter.cfg) from the build. I included the Router config file and excluded Coordinator config (f8wCoord.cfg) file, so the code is meant for Router. 

    I built both and downloaded it onto the boards. But it still says: "ZigBee Coord Network ID: Random Number" on both. Is there anything extra I should do for a board to work as a router?

  • You still don't make router correctly. Please refer to section 3.2. Programming Devices of Z-Stack Generic Application User's Guide.pdf. It says

    • The Generic Sample Application requires at least two devices to form a ZigBee network, one Coordinator and one or more non-Coordinator devices (Router or End-Device). To build a non-Coordinator device continue to the next step, otherwise exit the IAR IDE and proceed to Section 4 to run the Generic Application..
    • Select a non-Coordinator device type configuration from the Workspace pull-down menu. The example below shows a Router device selection. For this tutorial, please do not select the -SBL (Serial Boot Loader) configurations. Now repeat all steps in this section to program another device:

    Please follow the instruction to do the test.

  • Thank you so much! It works now.
  • You are welcome and good to know it finally works.
  • YK Chen,

    Please refer to some guide which helps understanding Packet Sniffer Log in Ubiqua Packet Analyzer.