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 uart program flow

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

Hi Everyone,

                  I am working on home automation project and new to zigbee. Right now i am using ZNP code available in(ZStack-CC2530-2.5.1a_1\Projects\zstack\ZNP\cc253x\znp iar ide workspace). I am able to understand uart initialization but I am not able to understand the program flow sequence for sending and receiving data using uart dma(like which function to call for reading data sent through uart). I am using usart0 with default baud rate of 115200.

Can anybody please help me regarding this.

  • With your support and your support discussed at forum "http://e2e.ti.com/support/wireless_connectivity/f/158/t/260183#pi239031348filter=all&pi239031348scroll=false "
    i am able to get notification when data is transmitted through uart. I will be using this to set event for sending command to the end device based on the data received through uart. This is going to be too much helpful to me in further process. Thanks a lot for this help.
  • Hi Yikai,
    I am trying to send data from coordinator to the end device by calling
    zb_SendDataRequest( 0xFFFE, SENSOR_REPORT_CMD_ID, 2, pData, 0, AF_ACK_REQUEST, 0 ); function in RX callback function but data is not received at the end device end. I have made following changes in the command declaration at collector side

    #define NUM_IN_CMD_COLLECTOR 1
    const cId_t zb_InCmdList[NUM_IN_CMD_COLLECTOR] =
    {
    SENSOR_REPORT_CMD_ID
    };

    // Define SimpleDescriptor for Collector device
    const SimpleDescriptionFormat_t zb_SimpleDesc =
    {
    MY_ENDPOINT_ID, // Endpoint
    MY_PROFILE_ID, // Profile ID
    DEV_ID_COLLECTOR, // Device ID
    DEVICE_VERSION_COLLECTOR, // Device Version
    0, // Reserved
    NUM_IN_CMD_COLLECTOR, // Number of Input Commands
    (cId_t *) zb_InCmdList, // Input Command List
    NUM_OUT_CMD_COLLECTOR, // Number of Output Commands
    (cId_t *) zb_InCmdList // Output Command List
    };

    and at the sensor side

    #define NUM_OUT_CMD_SENSOR 1
    #define NUM_IN_CMD_SENSOR 0
    const cId_t zb_OutCmdList[NUM_OUT_CMD_SENSOR] =
    {
    SENSOR_REPORT_CMD_ID
    };

    const SimpleDescriptionFormat_t zb_SimpleDesc =
    {
    MY_ENDPOINT_ID, // Endpoint
    MY_PROFILE_ID, // Profile ID
    DEV_ID_SENSOR, // Device ID
    DEVICE_VERSION_SENSOR, // Device Version
    0, // Reserved
    NUM_IN_CMD_SENSOR, // Number of Input Commands
    (cId_t *) zb_OutCmdList, // Input Command List
    NUM_OUT_CMD_SENSOR, // Number of Output Commands
    (cId_t *) zb_OutCmdList // Output Command List
    };

    here i will be receiving data at the sensor side

    void zb_ReceiveDataIndication( uint16 source, uint16 command, uint16 len, uint8 *pData )
    {
    HalUARTWrite( HAL_UART_PORT_0, pData, len );
    }

    I am able to send data from end device to coordinator but not reverse. Do i need to make further changes in simple sensor and simple collector code for receiving data at the end device end?
  • I see you use 0xFFFE in zb_SendDataRequest which means broadcast. ZED would miss broadcast signal if it is under sleeping mode. The correct method is to use unicast.
  • for using unicast, i need to provide destination address like
    destination.addrMode = Addr16Bit;
    destination.addr.shortAddr = ?
    How can we know what is destination address of the coordinator when end device binds to coordinator using broadcast like
    // Find and bind to a collector device
    zb_BindDevice( TRUE, SENSOR_REPORT_CMD_ID, (uint8 *)NULL );
  • When a device joins Zigbee network, it would broadcast end mode announcement and ZC should receive it. There is short address in end node announcement so you can keep it in your application and use it for unicast later.
  • Hi Yikai,
    I have gone through different posts discussed in forum for end node announcement including post discussed at
    http://e2e.ti.com/support/wireless_connectivity/f/158/p/291987/1020107#1020107
    but i couldn't understand that. Can you please suggest me where to call ZDP_NwkAddrReq(),ZDO_ParseDeviceAnnce( ), ZDP_SimpleDescReq() etc. How can i store and differentiate these short address for different end device after device announce so that i can use it for unicast mode of transfer for future purpose? Any example code for getting these short address will be helpful.
    Thanks.
  • I am confused where to call these functions:ZDO_RegisterForZDOMsg(),ZDP_NwkAddrReq(),ZDO_ParseDeviceAnnce( ), ZDP_SimpleDescReq().
    uint8 MT_ZdoHandleExceptions( afIncomingMSGPacket_t *pData, zdoIncomingMsg_t *inMsg )
    {
    .
    .
    case Device_annce:
    ZDO_ParseDeviceAnnce( inMsg, &devAnnce );
    MT_ZdoEndDevAnnceCB( &devAnnce, inMsg->srcAddr.addr.shortAddr );
    break;
    .
    .
    }
    function already calls for device announce.
    Do i need to include these functions anywhere else( in init function) also as you have discussed in forum at
    "http://e2e.ti.com/support/wireless_connectivity/f/158/p/291987/1020107#pi239031348=1"
    If yes then where should i include? How can i assign reference for the short address when end device announce takes place and cross verify whether short address(assigned by the coordinator) is for that particular end device.
  • 1. You can register Device_annce by using "ZDO_RegisterForZDOMsg(task_id, Device_annce);", "ZDO_RegisterForZDOMsg(task_id, Active_EP_rsp);". and "ZDO_RegisterForZDOMsg(task_id, Simple_Desc_rsp);" in your init function and process "case Device_annce:", "case Active_EP_rsp:" ,and "case Simple_Desc_rsp " in XXX_ProcessZDOMsgs().
    2. Use ZDP_ActiveEPReq in "case Device_annce:" of XXX_ProcessZDOMsgs() to request active endpoint from ZED.
    3. Use ZDP_SimpleDescReq() in "case Active_EP_rsp:" to get Simple Descriptor from ZED.
    4. Then, you can collect all short address, active endpoint, and simple descriptor in "case Device_annce:", "case Active_EP_rsp:" ,and "case Simple_Desc_rsp " of XXX_ProcessZDOMsgs().
  • Hi Yikai,
    I have got completely stuck. Don't know whether its correct or not.
    void SAPI_Init( byte task_id )
    {
    .
    .
    ZDO_RegisterForZDOMsg(sapi_TaskID, Device_annce); //Register for device announce
    ZDO_RegisterForZDOMsg(sapi_TaskID, Active_EP_rsp); //Register for Active EP response
    ZDO_RegisterForZDOMsg(sapi_TaskID, Simple_Desc_rsp); //Register for simple descriptor response
    .
    .
    }

    void SAPI_ProcessZDOMsgs( zdoIncomingMsg_t *inMsg )
    {
    zAddrType_t destAddr;
    uint16 shortAddr;
    uint8 epInt;
    switch ( inMsg->clusterID )
    {
    .
    .
    case Device_annce:
    {
    ZDO_DeviceAnnce_t devAnnce;
    ZDO_ParseDeviceAnnce( inMsg, &devAnnce );
    ZDP_ActiveEPReq( &destAddr, shortAddr, 0);
    }
    break;
    case Active_EP_rsp:
    {
    ZDP_SimpleDescReq( &destAddr, shortAddr, epInt, 0);
    }
    break;
    case Simple_Desc_rsp:
    {
    ZDO_SimpleDescRsp_t simpleDescRsp;
    ZDO_ParseSimpleDescRsp( inMsg, &simpleDescRsp );
    //follows code for retrieving data like short address,endpoint etc
    }
    break;
    }//switch case ends here
    }

    Please check above code sequence for any mistake. Dono whether this will be sequence

    case Device_annce:
    ZDO_ParseDeviceAnnce( inMsg, &devAnnce );
    case Active_EP_rsp:
    ZDP_ActiveEPReq( &destAddr, shortAddr, 0);
    case Simple_Desc_rsp:
    ZDP_SimpleDescReq( &destAddr, shortAddr, epInt, 0);

    Thanks
  • Yes, it looks correct and they should be called sequently.
  • As mentioned in my previous post, i had given two sequence for calling functions like
    (1)
    case Device_annce:
    ZDO_ParseDeviceAnnce( inMsg, &devAnnce );
    ZDP_ActiveEPReq( &destAddr, shortAddr, 0);
    case Active_EP_rsp:
    ZDP_SimpleDescReq( &destAddr, shortAddr, epInt, 0);
    case Simple_Desc_rsp:
    ZDO_ParseSimpleDescRsp( inMsg, &simpleDescRsp );
    (2)
    case Device_annce:
    ZDO_ParseDeviceAnnce( inMsg, &devAnnce );
    case Active_EP_rsp:
    ZDP_ActiveEPReq( &destAddr, shortAddr, 0);
    case Simple_Desc_rsp:
    ZDP_SimpleDescReq( &destAddr, shortAddr, epInt, 0);

    which sequence is correct (1) or (2)?

    what you are referring by this "they should be called sequentially."
    do you mean i should retrieve short address,end points etc sequentially or something else?
  • (1) is correct.
  • Hi Yikai,
    I had made those changes for device announce but i am not able to transmit data from coordinator to end device. I think we need to store the end device address in NV memory after cross checking using device command id whether the end device address is of that particular device or not .

    Can you please suggest how to store those end device address and other information into NV and retrieve these information from NV memory to send data from coordinator to the end device and vice versa. Any sample code can be easy to help me.
  • If you don't power cycle ZC, you don't have to keep short address of ZED to NV. The problem is that can you get short address, active end point and simple descriptor of specific ZED?
  • I had tried to debug it by setting breakpoints at all three cases. Its processing device announce case but control is not going to Active_EP_rsp: and Simple_Desc_rsp: case
  • What are the destAddr and shortAddr in your ZDP_ActiveEPReq? Do you use Ubiqua Packet Analyzer to check if ZDP_ActiveEPReq is sent over the air?
  • I don't know how to include files here else i would have included .psd file. i am using cc2531 packet sniffer I have got short address 0xED81, nwk dest addr 0xfffd
  • To include files on the forum, select rich formatting and drag and drop the file into your answer.
  • Here i have included .psd fiz.psdle

  • Thanks for your kind reply.
  • Why nwk dest addr is 0xFFFD? If the short address of ZED is 0xED81, the NWKAddrOfInterest parameter should be 0xED81 too.
  • Sorry, the source and destination address i had given in my previous post was from sniffer log file and not parameter(through debug) for the function ZDP_ActiveEPReq( &destAddr, shortAddr, 0);

    As mentioned earlier in my post i am using following functions. I don't know whether to include extra lines of code in these three cases. I had asked you and you had replied it seems to be correct. Please correct me if its wrong

    void SAPI_ProcessZDOMsgs( zdoIncomingMsg_t *inMsg )
    {
    zAddrType_t destAddr;
    uint16 shortAddr;
    uint8 epInt;
    switch ( inMsg->clusterID )
    {
    .
    .
    case Device_annce:
    {
    ZDO_DeviceAnnce_t devAnnce;
    ZDO_ParseDeviceAnnce( inMsg, &devAnnce );
    ZDP_ActiveEPReq( &destAddr, shortAddr, 0);
    }
    break;
    case Active_EP_rsp:
    {
    ZDP_SimpleDescReq( &destAddr, shortAddr, epInt, 0);
    }
    break;
    case Simple_Desc_rsp:
    {
    ZDO_SimpleDescRsp_t simpleDescRsp;
    ZDO_ParseSimpleDescRsp( inMsg, &simpleDescRsp );
    //follows code for retrieving data like short address,endpoint etc
    }
    break;
    }//switch case ends here
    }

    Thanks
  • Hi Yikai,

    Here i am including .psd sniffer log file for over the air communication in between my devices. In this log you can see that end device is assigned short address and end device is continuously sending data to the coordinator every 5 secs.snif_log1.psd

  • Hi TER,
    can you suggest where i can get sample code for device announce and simple descriptor. I want to send data from coordinator to the end device and for this i need short address,end point etc of the binded end device so that i can use these information for unicast transferring data from coordinator to the end device.
    Thanks.
  • From your sniffer log, I only see there is a device sends Match request after end node announcement. I don't see you send active endpoint request. Try to replace the following code in case Device_annce:

    case Device_annce:
    {
    ZDO_DeviceAnnce_t devAnnce;
    ZDO_ParseDeviceAnnce( inMsg, &devAnnce );
    destAddr.addrMode = Addr16Bit;
    destAddr..addr.shortAddr = devAnnce.nwkAddr;
    ZDP_ActiveEPReq( &destAddr, devAnnce.nwkAddr, 0);
    }
    break;
  • Hi Yikai,

    Here i have included sniffer log file with APS frame received.

    snif_log_20dec15_3pm.psd

  • Do i need to include extra line of code for case Active_EP_rsp: also? I think we need to provide destAddr, shortAddr parameter for the function ZDP_SimpleDescReq( &destAddr, shortAddr, epInt, 0); also.

    case Device_annce:
    {
    ZDO_DeviceAnnce_t devAnnce;
    ZDO_ParseDeviceAnnce( inMsg, &devAnnce );
    destAddr.addrMode = Addr16Bit;
    destAddr.addr.shortAddr = devAnnce.nwkAddr;
    ZDP_ActiveEPReq( &destAddr, devAnnce.nwkAddr, 0);
    }
    break;
    case Active_EP_rsp:
    {
    ZDP_SimpleDescReq( &destAddr, shortAddr, epInt, 0);
    }
    break;
  • Do i need to include extra line of code for case Active_EP_rsp: also? I think we need to provide destAddr, shortAddr parameter for the function ZDP_SimpleDescReq( &destAddr, shortAddr, epInt, 0); also.

    case Device_annce:
    {
    ZDO_DeviceAnnce_t devAnnce;
    ZDO_ParseDeviceAnnce( inMsg, &devAnnce );
    destAddr.addrMode = Addr16Bit;
    destAddr.addr.shortAddr = devAnnce.nwkAddr;
    ZDP_ActiveEPReq( &destAddr, devAnnce.nwkAddr, 0);
    }
    break;
    case Active_EP_rsp:
    {
    ZDP_SimpleDescReq( &destAddr, shortAddr, epInt, 0);
    }
    break;

    thanks
  • It is similar to modify ZDP_SimpleDescReq. I suppose you can do some hands-on by yourself.
  • From this sniffer log, I see active endpoint request and simple descriptor request are sent out and get response.
  • typedef struct
    {
    uint16 nwkAddr; // Network address
    uint8 endpoint; // Endpoint identifier
    uint16 profileID; // Profile identifier
    uint16 deviceID; // Device identifier
    uint8 version; // Version
    } epInfoRec_t;

    Here is the function
    void SAPI_ProcessZDOMsgs( zdoIncomingMsg_t *inMsg )
    {
    zAddrType_t destAddr;
    uint16 shortAddr;
    uint8 epInt;
    static zAddrType_t addr;
    addr.addrMode = Addr16Bit;
    switch ( inMsg->clusterID )
    {
    .
    .
    case Device_annce:
    {
    ZDO_DeviceAnnce_t devAnnce;
    ZDO_ParseDeviceAnnce( inMsg, &devAnnce );
    destAddr.addrMode = Addr16Bit;
    destAddr.addr.shortAddr = devAnnce.nwkAddr;
    ZDP_ActiveEPReq( &destAddr, devAnnce.nwkAddr, 0);
    }
    break;
    case Active_EP_rsp:
    {
    ZDO_ActiveEndpointRsp_t *pActiveEPs = NULL;
    pActiveEPs = ZDO_ParseEPListRsp( inMsg );
    if ( pActiveEPs->status == ZSuccess )
    {
    for (uint8 i=0; i < pActiveEPs->cnt; i++ )
    {
    addr.addr.shortAddr = pActiveEPs->nwkAddr;
    ZDP_SimpleDescReq( &addr, pActiveEPs->nwkAddr, pActiveEPs->epList[i], 0 );
    }
    }
    if ( pActiveEPs != NULL )
    {
    osal_mem_free( pActiveEPs );
    }
    }
    break;
    case Simple_Desc_rsp:
    {
    ZDO_SimpleDescRsp_t simpleDescRsp;
    ZDO_ParseSimpleDescRsp( inMsg, &simpleDescRsp );
    epInfoRec_t rec;
    rec.nwkAddr = simpleDescRsp.nwkAddr;
    rec.endpoint = simpleDescRsp.simpleDesc.EndPoint;
    rec.profileID = simpleDescRsp.simpleDesc.AppProfId;
    rec.deviceID = simpleDescRsp.simpleDesc.AppDeviceId;
    rec.version = simpleDescRsp.simpleDesc.AppDevVer;
    }
    break;
    }
    }
    is it correct? Will this rec variable be used for getting end device short address,end point?
  • Hi Yikai,
    Can you suggest any sample code where i can get information for device announce,saving end device address and finally use these saved data to transmit data from coordinator to the end device so that i can get some idea how to proceed. Its getting too much complicated for me. i have spent too much time (for sending data from coordinator to the end device but still i am not able to do so) and my project is getting too much delayed. I can feel that you would also be getting disturbed. i need code only for above mentioned part which i think may be utilized in any z-stack sample application.
  • I have shown you how to get active endpoint and simple descriptor after end node announcement. I don't understand why you have difficulty to organize them into a device list. For example, you can create a device list array using epInfoRec_t, e.g. epInfoRec_t dev_list[10]. When there is an end node announcement, you should check if there is any node in dev_list has the same short address. If not, add it as a new device into dev_list and send active endpoint request. When you receive active endpoint response, you can search matched short address in dev_list and set endpoint for it. Then, you can send simple descriptor request. When you receive simple descriptor response, you can search matched short address and endpoint in dev_list and set simple descriptor data. In the way, you will get a device list that contains short address, endpoint, and simple descriptor. When you want to send command or message to any device, you can get its short address and endpoint from this device list.

  • Hi Yikai,

    Sorry, i had got frustrated as i am trying to send data from coordinator to end device from last 2-3 weeks but not able to do so.

    Actually i didn't understand in detail why we need device announce,end point request and response and simple descriptor request and response. Now only i came to know why we need these things.

    As per your guidance i have tried to write code but don't know whether its correct or not. Please go through it and intimate me for any correction

    Thanks

    Here i have included the code.

    typedef struct
    {
      uint16 nwkAddr;   // Network address
      uint8 endpoint;   // Endpoint identifier
      uint16 profileID; // Profile identifier
      uint16 deviceID;  // Device identifier
      uint8 version;    // Version
    } epInfoRec_t;
    epInfoRec_t dev_list[10];
    
    void SAPI_ProcessZDOMsgs( zdoIncomingMsg_t *inMsg )
    {
        zAddrType_t destAddr;
        uint16 shortAddr;
        uint8 epInt;
        static zAddrType_t addr;
        addr.addrMode = Addr16Bit;
        uint8 dev_cnt;
    	.
    	.
            case Device_annce:
            {          
              ZDO_DeviceAnnce_t devAnnce;
              ZDO_ParseDeviceAnnce( inMsg, &devAnnce );
              destAddr.addrMode = Addr16Bit;
              destAddr.addr.shortAddr = devAnnce.nwkAddr;
              for(dev_cnt =0;dev_cnt<10;dev_cnt++)  //check whether any device with short address same as devAnnce.nwkAddr is already present or not
              {
                if(destAddr.addr.shortAddr == dev_list[dev_cnt].nwkAddr)
                {
                  break;    //break loop if device is already registered
                }
              }
              if( dev_cnt == 10)    //dev_cnt == 10 means device is not registered in the device list,dev_cnt<10 means device already present in list
              {
                for(uint8 i = 0;i < 10;i++)
                {
                  if(dev_list[i].endpoint != null)  //check which is the last device registered
                  {
                    dev_list[i].nwkAddr = devAnnce.nwkAddr;             //register short address of the announced device into device list at location where device is not registered
                    ZDP_ActiveEPReq( &destAddr, devAnnce.nwkAddr, 0);   //send active end point request for the new device announced
                    break;  //exit further registering of devices
                  }
                }                
            }
            break;
          case Active_EP_rsp:
            { 
              ZDO_ActiveEndpointRsp_t *pActiveEPs = NULL;
              pActiveEPs = ZDO_ParseEPListRsp( inMsg );     //get end point response         
              if ( pActiveEPs->status == ZSuccess )
              {
                for (uint8 j=0; j < pActiveEPs->cnt; j++ )
                {
                  if(pActiveEPs->nwkAddr == dev_list[j].nwkAddr)    //match the short address of the end point for which end point response has arrived
                  {
                    dev_list[j].endpoint = pActiveEPs->epList[j];   //store the end point of the responded end point in the device list
                    addr.addr.shortAddr = pActiveEPs->nwkAddr;
                    addr.addrMode = Addr16Bit; 
                    ZDP_SimpleDescReq( &addr, pActiveEPs->nwkAddr, pActiveEPs->epList[i], 0 );   //send simple descriptor request to the responded end device
                    break;  //exit from further request
                  }
                }
                if ( pActiveEPs != NULL )
                {
                  osal_mem_free( pActiveEPs );      //free memory
                }
              }
            }
            break;
          case Simple_Desc_rsp: 
            {
              ZDO_SimpleDescRsp_t simpleDescRsp;
              simpleDescRsp.simpleDesc.pAppInClusterList = simpleDescRsp.simpleDesc.pAppOutClusterList = NULL;        
              ZDO_ParseSimpleDescRsp( inMsg, &simpleDescRsp );
              for (uint8 k=0; k < 10; k++ )
              {
                if((simpleDescRsp.nwkAddr == dev_list[k].nwkAddr) && (simpleDescRsp.simpleDesc.EndPoint == dev_list[k].endpoint))   //match short address and end point of the end device in the dev_list
                {  
                
                  dev_list[k].profileID = simpleDescRsp.simpleDesc.AppProfId;       //store end point information in the device list
                  dev_list[k].deviceID = simpleDescRsp.simpleDesc.AppDeviceId;
                  dev_list[k].version = simpleDescRsp.simpleDesc.AppDevVer;
                }
                break;      //exit further storing
              }
              if ( simpleDescRsp.simpleDesc.pAppInClusterList != NULL )
              {
                osal_mem_free( simpleDescRsp.simpleDesc.pAppInClusterList );
              }
              if ( simpleDescRsp.simpleDesc.pAppOutClusterList != NULL )
              {
                osal_mem_free( simpleDescRsp.simpleDesc.pAppOutClusterList );
              }          
            }               
            break;
      }
    }
    
    //This dev_list informations can be used for sending unicast data from coordinator to the end device

  • Hi Yikai,

    There were couple of errors in the code i had sent like 

    ZDP_SimpleDescReq( &addr, pActiveEPs->nwkAddr, pActiveEPs->epList[j], 0 );   //send simple descriptor request to the responded end device

    and opening and closing brackets. I had sent that code without compiling.

    Here i have included sniffer log file after the modifications made. I want to know whether the process was correct or not and in sniffer log my data is getting sent over the air or not.snif_log_21dec15_3pm.psd

  • Hi Yikai,

    There were couple of errors in the code i had sent like

    ZDP_SimpleDescReq( &addr, pActiveEPs->nwkAddr, pActiveEPs->epList[j], 0 );   //send simple descriptor request to the responded end device

    and bracket balancing. I had sent that code without compiling.

    I want to know whether the process was correct or not and in sniffer log my data is getting sent over the air or not.

    Which software is required to open sniffer log(.psd) file?

    Here i have included sniffer log file after the modifications made.

    8267.snif_log_21dec15_3pm.psd

  • I see end node announcement from ZED and ZC send active endpoint request. ZED response endpoint and ZC send simple descriptor request. ZED send simple descriptor response and ZC send IEEE address request and Identify command. That's all. I don't see you send any other message in the sniffer log.
  • Hi Yikai,
    Thanks for the support and motivation given to try myself for storing end device information and sending data to the coordinator based on your line by line guidance. Now i am able to store end device address and use this address to send data from coordinator to the end device when requested by sending command from hyper terminal as per my final application design.

    End device address is getting stored in dev_list array. As i am using NV_RESTORE so that end device address should not change at power off condition. But i have one doubt. If new end devices comes in the range of coordinator(coordinator in allow bind mode) then it will store its address information and in this way array will get full even if i don't want that new device to join unless and until it is authorized to bind.
    Is there any way by which we can allow end devices to bind only when its authorized to do so?
  • You can use NLME_PermitJoiningRequest to disable permit join on ZC so the unwanted devices won't associate with coordinator.
  • I will try to get details about that function and implement it.
    If end device is in sleep mode then will coordinator be able to send data? Is it possible to do like this. When data is sent from coordinator to the end device and at that time if the sensor is in sleep mode then it wakes it up so that end device will be able to respond to the request sent by coordinator.
  • Basically, the message sent to ZED is kept on its parent node which is coordinator in your case. When ZED wakes up from sleeping, it will polling for its message.
  • How to bind ready made devices. Readymade in the sense zigbee devices like phillips hue manufactured by different companies. For our devices we can assign command id and other information but for these readymade devices how we can assign and know what it is?
  • If the device follows Zigbee HA profile, everything is the same. After you receive end node announcement, you request for active endpoint and its simple descriptor. After you done these, you can send command to the device.
  • Hi Kumar,
    The error "Broken options were detected in the project file. A backup copy will be made. check log window for details" is typically also seen when you are using an older version of IAR to open the project than the one used to create it. Can you check your IAR version is the same as one mentioned in the readme document along with the Z-Stack release. This should be for ex at C:/Texas Instruments/Z-Stack Home-1.2.1/Z-Stack Core Release Notes.txt
    Regards
  • Hi Suyash,
    thanks for this valuable information as i was trying a lot to eliminate this type of error but couldn't do so. I will try and have a look at it whether the problem is solved.
  • Hi yikai,
    When a data is received through uart, i want to send command to the end device like if 0x01 is received then i should send command for sensing temperature. My question is

    (1)How do we set an event? I want to set this event in uartRXcb. Do i need to set new task in

    void osalInitTasks( void )
    or
    set event using osal_start_timerEx( )
    or
    osal_set_event() function.
    I am confused which one to use.

    (2) Same way where i can process this event for sending command

    in UINT16 SAPI_ProcessEvent( byte task_id, UINT16 events ) or
    void zb_HandleOsalEvent( uint16 event ) function.
    I am using simple app.
    Thanks
  • 1. If you need a delay to start event, you have to use osal_start_timerEx( ). If you don't need delay, you can use osal_set_event() .
    2. You should create user define event and handle it in zb_HandleOsalEvent() according to the architecture of simple app.
  • Hi Yikai,
    Thanks for your quick reply. I don't need delay for my application and hence i will be using osal_set_event().
    After end node announcement is made, i am storing end device address in array. I am using this array information to send data from coordinator to the end device using unicast addressing mechanism.
    (1)My question is how should i send data from end device to the coordinator. Should i use broadcast addressing(coordinator address 0x0000) for this or i can use unicast. Now i am able to send data from end device to the coordinator using broadcast but i want to know whether its correct or not or i can use unicast for this also.
    (2)What to do for above case if i need to implement router in my application. I know if broadcast is to be done then i need to use 0xfffc as destination address.
  • 1. You should use unicast from ZED to ZC too.
    2. If you have to put ZR into your system, everything is the same. Z-Stack will handle message forwarding for you.
  • So if i should use unicast addressing then do i need to use 0x0000 as short address and clusterid of the coordinator to send data from ZED to ZC? am using zb_SendDataRequest() function for sending data.