| Author |
Message |
|
|
Posted: Apr 30, 2010 - 08:34 AM |
|

Joined: Apr 20, 2010
Posts: 11
|
|
Hi,
I have network of custom zigbit nodes using the 2.4GHz Zigbit modules and the BitCloud software stack.
Currently I am having an issue gathering RSSI values.
I understand that the RSSI value is retrieved from the last received packet from the neighbor node in question. So I do a quick send and receive ("ping") to the node and then attempt to read the RSSI value.
This works in some cases, and not in others. ie. the problem is intermittent. I constantly receive "0" for the RSSI value instead of an typical reading
I first believed that the problem may be related the "pinging" packet being routed through other nodes in the network, hence receiving the information, but not getting it directly from the node. So I have set the radius=0 for that particular application endpoint to attempt to stop the packet from being routed around the network. Unfortunately, this does not solve the problem. The issue suggests that the packet is still "hopping" around the network even though I am trying to set it to 0.
This issue does not occur to all nodes in a network, it will occur between some node links, and other node links will collect RSSI as expected.
Does anyone know what may be going wrong here?
Thanks. |
|
|
| |
|
|
|
|
|
Posted: Apr 30, 2010 - 10:02 AM |
|

Joined: Jun 17, 2008
Posts: 454
Location: Meissen, Germany
|
|
Do read the sub register RSSI (in AT86RF230: 0x06[4:0]) or do you read the register PHY_ED_LEVEL (0x07[7:0]) ?
The RSSI register is continously updated every 2us, so when you read it at the TRX_END_IRQ, then you read the RSSI value of the unsused channel.
If you want to know the energy during reception of the last frame, read the register PHY_ED_LEVEL at the TRX_END_IRQ. With each frame reception a new ED measurement is started which averages the RSSI values over 128us.
Another point, the mininum ED level displayed in the register is -91dBm (RSSI_BASE_VALUE in the datasheet), the receiver is able to decode frames at energy level below -101 dBm. So you may read a 0 from the register when a frame is received.
Literatur Link:
AVR2009: AT86RF230 – Software Programming Model
(edit: corrected RX sensitivity value) |
|
|
| |
|
|
|
|
|
Posted: Apr 30, 2010 - 02:32 PM |
|


Joined: Apr 15, 2009
Posts: 4857
Location: San Jose, CA
|
|
|
junglistdan wrote:
So I have set the radius=0 for that particular application endpoint to attempt to stop the packet from being routed around the network.
radius=0 means 'use maximum radius', you need to set 1.
Be sure to have Neighbor Table big enough to hold information about all possible neighbors. |
|
|
| |
|
|
|
|
|
Posted: Apr 30, 2010 - 03:46 PM |
|

Joined: Apr 20, 2010
Posts: 11
|
|
Thank you for your responses!
Alexru - That sounds like the solution, I will apply the changes later today and post my results.
Uracolix - I am using the BitCloud software stack, so I am using a provided method of getting the RSSI. If Alexru's suggestion does not fix the problem, I will dive into the BitCloud stack to find out where it is getting the RSSI value from. |
|
|
| |
|
|
|
|
|
Posted: May 01, 2010 - 01:01 AM |
|

Joined: Apr 20, 2010
Posts: 11
|
|
I made the following changes:
radius is now set to 1.
someDataRequestStructure.radius=1
neighbor table size is now set to 25.
CS_NEIB_TABLE_SIZE=25
The issue is still occuring with these changes with only three nodes in the network.
I am using JTAG to debug the system. So I have made sure that the "pinging" packet is being received correctly before reading the RSSI value using,
ZDO_GetLqiRssi(&static_var)
The nodes are all within one square meter and I have tested their Tx power with a Microchip Zena zigbee packet sniffer and everything seems fine.
I will look deeper into the BitCloud stack, but I am very hesitant to make any changes because I beleive it is something that I am doing wrong.
Any ideas? |
|
|
| |
|
|
|
|
|
Posted: May 01, 2010 - 06:59 AM |
|


Joined: Apr 15, 2009
Posts: 4857
Location: San Jose, CA
|
|
|
junglistdan wrote:
Any ideas?
We have holiday until Tuesday, after that I'll look into this issue. |
|
|
| |
|
|
|
|
|
Posted: May 02, 2010 - 09:22 PM |
|

Joined: Apr 20, 2010
Posts: 11
|
|
Thanks Alexru, I hope you enjoy your long weekend.
Further update:
I have now verified that the packet is not being routed around the network using the Zena packet sniffer. The "pinging" packet IS being sent and returned directly by the neighbor node before attempting to read the RSSI (and reading "0").
The RSSI values shown by the packet sniffer are "strong" values from anywhere between -20dB and +4dB. When I do get "good" values from BitCloud, they are different to these values by some offset (around 60dB I think). I think that I have read that this behavior is "normal". But, maybe I am wrong and this is part of the issue.
I'll keep investigating and post any findings.
Thanks,
Dan. |
|
|
| |
|
|
|
|
|
Posted: May 04, 2010 - 09:11 AM |
|


Joined: Apr 15, 2009
Posts: 4857
Location: San Jose, CA
|
|
Here is heavily modified pingpong.c file which demonstrates how RSSI reading works and how you can control output power.
Just put it in place of original pingpong.c from SDK and add CS_NWK_ADDR = 0 or 1 to Configuration file (0 is coordinator, 1 is router).
What application does: after starting the network and waiting for router to join coordinator starts to send "pings" to router, in reply router sends RSSI of coordinator's packet. After receiving reply coordinator sends RSSI of reply and reported RSSI of request. So you know RSSI on both sides.
Additionally buttons regulate TX power value.
In the output I see that RSSI value changes according to TX power pretty linearly. |
|
|
| |
|
|
|
|
|
Posted: May 10, 2010 - 01:46 AM |
|

Joined: Apr 20, 2010
Posts: 11
|
|
I am still beating my head over this issue.
Thank you for the code Alexru. However, my program also works when only two nodes are present. I have modified the code you posted to include three or more nodes as a token ring, and I get many '0' RSSI values. I have also removed the token ring and used a broadcast packet to trigger each node to get the RSSI from the broadcast, and it still gets many '0' values.
I am starting to believe there may be a bug in BitCloud. I am still hoping it is not, because that doesn't help me.
Is there anything that may effect the RSSI get when registering the endpoint? Or at any other point during initialization? (besides radius=1) |
|
|
| |
|
|
|
|
|
Posted: May 10, 2010 - 08:07 AM |
|


Joined: Apr 15, 2009
Posts: 4857
Location: San Jose, CA
|
|
|
junglistdan wrote:
I have modified the code you posted to include three or more nodes as a token ring,
Ok, now we have code that works well on both sides. I will modify my part to work as a token ring and check what may be wrong.
junglistdan wrote:
I am starting to believe there may be a bug in BitCloud. I am still hoping it is not, because that doesn't help me.
It is rather unlikely, but if it is I believe we'll be able to fix it in the upcoming release. |
|
|
| |
|
|
|
|
|
Posted: May 11, 2010 - 06:34 AM |
|


Joined: Apr 15, 2009
Posts: 4857
Location: San Jose, CA
|
|
| RSSI from what nodes you are expecting to get in a token ring? Please describe your scenario or send modified source code. |
|
|
| |
|
|
|
|
|
Posted: May 11, 2010 - 06:51 AM |
|

Joined: Apr 20, 2010
Posts: 11
|
|
To make things simpler for this issue, I have removed the token ring.
The nodes now work as follows:
(Routers and Coord)
1. Join Network
2. Start Ping Timer (500ms, repeat)
3. On timer fired, send ping packet broadcast (dstAddr=0xFFFF) w/radius=1
4. On ping packet Rx, get RSSI from ping packet source and send RSSI value and source data to coordinator
5. (Coord only) On RSSI data Rx, send data via UART.
With this simple system, many RSSI=0 are still being observed.
Since my HW doesn't use the all of the Bitcloud HAL (GPIO and IRQ 6&7 only diff), I will attempt to start fresh from your posted code to give you an example if you don't beat me to it. |
|
|
| |
|
|
|
|
|
Posted: May 11, 2010 - 07:12 AM |
|


Joined: Apr 15, 2009
Posts: 4857
Location: San Jose, CA
|
|
Here is modified source. I don't see any 0 RSSIs. Can you confirm that with this particular source you get zeros? What hardware do you use? Do both columns contain zeros or only one of them?
On coordinator I constantly get output like
Code:
207 212
210 212
209 213
|
|
|
| |
|
|
|
|
|
Posted: May 14, 2010 - 11:34 PM |
|

Joined: Apr 20, 2010
Posts: 11
|
|
Thanks Alexru,
That code works well for me also, but that is only collecting RSSI from each node and the Coordinator.
The issue mainly arises when many router nodes are attempting to collect RSSI information off of each other and pass it back to the coordinator.
I have attached code that attempts to do this. When I run it on my hardware using 3 or more router nodes, it produces many '0' RSSI values.
Once this code is loaded onto a node, it should automatically jump on the network and start receiving the broadcast packet and send the RSSI value to the coordinator. A timer is set up to generate a broadcast "ping" packet on a recursive timer fire. The coodinator then receives the RSSI information packets and sends the info out via UART.
It will be interesting to if this issue occurs on your hardware. |
|
|
| |
|
|
|
|
|
Posted: May 15, 2010 - 08:40 AM |
|


Joined: Apr 15, 2009
Posts: 4857
Location: San Jose, CA
|
|
|
|
|
|
|
Posted: May 17, 2010 - 06:48 AM |
|


Joined: Apr 15, 2009
Posts: 4857
Location: San Jose, CA
|
|
Here what is going on - when node receives broadcast frame from some address and it has no record in neighbor table for this address it can't update RSSI field. This will happen in situation like this: R1 - C - R2. R1 knows nothing about R2, so when R1 receives packet from R2 it will indicate it, but won't update neighbor table.
In ZigBee networks routers and coordinator periodically (every 15 seconds) send special frame (Link Status) in which they broadcast their neighbor table. Based on this information all other routers update their neighbor table.
What I see in terminal it that there are some 0 values for the first 15 seconds, after that everything is fine.
This works because all nodes are in close proximity and can hear each other. |
|
|
| |
|
|
|
|
|
Posted: May 17, 2010 - 04:45 PM |
|

Joined: Apr 20, 2010
Posts: 11
|
|
|
Quote:
This will happen in situation like this: R1 - C - R2. R1 knows nothing about R2, so when R1 receives packet from R2 it will indicate it, but won't update neighbor table.
I thought that setting the radius to '1' on the broadcast packet would eliminate this by not allowing packets to be routed around the network. Is this not the case?
I believe I have already checked this with a packet sniffer, and I found that there was a direct communication between two routers when I was receiving a '0' RSSI. I will check again though.
I will also run this code again to make sure that it is not getting valid readings after 15 sec. But, I do remember having six routers running and it was still having issues after running for more than 5 minutes, with all the routers within close proximity.
Thanks Alexru. |
|
|
| |
|
|
|
|
|
Posted: May 17, 2010 - 05:07 PM |
|


Joined: Apr 15, 2009
Posts: 4857
Location: San Jose, CA
|
|
|
junglistdan wrote:
I thought that setting the radius to '1' on the broadcast packet would eliminate this by not allowing packets to be routed around the network. Is this not the case?
Radius has nothing to do with routing, it affects rebroadcasting. Radius is used to prevent loops, here how it works:
1. Node is allowed to originate packet with radius 1.
2. Node is not allowed to rebroadcast received packet with radius 1 (according to specification node must decrement radius, and rebroadcast if it is still greater than 0).
So with radius 1 all nodes will receive broadcast packets and indicate it, no rebroadcasts will be present.
junglistdan wrote:
and I found that there was a direct communication between two routers when I was receiving a '0' RSSI.
There is direct communication, records to find route to the node are stored in routing table. RSSI is stored in neighbor table. If device is not in routing table then route discovery will be performed, if device is not in neighbor table it is fine.
junglistdan wrote:
I will also run this code again to make sure that it is not getting valid readings after 15 sec. But, I do remember having six routers running and it was still having issues after running for more than 5 minutes, with all the routers within close proximity.
It is possible that neighbor table was not large enough to hold all records. |
|
|
| |
|
|
|
|
|
Posted: May 18, 2010 - 06:12 PM |
|

Joined: Apr 20, 2010
Posts: 11
|
|
Thanks Alexru, I should have reviewed the Zigbee defenition bettter regarding the radius. I think I understand it now.
I didn't initally understand that there were two seperate tables (routing and neighbor). Thank you for clearing this up.
I will have to go back to the drawing board and think this through a bit more now that I understand my problem in more detail. |
|
|
| |
|
|
|
|
|
Posted: Oct 09, 2010 - 07:53 PM |
|

Joined: Jun 15, 2010
Posts: 133
|
|
Hi Alexru !
I tried your pingpong.c example, but it doesn't work for me.
Quote:
Here is heavily modified pingpong.c file which demonstrates how RSSI reading works and how you can control output power.
Just put it in place of original pingpong.c from SDK and add CS_NWK_ADDR = 0 or 1 to Configuration file (0 is coordinator, 1 is router).
What application does: after starting the network and waiting for router to join coordinator starts to send "pings" to router, in reply router sends RSSI of coordinator's packet. After receiving reply coordinator sends RSSI of reply and reported RSSI of request. So you know RSSI on both sides.
Additionally buttons regulate TX power value.
In the output I see that RSSI value changes according to TX power pretty linearly.
I loaded code on 2 MeshBean boards, changed parameters 1st for C and 2nd for R and I don't receive anything on terminal.
I certainly miss something "big" here, but what ? (It's not COM port, I'm sure.)
I'm using ATmega128RFA1 boards and I also tried to get RSSI value and I receive 0s.
Code:
ZDO_GetLqiRssi_t req;
req.nodeAddr = 0x000A;
ZDO_GetLqiRssi(&req);
outgoingMessage.data.rssi= req.rssi;
outgoingMessage.data.lqi= req.lqi;
I also receive 0s when I read out PHY_RSSI register.
I read out PHY_ED_LEVEL and receive some values for LQI and RSSI which are the same and make sense.
When modules are close both of them are 35-36 and when distance is growing both drop down.
Code:
ZDO_GetLqiRssi_t req;
req.nodeAddr = 0x000A;
ZDO_GetLqiRssi(&req);
outgoingMessage.data.rssi= PHY_ED_LEVEL;
outgoingMessage.data.lqi= PHY_ED_LEVEL;
Thnx Alexru! |
|
|
| |
|
|
|
|
|
Posted: Oct 09, 2010 - 08:10 PM |
|


Joined: Apr 15, 2009
Posts: 4857
Location: San Jose, CA
|
|
|
mesko wrote:
I loaded code on 2 MeshBean boards, changed parameters 1st for C and 2nd for R and I don't receive anything on terminal.
This example also enables and disables LEDs, It would help if you describe how they behave.
mesko wrote:
I'm using ATmega128RFA1 boards and I also tried to get RSSI value and I receive 0s.
Are you sure that this node ever communicated with node 0x000a?
mesko wrote:
I also receive 0s when I read out PHY_RSSI register.
You should not access RF registers when stack is running. Anyway value of this register is valid only after frame was received. |
|
|
| |
|
|
|
|
|
Posted: Oct 10, 2010 - 11:30 AM |
|

Joined: Jun 15, 2010
Posts: 133
|
|
|
Quote:
This example also enables and disables LEDs, It would help if you describe how they behave.
First I start C(CS_UID=0x0LL CS_NWK_ADDRESS=0x0000)
then I sstart R(CS_UID=0x1LL CS_NWK_ADDRESS=0x0001)
after some time on both is RED led turned ON.
I put both of them on COM ports C->COM2 R->COM1
and nothing happens.
From code it means that network wasn't established.
Strange, but why?
Quote:
Are you sure that this node ever communicated with node 0x000a?
Yes, because with:
Code:
ZDO_GetLqiRssi_t req;
req.nodeAddr = 0x000A;
ZDO_GetLqiRssi(&req);
outgoingMessage.data.rssi= PHY_ED_LEVEL;
outgoingMessage.data.lqi= PHY_ED_LEVEL;
I get results. |
|
|
| |
|
|
|
|
|
Posted: Oct 10, 2010 - 11:38 AM |
|


Joined: Apr 15, 2009
Posts: 4857
Location: San Jose, CA
|
|
|
mesko wrote:
From code it means that network wasn't established. Strange, but why?
See the value of status returned in ZDO_StartNetworkConf().
mesko wrote:
Yes, because with:
I get results.
This tells nothing. With such code you can drop call of ZDO_GetLqiRssi() you are not using returned value anyway.
PHY_ED_LEVEL is a transceiver register it's value is not bound with any particular address. Also as I said, you should not use those registers directly. |
|
|
| |
|
|
|
|
|
Posted: Oct 10, 2010 - 11:41 AM |
|


Joined: Apr 15, 2009
Posts: 4857
Location: San Jose, CA
|
|
|
mesko wrote:
First I start C(CS_UID=0x0LL CS_NWK_ADDRESS=0x0000)
then I sstart R(CS_UID=0x1LL CS_NWK_ADDRESS=0x0001)
You also need to read carefully, I've never said to change CS_UID and parameter you need to change is called CS_NWK_ADDR, not CS_NWK_ADDRESS. |
|
|
| |
|
|
|
|
|
Posted: Oct 10, 2010 - 02:40 PM |
|

Joined: Jun 15, 2010
Posts: 133
|
|
Now everything works !
Quote:
You also need to read carefully, I've never said to change CS_UID and parameter you need to change is called CS_NWK_ADDR, not CS_NWK_ADDRESS.
As I'm using ATmega128RFA1 I usually change CS parameters and I do this automaticly. Of course you didn't say that CS_UID should be changed at all.
I tried with these parameters:
First I start C(CS_UID=0x1LL CS_NWK_ADDR=0x0000)
then I start R(CS_UID=0x2LL CS_NWK_ADDR=0x0001)
and it works.
I don't what happened first place.
Quote:
PHY_ED_LEVEL is a transceiver register it's value is not bound with any particular address. Also as I said, you should not use those registers directly.
Thnx, for advice, I'll stick to that.
Quote:
parameter you need to change is called CS_NWK_ADDR, not CS_NWK_ADDRESS.
Of course CS_NWK_ADDR, sorry, my writing.
I'll try to port your code on Atmega128RFA1.
Many thanks once again Alexru I really appreciate your help! |
|
|
| |
|
|
|
|
|
Posted: Oct 13, 2010 - 09:55 AM |
|

Joined: Jun 15, 2010
Posts: 133
|
|
Hi Alexru !
I've established network like this:
(the numbers represent CS_NWK_ADDR)
R1
/
C0
\
R2--ED3
I want to get get RSSI form all Rs and EDs in network.
I managed that by calling each node (point2point).
Now, the thing is next:
Let say for some reason I've lost R2 and ED3 connects to R1
R1---ED3
/
C0
How do I now get RSSI from ED3, because ED3 has changed it's parent?
In the first case, lets say, I know that ED3 is connected to R2, so I know
network structure and can write in ED3
Code:
static void APS_DataIndEndevice(APS_DataInd_t *indData)
{
req.nodeAddr = 0x0002; //R2s short nwk addr
ZDO_GetLqiRssi(&req);
.
.
.
}
but now that ED3 is connected to R1 I have to change:
Code:
req.nodeAddr = 0x0001; //R1s short nwk addr !!!
ZDO_GetLqiRssi(&req);
How to solve this problem?
Thnx Alexru ! |
|
|
| |
|
|
|
|
|
Posted: Oct 13, 2010 - 12:41 PM |
|

Joined: Nov 01, 2008
Posts: 2
|
|
Hi Alexru!
First, sorry about my english!
I want to use BitCloud in a location tracking system based on rssi values. I tried to get rssi values from the neighbor table, but it seems like the end device befalls only its parents neighbor table. I tried to broadcast dummy packets from the ED periodically, but it is not helped. Routers kepts oly other routers and their own ED childrens in their neighbour table.
My configuration is CS_NEIB_TABLE_SIZE = 28, CS_MAX_CHILDREN_AMOUNT = 24, and CS_MAX_CHILDREN_ROUTER_AMOUNT = 3 in a network with 3 R, 1 C and 1 ED.
To get neighbor table, i used this:
Code:
void timerFired()
{
static ZDO_Neib_t table[CS_NEIB_TABLE_SIZE];
int i, j;
ZDO_GetNeibTable(table);
memset((void*)&positionMsg.position, 0xFF, sizeof(positionPkt_t));
j = 0;
for (i = 0; i < CS_NEIB_TABLE_SIZE; i++)
{
if (table[i].deviceType == DEVICE_TYPE_END_DEVICE)
{
positionMsg.position.array[j].node = table[i].shortAddr;
positionMsg.position.array[j].rssi = table[i].rssi;
j++;
}
}
APS_DataReq(&dataRequest);
}
Is there any workaround to get record about an ED in another routers neighbor table too?
Thanks,
Spongyabob |
|
|
| |
|
|
|
|
|
Posted: Oct 13, 2010 - 01:30 PM |
|


Joined: Apr 15, 2009
Posts: 4857
Location: San Jose, CA
|
|
|
mesko wrote:
How to solve this problem?
Use ZDO_GetParentAddr() to determine parent's address. |
Last edited by alexru on Oct 13, 2010 - 01:35 PM; edited 1 time in total
|
| |
|
|
|
|
|
Posted: Oct 13, 2010 - 01:35 PM |
|


Joined: Apr 15, 2009
Posts: 4857
Location: San Jose, CA
|
|
|
spongyabob wrote:
I want to use BitCloud in a location tracking system based on rssi values.
This is a very bad idea, most likely it won't work.
Quote:
but it seems like the end device befalls only its parents neighbor table.
Yes, they are and it is impossible to make them appear anywhere else. That's because ED communicates directly ONLY with its parent so other devices don't care about it and as long as they can't communicate, you can't get RSSI to them. |
|
|
| |
|
|
|
|
|
Posted: Oct 13, 2010 - 01:48 PM |
|

Joined: Jun 15, 2010
Posts: 133
|
|
Thnx, I will!
Your answers are so simple.
In BitCloud documentation function ZDO_GetParentAddr() is 1 row below ZDO_GetLqiRssi().
Who would that thought?
To spongyabob:
Code:
void timerFired()
{
static ZDO_Neib_t table[CS_NEIB_TABLE_SIZE];
int i, j;
ZDO_GetNeibTable(table);
memset((void*)&positionMsg.position, 0xFF, sizeof(positionPkt_t));
j = 0;
for (i = 0; i < CS_NEIB_TABLE_SIZE; i++)
{
if (table[i].deviceType == DEVICE_TYPE_END_DEVICE)
{
positionMsg.position.array[j].node = table[i].shortAddr;
positionMsg.position.array[j].rssi = table[i].rssi;
j++;
}
}
APS_DataReq(&dataRequest);
}
Pay attention to 10 ms callback and 50 ms appTaskHandler, BitCloud UG p. 3-3, 3-4.
My advice is not to use any loop (for, while) if you're unsure how much it takes to
finish.
Alexru, can you confirm that? |
|
|
| |
|
|
|
|
|
Posted: Oct 13, 2010 - 01:53 PM |
|


Joined: Apr 15, 2009
Posts: 4857
Location: San Jose, CA
|
|
|
mesko wrote:
In BitCloud documentation function ZDO_GetParentAddr() is 1 row below ZDO_GetLqiRssi().
Who would that thought?
Alphabetical sorting
mesko wrote:
Alexru, can you confirm that?
In this case loop will be pretty short so it is OK, but still the only device that talks to ED is ED's parent. |
|
|
| |
|
|
|
|
|
Posted: Oct 14, 2010 - 07:55 AM |
|

Joined: Nov 01, 2008
Posts: 2
|
|
Hi alexru!
Thanks for the answer!
alexru wrote:
In this case loop will be pretty short so it is OK, but still the only device that talks to ED is ED's parent.
I see that the only device that talks to ED is ED's parent, but what happens when ED sends a broadcast packet with radius=1?
ED's parent will receive it only?
I hoped I can get rssi from APS_DataInd_t on other routers too, but I does not experienced it. On radius=2 the other routers recevied the packet, but the rssi was false, not the ED's rssi but ED's parent's rssi. Now I think I will use routers instead of EDs. |
|
|
| |
|
|
|
|
|
Posted: Oct 14, 2010 - 08:03 AM |
|


Joined: Apr 15, 2009
Posts: 4857
Location: San Jose, CA
|
|
|
spongyabob wrote:
I see that the only device that talks to ED is ED's parent, but what happens when ED sends a broadcast packet with radius=1?
Parent will act like the first device, so parent will rebroadcast it, but I may be wrong here and actually only parent could receive it.
spongyabob wrote:
not the ED's rssi but ED's parent's rssi.
That's because all frames from ED are sent via parent, even broadcasts. |
|
|
| |
|
|
|
|
|
Posted: Jul 10, 2012 - 05:31 PM |
|

Joined: Apr 09, 2012
Posts: 11
|
|
Hello:
I am working with the Throughput Test Application included in the BitCloud ZigBit directory for ATZB-900-B0. I have included extra information (LQI and RSSI) to the sent data by the router to the PC.
The problem is that after several seconds the router starts to send 0 values for LQI and RSSI. If I reset the router device this starts to send correct values but again after a while I receive 0 values. I do not know why... could you please help me? |
|
|
| |
|
|
|
|
|
Posted: Jul 11, 2012 - 05:00 PM |
|


Joined: Apr 15, 2009
Posts: 4857
Location: San Jose, CA
|
|
| How do you get LQI and RSSI values? |
_________________ The opinions and views expressed by me on this forum are my own and do not represent my employer or anyone else that I’m affiliated with.
|
| |
|
|
|
|
|
Posted: Jul 11, 2012 - 05:54 PM |
|

Joined: Apr 09, 2012
Posts: 11
|
|
I have defined the function appReadLqiRssiRouter() in throughputTest.c as follow:
ZDO_GetLqiRssi_t appReadLqiRssiRouter(void)
{
ZDO_GetLqiRssi_t lqiRssi;
NodeAddr_t *parentAddr;
ZDO_GetParentAddr(parentAddr);
lqiRssi.nodeAddr = parentAddr;
ZDO_GetLqiRssi(&lqiRssi);
return lqiRssi;
}
In the appRouterTaskHandler() defined in thrTestRouter.c I have defined a timer in repeat mode that is executed every second whose callback calls to trackPeriodTimerFired_LqiRss() that sends data to the PC through the Uart and it is defined as follow:
static void trackPeriodTimerFired_LqiRssi(void)
{
static uint8_t msgThirdPart[] = "000\r\n";
static uint8_t msgFourthPart[] = "000\r\n";
lqiRssi = appReadLqiRssiRouter();
printUint8(msgThirdPart, lqiRssi.lqi, 3);
printUint8(msgFourthPart, lqiRssi.rssi, 3);
appWriteDataToUart(msgThirdPart, sizeof(msgThirdPart)-1);
appWriteDataToUart(msgFourthPart, sizeof(msgFourthPart)-1);
// Reset
lqiRssi.lqi = 0;
lqiRssi.rssi = 0;
} |
|
|
| |
|
|
|
|
|
Posted: Jul 11, 2012 - 05:59 PM |
|


Joined: Apr 15, 2009
Posts: 4857
Location: San Jose, CA
|
|
1. After 15 seconds parent-child relationship between router and coordinator disappears.
2. parentAddr is declared as a pointer, so:
2.1. ZDO_GetParentAddr() overwrites memory at some random address.
2.2. In this line "lqiRssi.nodeAddr = parentAddr;" you assign pointer to a variable.
Compiler should complain a lot on this code. Read the warnings. |
_________________ The opinions and views expressed by me on this forum are my own and do not represent my employer or anyone else that I’m affiliated with.
|
| |
|
|
|
|
|
Posted: Jul 11, 2012 - 07:47 PM |
|

Joined: Apr 09, 2012
Posts: 11
|
|
Thank you for your suggestion. If I specify in lqiRssi.nodeAddr = 0x0LL (coordinator) or if I use NWK_GetNextHop(0x0000) to discover the coordinator short address as I show below I start to reveive 0 values after 40 seconds.
ZDO_GetLqiRssi_t appReadLqiRssiRouter(void)
{
ZDO_GetLqiRssi_t lqiRssi;
lqiRssi.nodeAddr = NWK_GetNextHop(0x0000);
ZDO_GetLqiRssi(&lqiRssi);
return lqiRssi;
} |
|
|
| |
|
|
|
|
|
Posted: Oct 01, 2012 - 04:31 PM |
|

Joined: Nov 10, 2008
Posts: 13
|
|
|
alekodu wrote:
Thank you for your suggestion. If I specify in lqiRssi.nodeAddr = 0x0LL (coordinator) or if I use NWK_GetNextHop(0x0000) to discover the coordinator short address as I show below I start to reveive 0 values after 40 seconds.
ZDO_GetLqiRssi_t appReadLqiRssiRouter(void)
{
ZDO_GetLqiRssi_t lqiRssi;
lqiRssi.nodeAddr = NWK_GetNextHop(0x0000);
ZDO_GetLqiRssi(&lqiRssi);
return lqiRssi;
}
Hello!!!
I use the same appReadLqiRssi() function and when I have some routers in my network, rssi and lqi values become 0's on some of these units. Have you solved this issue? |
|
|
| |
|
|
|
|
|
Posted: Oct 01, 2012 - 06:31 PM |
|


Joined: Apr 15, 2009
Posts: 4857
Location: San Jose, CA
|
|
|
dtarrago wrote:
I use the same appReadLqiRssi() function and when I have some routers in my network, rssi and lqi values become 0's on some of these units. Have you solved this issue?
This is not an issue, some routers are not in the neighbor table. Those LQI/RSSI values have to be stored somewhere.
If you want to get all values - make nodes report the values and collect on the application level. |
|
|
| |
|
|
|
|
|
Posted: Oct 02, 2012 - 07:49 AM |
|

Joined: Nov 10, 2008
Posts: 13
|
|
| [quote="alexru"][quote="dtarrago"]I use the same appReadLqiRssi() function and when I have some routers in my network, rssi and lqi values become 0So, one possibility is to read these values through the 'APS_DataInd_t' structure when a packed is received. Right? |
|
|
| |
|
|
|
|
|
Posted: Oct 02, 2012 - 07:50 AM |
|


Joined: Apr 15, 2009
Posts: 4857
Location: San Jose, CA
|
|
| Yes, LQI and RSSI of the frame are in APS_DataInd_t. |
_________________ The opinions and views expressed by me on this forum are my own and do not represent my employer or anyone else that I’m affiliated with.
|
| |
|
|
|
|
|