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.

Compiler/CC2530: create a network &send data

Part Number: CC2530
Other Parts Discussed in Thread: Z-STACK, LAUNCHXL-CC26X2R1, CC2531EMK

Tool/software: TI C/C++ Compiler

Hi everyone

I do not have the board and the key, What do I need to add commands to create a network and send data from Sample Temperature to Sample Thermostat?

  • bety,

    You can look at the zcl_sampletemperaturesensor.c and the zcl_sampleapps_ui.c for various commands which are used when pressing different keys. Since you are not using any keys on the sample applications, you will have to think of different approaches you would like the application to do different things.

    You can also take a look at the Z-Stack API document found inside the SDK. You'll be running bdb_StartCommissioning() in order to form the network, and enabling finding & binding. The sample temperature sensor already automatically sends data to the thermostat every 10 seconds (defined by SAMPLETEMPERATURESENSOR_REPORT_INTERVAL).

    You can do something such as creating a clock to automatically attempt to join the Zigbee network (if it's not a ZC), and restart the clock if it fails to join the first time.

    For the ZC, you can have it so that it will automatically form a Zigbee network instead of waiting for the UI.

    Best,
    Sean
  • Thank you so much
    Is this correct?
    bdb_StartCommissioning(BDB_COMMISSIONING_MODE_NWK_STEERING|BDB_COMMISSIONING_MODE_NWK_FORMATION|BDB_COMMISSIONING_MODE_FINDING_BINDING);

  • Yes, you can “bdb_StartCommissioning(BDB_COMMISSIONING_MODE_NWK_STEERING|BDB_COMMISSIONING_MODE_NWK_FORMATION|BDB_COMMISSIONING_MODE_FINDING_BINDING);” to form network from ZC and allow device to join right after network is formed.
  • Thank you
  • Hello
    I added bdb_StartCommissioning() to the Sample thermostat and Temprature but I do not get any data in the thermostat, because it does not enter in " case ZCL_INCOMING_MSG:
    zclSampleThermostat_ProcessIncomingMsg( (zclIncomingMsg_t *)MSGpkt );" when I debug Sample thermostat .
    Why is this problem?
     Please help me

  • Could you provide a sniffer log for your devices attempting to be commissioned?

    Also, are you using Z-Stack 3.0.2?
  • No, can not i understand without it?Please propose a method to find the problem by debugging.
    Meanwhile, I do not have a sensor
  • Please provide more information. Did the devices commission properly and now you're wanting the temp sensor to send ZCL reports out?
    Or are you saying that they have not been commissioned yet either?

    Is there any reason why you cannot use a sniffer? Having a sniffer for debugging will help 1000x more especially if you do not have any buttons nor LCD.

    What changes have you made to both projects?

  • At present, I only have two modules and I do not have any boards and keys and sensor.(my modules are CC2530PA1)
    In the first step, I'm just learning how to send data from Sample Temprature to Sample Thermostat. The only change I made in Samples added bdb_StartCommissioning() .

  • 1. You can run SampleThermostat as coordinator and add "bdb_StartCommissioning(BDB_COMMISSIONING_MODE_NWK_FORMATION|BDB_COMMISSIONING_MODE_NWK_STEERING|BDB_COMMISSIONING_MODE_FINDING_BINDING);" in the end of zclSampleThermostat_Init() to start forming Zigbee network, doing network steering and finding/binding. You can set a breakpoint in "case DEV_ZB_COORD:" of UI_DeviceStateUpdated to make sure the coordinator forms network successfully and then you will have 180 seconds for network steerring and finding/binding for SampleTemperatureSensor to join and binding.

    2. Run SampleTemperatureSensor as end device and add "bdb_StartCommissioning(BDB_COMMISSIONING_MODE_NWK_STEERING|BDB_COMMISSIONING_MODE_FINDING_BINDING);" in the end of zclSampleTemperatureSensor_Init within 180 seconds right after coordinator forms Zigbee network and in network steering and finding/binding state. The SampleTemperatureSensor should join coordinator and successfully do binding and finding to SampleThermostat. You can set a breakpoint in "case DEV_END_DEVICE:" of UI_DeviceStateUpdated to make sure SampleTemperatureSensor joins SampleThermostat coordinator network.

    3. Then, SampleTemperatureSensor should send temperature report to SampleThermostat. You can set another breakpoint in zclSampleThermostat_ProcessInReportCmd of zcl_samplethermostat.c to make sure SampleThermostat receives temperature report from SampleTemperatureSensor.

    By the way, Zigbee zniffer is a very important developing tool so I still suggest you to buy CC2531EMK or LAUNCHXL-CC26x2R1 to setup Zigbee sniffer for debugging.

  • Thank you so much
  • Hello

    I did it Sample Thermostat introduces herself as a cordonitor("case DEV_ZB_COORD:")

    But Tempreture does not introduce itself as a end_device("case DEV_END_DEVICE:"), and the debugger goes on the following line:

    "  LedDutyCycle = 0;"

    please help me

  • If SampleTemperatureSensor doesn't go to "case DEV_END_DEVICE:", it means it deosn't join coordinator. I suggest you to erase flash and do the test again from scratch. By the way, you have to join the device in 180 seconds right after coordinator form network otherwise end device cannot join with my step. Again, sniffer lo is critical to help you so try to get sniffer setup as soon as possible.
  • Yes, I try to get it.
    thank you