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.
Hi,
I searched this forum but couldn't find the answer to this question: I am using two CC2530 custom development boards with Z-Stack and trying to bind those two boards and use SampleLight and SampleSwitch example applications. One of the boards is the Coordinator (sample light) and one is an End-Device (sample switch). I am starting end-device binding on both devices, but the end-device doesn't receive any answer. Is it possible to use the Coordinator for this, since it is also the one to coordinate the end-device binding process ?
I have studied the problem and looks like:
- it should be possible to bind to a Coordinator, because it is also a Router
- the real problem now is that the ED doesn't receive ZDP responses, even if it registered for callback.
I have tried with IEEEAddrReq and with MatchDescReq, I have seen that the Coordinator receives the request, but the reply doesn't reach the ED. Which is the first entry point that I should check to see if the message arrives ? I don't have a sniffer available (yet) to see what is the message sequence.
Investigating further with a sniffer, I see the message doesn't leave the Coordinator, although the debugger shows the message was sent successfully to AF layer, and has the fields set correctly. Could somebody point me to the right direction ? I cannot debug below the APSDE_DataReq function, which return SUCCESS...
Use this function in coordinator
ZDP_BindReq()
ZDP_BindReq( zAddrType_t *dstAddr, byte *SourceAddr,
byte SrcEP, byte ClusterID, byte *DestinationAddr, byte DstEP, byte SecuritySuite );
where dstAddr is an end device address. SourceAddr is also your ED address (they are different type!)
srcEP is the endpoint where the switch is configured to in ED. Cluster is switch's cluster ID in ED
destinationAddr is coordinator Addr. Security u can disable dy default...
And in end device process this with the function
ZDP_BindRsp()
More in Z-Stack API document
Thank you Sven, I will try that when I get to it.
Now trying to get an IEEE response from the Coordinator, but the response doesn't leave the device. Please see the description of the problem in my third post on this topic. Do you have an idea why that happens ?
hard way to make the device leave is:
find out the IEEEaddrrsp function
include OSAL_Nv.h file
and write in that function osal_nv_reset();
Device erases network data makes reset and bang! gone :)
Sorry, I wasn't clear in my question. I don't want the device leave the network, but I started with trying to get a Match Descriptor reply from the Coordinator, without success. I then tried getting an IEEE Address response, still without success. I can see the request is transmitted on the air, the Coordinator sends the response to the MAC, but nothing is sent back. It makes no sense, because the packet structure is correct and loaded with correct data...
Does anybody have an idea why APSDE_DataReq would return SUCCESS but nothing would be transmitted ? Packet req is:
d6 16 0b 00 0b 80 bc 7d 02 00 00 20 06 01 80 00 00 0c 00 9d 05 04 00 02 01 1e 8e 02
I seem to ask the wrong questions or is really nobody reading these forums ? I was expecting that some support engineers from TI will be reviewing all questions, and answer to them. I am stuck with this problem, and it's a showstopper :(
Found the cause for why the message doesn't leave the Coordinator: it waits for the ED poll to send the message (RX_ON_WHEN_IDLE set to FALSE). If I set it to TRUE, the message is sent right away. Now the problem is different: no polling from ED, although defining NWK_AUTO_POLL and having POLL_RATE set to 5000. Any help on that ?
Hi,
Suggest you can check if zgPollRate is set to 5000 after your ED joins ZB network of coordinator. zgPollRate should be the same as your POLL_RATE setting. If zgPollRate is not equal to your POLL_RATE setting or equals to zero, there must be something wrong.
Regards!
YK Chen
hi Yikai Chen,
i have the same problem, but in my case i sent a ZDP_BindReq(), and in bind_rsp; i check if the bindins was well done by ( if (ZDO_ParseBindRsp( inMsg ) == ZSuccess ))
but it's failled, i don't know why.
i want just bind from the coordinator to the end device for temperature cluster.
i need your helps please.
there are any fuctions to make a binding from the coordinator ?
Thx.
Do you register Bind_rsp for ZDOMsg using the following line?
ZDO_RegisterForZDOMsg( zclSampleSw_TaskID, Bind_rsp );
Hi,
yes i added it in my app_init () function.
but i receive a response, and when i check if the binding was well done ( if (ZDO_ParseBindRsp( inMsg ) == ZSuccess )), it's failled.
Could you show me how you use ZDP_BindReq and How do you process in your ProcessZDOMsgs?
hi,
in my function app_init( byte task_Id), i put this register " ZDO_RegisterForZDOMsg( zclSampleSw_TaskID, Bind_rsp ); " and when i push a button i send a bind request by this function :
/************************************************************************************/
dstAddr->addrMode = Addr16Bit;
dstAddr->addr.shortAddr = 0; // Coordinator makes the match
destinationAddr.addrMode = afAddr64Bit;
destinationAddr.addr.shortAddr = 0;
for (i=0; i<8;i++) destinationAddr.addr.extAddr[i] = tableau[i];
ZDP_BindReq( &adresse, SourceAddr, SAMPLESW_ENDPOINT_HA,
ZCL_CLUSTER_ID_MS_TEMPERATURE_MEASUREMENT, &destinationAddr, 6, TRUE );
i catch "adresse" when the end device joind the network
/*************************************************************************************************/
for the ProcessZDOMsgs i proccess it by this function :
void zclSampleSw_ProcessZDOMsgs( zdoIncomingMsg_t *inMsg )
{
adresse = inMsg->srcAddr;
zclCfgReportCmd_t cfgRptCmd;
HalLedSet ( HAL_LED_4, HAL_LED_MODE_ON );
HalLcdWriteString ( "zdo ", 2);
switch ( inMsg->clusterID )
{
case Bind_rsp:
{
//result = ;
if (ZDO_ParseBindRsp( inMsg ) == ZSuccess )
{
HalLcdWriteString ( "succes", 3);;//HalLedSet( HAL_J4_P2, HAL_LED_MODE_ON );
}
else if ( ZDO_ParseBindRsp( inMsg ) == 0x1)
{
HalLcdWriteString ( "not supported", 3);;// HalLedSet( HAL_J4_P2, HAL_LED_MODE_OFF );
}
else if ( ZDO_ParseBindRsp( inMsg ) == 2)
{
HalLcdWriteString ( "table full", 3);;// HalLedSet( HAL_J4_P2, HAL_LED_MODE_OFF );
}
else
{
HalLcdWriteString ( "it's weird", 3);// HalLedSet( HAL_J4_P2, HAL_LED_MODE_OFF );
}
I see you use "destinationAddr.addrMode = afAddr64Bit;" and I doubt this is the problem. Since your binding destination is coordinator, you can use short address 0x0000.
destinationAddr.addrMode = Addr16Bit;
destinationAddr.addr.shortAddr = 0;
By the way, do you see your coordinator can receive temperature report from your device, which means your binding is success.
Hi azeddine,
I have make some mistake in my reply. Since you use ZDP_BindReq, the message callback should be in the case "Bind_req/Unbind_req" of ZDApp_ProcessMsgCBs, which is located in ZDapp.c. You can have a look at the source code first and try to trace it. After you send ZDP_BindReq, you should receive Bind_req in ZDApp_ProcessMsgCBs and you can check the binding status in ZDO_ProcessBindUnbindReq().