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.

Where i can see hello world in generic App

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

Hello eveyone,

              I am new to the world of zigbee and cc2530, i have compiled generic app and flashed the hex file in EB. ZC is creating the network and ZED is joining the network. But how would i conform that, both were sending and receiving the message "hello world". 

  • If you use CC2530EM with SmartRF05EB, the hello world message will show on LCD when it receives the messahe.

  • But i didn't see any messages in the LCD. Just Enddevice ID and parents:0  is displaying.

  • Mr.Chen, can u help me. Steps i have done

    i)Installed Z-Stack

    ii)opened Generic App in IAR, compiled to hex file, one for coordinator and other for endevice

    iii)Downloaded hex in CC2530, Using SmartRf flash programmer.

    Need to do any other step?

  • No, you have done everything needed to test GenericApp. Please check if ZED joins ZC successfully. If ZED joins ZC, it will start to send message. You can also use packet sniffer to have a look on the messages in the air and might know what's wrong.

  • It is sending contiously data request . Not sending a data

    0121.packets.psd

  • From the sniffer log, your device is doing beacon not data request, and it have been joined a Zigbee network. You need to press the joystick on your end device and reboot it to clean up the network. Try this step to see if it works.

  • No, End device joined the network, i got Enddevice ID, If you scroll down, you see the data request

  • Here is Video 

  • No, I have check your sniffer log again. It contains no data request. Please do what I have suggested to you. Press the joystick on your end device and reboot it to clean up the network. Or erase the flash on end device by flash programmer , reprogram the flash, and test again.

  • I reprogrammed the flash and pressed the joystick  also, Once i got hello world rcvd, Then i reset it again, I didn't receive any message. Then i pressed the joystick, LED 1 Blink for some time.  Then also same behavior. Plz help me, how to overcome this. The latest log is 6560.packets.psd

  • Thank you Mr.chen finally i got the output. But, this app tells for every 5 seconds, it is sending a msg, but i want some changes, how can i do?

    1)Instead of 5 sec i need to change 30 sec

    2)Don't want press joy stick to press for binding, it should bind automatically. i know ZDP_bindReq for binding. But where should i add this function

    3)Only ZED should send message not ZC.

    4)ZC should receive and display in LCD and clear it after 5 Sec. Then After 30 sec, again ZED will send message and ZC will Display that message in LCD and clear the LCD after it displays the message. This should happen contiously.

    5)Which cluster is used in generic for sending a string? If i want to send hex value, does i need cluster?

  • 1. You can change "#define GENERICAPP_SEND_MSG_TIMEOUT   5000" to "#define GENERICAPP_SEND_MSG_TIMEOUT   30000".

    2&3. Replace the following code  in "ZDO_STATE_CHANGE: case" in GenericApp_ProcessEvent().

            case ZDO_STATE_CHANGE:
              GenericApp_NwkState = (devStates_t)(MSGpkt->hdr.status);
              if ( (GenericApp_NwkState == DEV_END_DEVICE) )
              {
          dstAddr.addrMode = AddrBroadcast;
          dstAddr.addr.shortAddr = NWK_BROADCAST_SHORTADDR;
          ZDP_MatchDescReq( &dstAddr, NWK_BROADCAST_SHORTADDR,
                            GENERICAPP_PROFID,
                            GENERICAPP_MAX_CLUSTERS, (cId_t *)GenericApp_ClusterList,
                            GENERICAPP_MAX_CLUSTERS, (cId_t *)GenericApp_ClusterList,
                            FALSE );

              }
              break;

    Also, replace the following code  in "Match_Desc_rsp: case" in GenericApp_ProcessZDOMsgs().

        case Match_Desc_rsp:
          {
            ZDO_ActiveEndpointRsp_t *pRsp = ZDO_ParseEPListRsp( inMsg );
            if ( pRsp )
            {
              if ( pRsp->status == ZSuccess && pRsp->cnt )
              {
                GenericApp_DstAddr.addrMode = (afAddrMode_t)Addr16Bit;
                GenericApp_DstAddr.addr.shortAddr = pRsp->nwkAddr;
                // Take the first endpoint, Can be changed to search through endpoints
                GenericApp_DstAddr.endPoint = pRsp->epList[0];

                // Light LED
                HalLedSet( HAL_LED_4, HAL_LED_MODE_ON );
                 // Start sending "the" message in a regular interval.
                osal_start_timerEx( GenericApp_TaskID,
                                    GENERICAPP_SEND_MSG_EVT,
                                    GENERICAPP_SEND_MSG_TIMEOUT );
             }
              osal_mem_free( pRsp );
            }
          }
          break;
    4. You can try to start a timer event to wake up after 5 seconds in GenericApp_MessageMSGCB and clean up the LCD in that event.

    5. The cluster ID is not following any Zigbee profile. It is just  a example to demo Zigbee like network. You need a cluster no matter what you want to send in ZStack.

    I think you are not familiar with Zigbee network and HA profile. I would suggest you to read the book "Zigbee Wireless Network" and related Zigbee spec.

  • Thank you so much Mr.Chen, but i want to use  ZDP_bindReq for binding. After binding, then i have to send the message. By the way, i am started to read Zigbee Wireless, but if you suggest how to use ZDP_bindReq, i will get some confident. I have seen Z-stack API. They defined parameters. I understand that. If u tell, If i want to use in this App, Then where i have to use.

  • How can i clear LCD? There is no API in HAL to clear the LCD.

  • You can use the following code to clear LCD.

    HalLcdWriteScreen("                ","                ");

  • Thank you so much Mr.Chen, but i want to use  ZDP_bindReq for binding. After binding, then i have to send the message. By the way, i am started to read Zigbee Wireless, but if you suggest how to use ZDP_bindReq, i will get some confident. I have seen Z-stack API. They defined parameters. I understand that. If u tell, If i want to use in this App, Then where i have to use.

  • For example, C stands for coordinator and A stands for ZED. If you want to use ZDP_BindReq to bind A to C from C. You can issue ZDP_BindReq from C with the following parameters.

    DstAddr: short address of A.

    SourceAddr: IEEE address of A

    SrcEP: endpoint of A

    DestinationAddr: IEEE address of C

    DstEP: endpoint of C

  • afStatus_t ZDP_BindReq( zAddrType_t *dstAddr, byte *SourceAddr,
    byte SrcEP, byte ClusterID, byte *DestinationAddr, byte DstEP, byte SecuritySuite );

    1)Why SourceAddr is IEEE address of A, it should be IEEE adfudress of C only know?Since it is sending data to A. Same thing SrcEP and DstEp.

    2)So i can use ZDP_Bind Req instead of  ZDP_MatchDescReq in ZED and i use send with af_DataReq, right?

    3)What will be cluster ID in binding? If i need to transfer 2 GPIO's data, I need to use ZDP_BindReq twice with different cluster id?

  • 1. Yes, the SourceAddr and DestinationAddr should be reversed if you want to send message from C to A.

    2. Yes.

    3.  The cluster ID depends on what your application is. If you just want to transmit two GPO, you could use on/off cluster.

  • If i use temperature and humidity sensor for monitoring Then would i send on/off cluster?

  • Then, you should use temperature and humidity cluster.

  • That is my Question, Since  ZDP_BindReq need  byte ClusterID. Which Cluster Id i need give for Binding? or else to Send Each Sensor Data. i need Bind with Respective ClusterID

  • In general, temperature and humidity are separative clusters and you should send ZDP_BindReq twice. However, your ZED can send only one of two clusters if your ZED reports temperature and humidity to the same destination.

  • As you said ZDP_BindReq we need to give the dstAddress and Source Address Different, I tried this, But binding is not happening. I have done following step.

    1)For sending a data from ZC to ZED, i did ZDP_BindReq according to your suggestion.

    DstAddr: short address of ZED.

    SourceAddr: IEEE address of ZED

    SrcEP: endpoint of ZED

    DestinationAddr: IEEE address of ZC

    DstEP: endpoint of ZC

    Then i have tried this also

    2)For sendind a data from ZED to ZC, i used 

    ZDP_EndDeviceBindReq

    dstAddr:                       Short Address of ZC
     LocalCoordinator:    IEEE address of ZED
     ep                          :     enpoint of ZED
    uint16 ProfileID,   :     Profile ID
    InClusterList,        :     InCluster list of ZED
    OutClusterList,     :     ZED
    SecuritySuite         :     Void(NULL)

    Can you correct me,if i am wrong in these two points

  • 1. For sending data from ZC to ZED, the parameters should be:

    DstAddr: short address of ZC.

    SourceAddr: IEEE address of ZC

    SrcEP: endpoint of ZC

    DestinationAddr: IEEE address of ZED

    DstEP: endpoint of ZED

    2. For sending data from ZED to ZC, you want to use ZDP_EndDeviceBindReq or ZDP_BindReq?

  • Any thing, i thought  ZDP_EndDeviceBindReq is for sending Data from ZED to ZC. By the Way, what is the Diffrence between These two?. If i use ZDP_EndDeviceBindReq. Then, the parameter which i have mentioned in prev post is correct?

  • ZDP_EndDeviceBindReq is issue from two devices respectively to coordinator that make these two device bind each other. The parameters can be reference in SmapleLight project and listed in the followings:

        // Initiate an End Device Bind Request, this bind request will
        // only use a cluster list that is important to binding.
        dstAddr.addrMode = afAddr16Bit;
        dstAddr.addr.shortAddr = 0;   // Coordinator makes the match
        ZDP_EndDeviceBindReq( &dstAddr, NLME_GetShortAddr(),
                               SAMPLELIGHT_ENDPOINT,
                               ZCL_HA_PROFILE_ID,
                               ZCLSAMPLELIGHT_BINDINGLIST, bindingInClusters,
                               0, NULL,   // No Outgoing clusters to bind
                               TRUE );

  • Thank you, I got it,  ZDP_EndDeviceBindReq should use if two End device need  to share data or can also be use as comm between ZC and ZED if both sends ZDP_EndDeviceBindReq, right? 

    Then for my case it is better to use ZDP_BindReq. 

    Inform me, if still i am wrong.

  • There are details about EndDeviceBindReq and BindReq in ZigBee Specifications and I suggest you to read it thoroughly to understand more differences about them.