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.

CC2650EMK: NLME_OrphanJoinRequest error code

Part Number: CC2650EMK
Other Parts Discussed in Thread: CC2538, CC2650, Z-STACK,


I've  Zigbee end devices ( CC2650) developed  based on Z Stack 1.2.2HA  which communicate with coordinator CC2538 .

I previously asked the following thread about NLME_NetworkDiscoveryRequest.

Do you get the same error about  NLME_OrphanJoinRequest?
Also, what are the other error codes and under what conditions do they occur?

Best Regards,
Yuya Murata

  • The return value could be

    1.MAC_SCAN_IN_PROGRESS  stands for there is scanning already in progress.

    2.MAC_NO_RESOURCES stands for no memory resource available.

    3.ZMacSuccess stands for scan success.

  • Hi, YiKai,
    Thank you for your reply.

    Does not this function occur ZNwkInvalidRequest?

    Best Regards,

  • AFAIK, this API doesn't return ZNwkInvalidRequest.

  • Thank you for your reply.

    I have a question about MAC_SCAN_IN_PROGRESS error.
    After how many seconds does the timeout occur?
    Does that error occur if NLME_OrphanNotification call before the timeout?

    Best Regards,

  • I couldn't understand your question well. All those NLME APIs are handled in Z-Stack and application developer shouldn't have to change those parts of source code. Can you elaborate what you mean to achieve?

  • Hi, YiKai

    I must get this ZED out into the world.
    This ZED must automatically connect to the ZC even in places with poor reception.
    However, there was a problem that BeaconRequest did not appear and ZED could not connect to ZC.
    The cause was found to be a ZNwkInvalidRequest error in NLME_NetworkDiscovery.
    My supervisor wondered if other functions (NLME_OrphanNotification and NLME_RejoinRequest) might have caused the error and not connecting to ZC. He thinks that this is the case.
    I need to explain to my supervisor that such things do not happen and am asking about each function.

    Best Regards,

  • Do you use sniffer to check what exactly happens over the air first?

  • Hi,

    I already got sniffer log and debug log when Beacon Reqeust does not appear.
    Please see the follow post.

    Other errors that may occur must be shown by the program and the specification of each function to indicate that the error will not occur/if it does occur, it can be dealt with.
    So I am asking for detailed specifications of these NLME_OrphanJoinRequest and NLME_RejoinRequest functions.

  • In that post, I had suggested you to use Switch_processZStackMsgs (using SampleSwitch as example) to check disconnect and other network state but you don't reply to me. Do you try it? By the way, it doesn't help at all to create so many posts for the same issue. I would suggest you to keep one for helping you.

  • CC2650EMK has not been purchased.
    Therefore, I cannot debug using SampleSwitch.
    Instead, we are debugging using the original circuit with the CC2650.
    For debugging, the processSysNwkInfoReadReq function in zstacktask.c has been modified.
    Variables in the z-stack are obtained by the app using zclport_getDeviceInfo and output serially.

  • It doesn't matter which example you are using. You must have your own processZStackMsgs  to check disconnect and other network state. Please check it first.

  • I changed processZstackMsgs  to be able to CATCH B events as follows.
    Is this what you want to do?

    static void TempSensor_processZStackMsgs(zstackmsg_genericReq_t *pMsg)
      System_printf("In processZStackMsg\r\n\0");
      case zstackmsg_CmdIDs_DEV_STATE_CHANGE_IND:
          // The ZStack Thread is indicating a state change
          zstackmsg_devStateChangeInd_t *pInd
            = (zstackmsg_devStateChangeInd_t *)pMsg;
          // Only process the state change if it actually changed.
          if(savedState != pInd->req.state)
            savedState = pInd->req.state;
            if((pInd->req.state == zstack_DevState_DEV_ZB_COORD)
               || (pInd->req.state == zstack_DevState_DEV_ROUTER)
                 || (pInd->req.state == zstack_DevState_DEV_END_DEVICE))
              // The device is part of a network, get the device's
              // network parameters.
              //pNwkInfo = zclport_getDeviceInfo(ztsEntity);
              if(pInd->req.state != zstack_DevState_DEV_END_DEVICE)
                // Change the default poll rate from 1 second to
                // the config setting in znwk_config.h
    #if defined (ZCL_EZMODE)
              zcl_EZModeAction(EZMODE_ACTION_NETWORK_STARTED, NULL);
    #if defined (ZCL_EZMODE)
      case zstackmsg_CmdIDs_ZDO_MATCH_DESC_RSP:
          zstackmsg_zdoMatchDescRspInd_t *pInd
            = (zstackmsg_zdoMatchDescRspInd_t *)pMsg;
          zclEZMode_ActionData_t actionData;
          ZDO_MatchDescRsp_t *pRsp;
          * Parse the Match Descriptor Response and give it to
          * the ZCL EZMode module to process
          pRsp = (ZDO_MatchDescRsp_t *)ICall_allocMsg(
                                                      sizeof(ZDO_MatchDescRsp_t) + pInd->rsp.n_matchList);
            pRsp->status = pInd->rsp.status;
            pRsp->nwkAddr = pInd->rsp.nwkAddrOfInterest;
            pRsp->cnt = pInd->rsp.n_matchList;
            memcpy(pRsp->epList, pInd->rsp.pMatchList,
            actionData.pMatchDescRsp = pRsp;
            zcl_EZModeAction(EZMODE_ACTION_MATCH_DESC_RSP, &actionData);
    #endif // ZCL_EZMODE
      case zstackmsg_CmdIDs_AF_INCOMING_MSG_IND:
          // Process incoming data messages
          zstackmsg_afIncomingMsgInd_t *pInd
            = (zstackmsg_afIncomingMsgInd_t *)pMsg;
          TempSensor_processAfIncomingMsgInd( &(pInd->req) );
        * These are messages/indications from ZStack that this
        * application doesn't process.  These message can be
        * processed by your application, remove from this list and
        * process them here in this switch statement.
      case zstackmsg_CmdIDs_AF_DATA_CONFIRM_IND:
      case zstackmsg_CmdIDs_ZDO_DEVICE_ANNOUNCE:
    	System_printf("ZDO_DEVICE_ANNOUNCE occured");
      case zstackmsg_CmdIDs_ZDO_NWK_ADDR_RSP:
      case zstackmsg_CmdIDs_ZDO_IEEE_ADDR_RSP:
      case zstackmsg_CmdIDs_ZDO_NODE_DESC_RSP:
      case zstackmsg_CmdIDs_ZDO_POWER_DESC_RSP:
      case zstackmsg_CmdIDs_ZDO_SIMPLE_DESC_RSP:
      case zstackmsg_CmdIDs_ZDO_ACTIVE_EP_RSP:
      case zstackmsg_CmdIDs_ZDO_COMPLEX_DESC_RSP:
      case zstackmsg_CmdIDs_ZDO_USER_DESC_RSP:
      case zstackmsg_CmdIDs_ZDO_USER_DESC_SET_RSP:
      case zstackmsg_CmdIDs_ZDO_SERVER_DISC_RSP:
      case zstackmsg_CmdIDs_ZDO_END_DEVICE_BIND_RSP:
      case zstackmsg_CmdIDs_ZDO_BIND_RSP:
      case zstackmsg_CmdIDs_ZDO_UNBIND_RSP:
      case zstackmsg_CmdIDs_ZDO_MGMT_NWK_DISC_RSP:
      case zstackmsg_CmdIDs_ZDO_MGMT_LQI_RSP:
      case zstackmsg_CmdIDs_ZDO_MGMT_RTG_RSP:
      case zstackmsg_CmdIDs_ZDO_MGMT_BIND_RSP:
      case zstackmsg_CmdIDs_ZDO_MGMT_LEAVE_RSP:
      case zstackmsg_CmdIDs_ZDO_MGMT_DIRECT_JOIN_RSP:
      case zstackmsg_CmdIDs_ZDO_MGMT_PERMIT_JOIN_RSP:
      case zstackmsg_CmdIDs_ZDO_MGMT_NWK_UPDATE_NOTIFY:
      case zstackmsg_CmdIDs_ZDO_SRC_RTG_IND:
      case zstackmsg_CmdIDs_ZDO_CONCENTRATOR_IND:
      case zstackmsg_CmdIDs_ZDO_NWK_DISC_CNF:
    	System_printf("ZDO_NWK_DISC_CNF occured");
      case zstackmsg_CmdIDs_ZDO_BEACON_NOTIFY_IND:
      case zstackmsg_CmdIDs_ZDO_JOIN_CNF:
    	System_printf("ZDO_NWK_JOIN_CNF occured");
      case zstackmsg_CmdIDs_ZDO_LEAVE_CNF:
    	System_printf("ZDO_LEAVE_CNF occured");
      case zstackmsg_CmdIDs_ZDO_LEAVE_IND:
      case zstackmsg_CmdIDs_SYS_RESET_IND:
      case zstackmsg_CmdIDs_AF_REFLECT_ERROR_IND:
      case zstackmsg_CmdIDs_ZDO_TC_DEVICE_IND:
      case zstackmsg_CmdIDs_DEV_PERMIT_JOIN_IND:

  • You can print pInd->req.state to check your device state.

  • I already print z-stack state in Sensor_process funtion as follow.
    I print z-stack state when event occur.

    ICallerrNo = ICall_wait(ICALL_TIMEOUT_FOREVER);
    	System_printf("In ICALL_WAIT\r\n\0");
    	System_printf("ICallErrNo = %d \r\n\0", ICallerrNo);
        if(ICallerrNo == ICALL_ERRNO_SUCCESS)
    	  System_printf("In ICALL_WAIT\r\n\0");
    	  pzDevInfo = zclport_getDeviceInfo(ztsEntity);
    	  dDevState = pzDevInfo->devState;

  • When there is state change, it will trigger your TempSensor_processZStackMsgs and you can print pInd->req.state in your TempSensor_processZStackMsgs.

  • Beacon Reqeust does not appear

    This could be due to erroneous network state, CSMA backoff, device lock-up, etc.  The first case is assumed.  Join requests will fail with ZNwkInvalidRequest if _NIB.nwkState is NWK_ENDDEVICE since it is already part of a network.  Rejoin requests return ZNwkInvalidRequest if the router chosen for joining while obtaining the network descriptor matches the devices own short address, an unexpected result.  As YK mentioned, resolution of this matter has been made more complicated by the multiple E2E threads generated, and more robust console logs and application debug processes should be investigated.


  • Hi, Ryan
    Thank you for your reply.

    I decided to address _NIB.nwkState = NWK_ENDDEVICE issue with a reboot.

    Future replies will be posted to the original article.

    Best Regards,