Hello,
I am using a CC2530 and ZStack 2.3.1.
I have registered for IEEE_addr_rsp and NWK_addr_rsp
ZDO_RegisterForZDOMsg( zclGateway_TaskID, IEEE_addr_rsp );ZDO_RegisterForZDOMsg( zclGateway_TaskID, NWK_addr_rsp );
and the reponse for ZDP_IEEEAddrReq(shortAddr, ZDP_ADDR_REQTYPE_SINGLE, 0, 0) is processed by my code.
But for ZDP_NwkAddrReq(pointer, ZDP_ADDR_REQTYPE_SINGLE, 0, 0) there is no response.
I was not able to find a solution for this problem, so I would be glad if somebody can help me out.
Sorry I have made mistake about the network setup
I have one coordinator and 2 end devices.
Thanks
Risto
Hi Risto,
no problem for asking, I'm glad if I can help.
Ok, so first, do you have cc2530 interface specification pdf? It has all commands for communication with cc2530. So the coordinators network address is 0x0000 by default because it is coordinator. So you just send ZDO_IEEE_ADDR_REQ to address 0x0000, with ReqType 0x01 (this will tell that in response, all associated devices will be in) and start index 0. In response you will get all the devices asocciated to this coordinator. sou if you have routers in your network, you will have to send ZDO_IEEE_ADDR_REQ, because some devices are asocciated with that routers and not just coordinator. In your case you probably have only one router and it is coordinator and sending this request to coordinator will give you network addresses of both of your devices.
When you get list of those network addresses you can do what ever you want with them. Showing them on some lcd screen is not part of Zigbee so i cannot help you with that.
Just ask...
Marko
Thank you for your help Marko. I will try this out right now :)
Hi Marko,
Works very nicely. Thank You so much for your help!
Sorry to bother you again but I have new challenge in front of me . So I have a list of all NWK addresses of the end devices some global variable. My data is coming from the UART into the ZigBee app. At eah data package I check and parse the string so for example if I have 01 in my data package I would like to send this package to the 1 st end device on the list, 2 the second etc. I have tried setting up the address something like this:
static void PWMControl_ProcessZDOMsgs( zdoIncomingMsg_t *inMsg ){
case IEEE_addr_rsp: { pRspNew = ZDO_ParseAddrRsp(inMsg); if ( pRspNew ) { if ( pRspNew->status == ZSuccess) { App_TxAddr.addrMode = (afAddrMode_t)Addr16Bit; App_TxAddr.endPoint = APP_ENDPOINT; } } } break;
}
//then in my own function I have something like this:
//code for parsing the string from the PC then I set up:
App_TxAddr.addr.shortAddr = pRspNew->devList[end_device];
This is working only in the first step and it sets the addr to the end device where the first input for the end_device has been made. I can set up either the first or the second but I cant dynamicly change at each recieved string from the PC to which end device the addresing should be.
Could you please help me with this or tell me which functions I should take a look?
Thank you so much for your help.
first sorry for the late answer I'm busy lately. and I'm not sure if I'm deconcentrated so much but I really don't understand your question. If you could try to simplify it a bit...
From my understanding of ZigBee, the
ZDP_NwkAddrReq(pointer, ZDP_ADDR_REQTYPE_SINGLE, 0, 0)
command should work also with sleeping end device (and it actually does on different ZigBee stacks). What I saw with the sniffer is that when the concentrator sends its network address discovery request, this packet is sent in broadcast to all non-sleeping devices (NWK dest: 0xFFFD) instead of generic broadcast (0xFFFF). The stack for some reasons exclude the sleeping end devices from the search.
Has anyone found a solution for this without having to manually send the request to each device?
If devices won't answer to ZDO_NWK_ADDR_REQUEST because they sleep, why should they answer to IEEEAddrRequest???
They should reply anyway, their parent should buffer the request for them and pass it over at the next data poll. At least this is what I saw in other ZigBee stacks. The packet should exit with a 0xFFFF destination address.
As far as I know router will buffer data for few seconds, what in many cases is not enough. Also if we ignore that there is some timeout for buffered commands, why shouldn't we send nwk_request in the same way and wait data poll? I've tried to send nwk_request to devices that are awake (I manually woke them up) and no answer from end devices, just routers will answer.