Dear all,
I use Z-Stack-CC2530 to develop a position system.
In SampleApp, I use pkt->rssi to read the RSSI.
But, the RSSI is not between source and destination.
How should I get RSSI from source to destination?
Hi,
That depends on several scenarios, but my guess is you are following the next scenario:
An End Device (with unknown position - in other words a bind node) broadcasting a message
to nearest routers, then routers forward extracted RSSI values to concentrator node, where the
position is calculated from received data (in case where concentrator node used as gateway,
these calculations can be performed by the host)
So if this is your scenario you can do the following to get true values of RSSI:
Br,
Igor
Dear,
Sorry, I don't understand dummy message.
I just use a coordinator, a router and a end-device.
The end-device send a request to router.
Then the router send a message to end-device.
After receive the message, the end-device extracts RSSI values, and construct a new message.
Finally, the end-device send the new message to coordinator.
I use above-mentioned method to extract RSSI values, but the RSSI values is not between router and end-device.
It is between router and coordinator.
I have two problems, now.
1.Is the method error?
2.How should I extract RSSI values between router and end-device or end-device and end-device?
This method won't work with many routers, since all the messages addressed to end device must be
routed through the parent, hence the wrong RSSI values in your case (probably the parent of the end
device in your case is the coordinator).
So basically, in this very simple network of yours (coordinator, one router and a single end device) you
can ensure that the router will also act as parent (not coordinator):
Dummy message is a message where the content of data is not important, what is important is the
destination of this message, an address of the sending device and of course the RSSI value.
I understand what you mean.
Can one end-device join two router at one time?
Because I need three reference node positioned one bind node.
The reference node is router and the bind node is end-device.
Best regards,
It is impossible to join two router at one time.
OK, I see.
I will try it.
Thanks you for your answer and suggest.
Can I set scan range of the router or the coordinator?
If I can. How should I do?
What you mean by scan range?
Assume the distance is 1m between the router and the end device.
The router can discover the end device and the end device join the router.
Can I set the distance between the router and the end device, in Z-Stack ?
I want to set the distance that the end device join the router.
Dennis
Well, there is no direct way that I'm aware of. The indirect way is to reduce
You can read about changing transmit power of device in "Z-stack API.pdf"
section 3.5.1
I increase a router called in the zigbee network.
So, it has two router, one is R1 and the other is R2.
Now, the parent of the end device is the R1.
I can extract RSSI value between the R1 and the end device.
But, I can not extract RSSI values between the R2 and the end device.
Well that is a normal behavior of ZigBee network, all messages addressed
to a specific ZED will be routed to ZEDs parent, then the parent will send this
message to ZED.
So, your question is how to overcome this behavior?
Well, one way is to implement the scenario I have described in my first post in
this thread. You may try it. :)
Dear Igor,
I have been try it.
If the parent of end device is R1. I can extract RSSI values between the R1 and the end device. The RSSI values is right.
But, when I extract RSSI values between the R2 and the end device, the RSSI values is error.
If the parent of end device is R2. I can extract RSSI values between the R2 and the end device. The RSSI values is right, too.
But, when I extract RSSI values between the R1 and the end device, the RSSI values is error, too.
I need the RSSI measured the distance between R1 and end device, and the distance between R2 and end device.
I have to extract RSSI values between R1 and end device, and between R2 and end device at one time.
So, my question is how to get right RSSI values between R1 and end device, and between R2 and end device?
I use CC2530 chip. The ZStack version is ZStack-CC2530-2.3.0-1.4.0.
In the zigbee application layer, I use pkt->rssi to extract RSSI values.
It sounds like the ZED isn't broadcasting this message, in other words, in your ZED project you should use
AF_DataRequest() function as follows:
RTR_App_DstAddr.addr.shortAddr = 0xFFFC; //Routers and coordinatorRTR_App_DstAddr.addrMode = (afAddrMode_t)AddrBroadcast;RTR_App_DstAddr.endPoint = RTR_ENDPOINT;
AF_DataRequest( &RTR_App_DstAddr, &XZED_App_epDesc,RTR_APP_CLUSTERID,someLen, (byte *)message, &ZED_App_TransID,AF_DISCV_ROUTE | AF_SKIP_ROUTING,1 );
Pay attention on lines marked with red:
The destination address should be of broadcast type (0xFFFC or 0xFFFD)
Addressing mode should be AddrBroadcast.
In options field, AF_SKIP_ROUTING must be ORed with other options (this flag
prevents from ZigBee to perform routing)
Radius field should be set to 1 (that means no broadcasting beyond the first wave).
I think that the problem is the parent of end device.
I use zb_SendDataRequest() function as follow:
void zb_SendDataRequest ( uint16 destination, uint16 commandId, uint8 *pData, uint8 len, uint8 radius ){ afAddrType_t dstAddr; /* 設置目的地址 */ if (destination == 0xFFFF) { // 廣播 dstAddr.addrMode = AddrBroadcast; dstAddr.addr.shortAddr = NWK_BROADCAST_SHORTADDR; //0xFFFF 資料封包將被傳送到網路中所有的設備 dstAddr.endPoint = SampleApp_epDesc.endPoint; if ( AF_DataRequest( &dstAddr, &SampleApp_epDesc, commandId, len, pData, &SampleApp_TransID, AF_DISCV_ROUTE, AF_DEFAULT_RADIUS ) == afStatus_SUCCESS ) { } else {
// Error occurred in request to send. } } else if (destination == 0xFFFC) { dstAddr.addrMode = (afAddrMode_t)AddrBroadcast;; dstAddr.addr.shortAddr = NWK_BROADCAST_SHORTADDR_DEVZCZR; //0xFFFC 廣播給協調者和全部的路由器 dstAddr.endPoint = SampleApp_epDesc.endPoint; if ( AF_DataRequest( &dstAddr, &SampleApp_epDesc, commandId, len, pData, &SampleApp_TransID, AF_DISCV_ROUTE | AF_SKIP_ROUTING, 1 ) == afStatus_SUCCESS ) { } } else { // 使用短位址 dstAddr.addrMode = afAddr16Bit; dstAddr.addr.shortAddr = destination; //shortAddr 目標設備位址 /* 設置端點 */ dstAddr.endPoint = SampleApp_epDesc.endPoint; /* 發送消息 */ if ( AF_DataRequest( &dstAddr, &SampleApp_epDesc, commandId, len, pData, &SampleApp_TransID, AF_DISCV_ROUTE, AF_DEFAULT_RADIUS ) == afStatus_SUCCESS ) { } else {
// Error occurred in request to send. } } }