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.

Increase the Radio range according to RSSI

Other Parts Discussed in Thread: Z-STACK

Hi,

        I want to increase the Radio range in run time by calling ZMacSetTransmitPower(). But I don't know what is the default dB is for sampleLight or SampleSw where it is defined. But I want to increase it to 3dB. ZMacSetTransmitPower(TX_PWR_PLUS_3).

              My aim is to get good range with less/ Zero PER while data Exchanging,  Child should not be out of range after it joined and fixed in particular place.

             Since Tx power will affect the battery, so my plan to change the Tx power depends on RSSI or LQI value. 

 Question 1:

               If I set Tx Power as 3dB in zcl_xxx_init. It will increase the range of beacon request also for searching it's parent or that is only applicable after it's joins to network?

Question 2:

          I know I will get the rssi value through afIncomingMSGPacket_t. If I send a data from End device to Coordinator, then Coordinator will know the End device RSSI value. But how End device will come know it's own RSSI value.

Question 3:

          What is the difference between RSSI and LQI value. which will indicate the radio power and how I will come  to know the signal is weak.

     

  • 1. It will increase the range of beacon too.

    2. No, you can't have the RSSI of ZED sending messages.

    3. You can refer to http://e2e.ti.com/support/wireless_connectivity/w/design_notes/calculation-and-usage-of-lqi-and-rssi.aspx.

  • Hi,

    one clarification here. The RSSI value you get is an indication of the signal strength of the data sent by node A and received by node B.

    Which means, if the data is sent directly from ED to the coordinator, then the RSSI value in the AF Incoming MSG indication is the actual measured signal strength at the coordinator, for a packet sent by the ED. And vice versa.

    Now, the trick is that ED send always one-hop messages to their parent, which then route them to other nodes.

    Same for receiving, ED would receive messages from their parents, even if originated from other nodes.

    However, there's an option in TI Z-stack to 'bypass' this and send direct messages to the node. They will be received, if the right address of the recipient is set and the receiver has the receiver ON at the time the message is sent out and the node is in radio range.

    Please check 3.2.1.2 section in Z-stack API document,that you can find in Documents folder of your Z-stack install. The option field allows to skip routing and send direct messages.

    For the other points, I agree with YK

    Thanks,

    TheDarkSide

  • Hello DS and YKC,

                 I have used AF_SKIP_ROUTING in AF_DataReq. The Description of AF_SKIP_ROUTING is "Setting this option will cause the device to skip routing and try to send the message directly (not multihop).  End devices will not send the message to its parent first. Good for only direct (unicast) and broadcast messages". 

                                What does it mean?. I am sending msg to coordinator with 2(ZC->ZR1->ZR2->ZED) router in between. It means, it will send Msg to Coordinator  instead of routing to two routers, if ZC is in radio range, though ZR2 is the Parent of ZED.

              Actually my requirement is to transmit data without any loss and error. If I send AF_DataReq to ZC from ZED through 2 ZR. In the ZC only I am calculating the rssi and Lqi value. Then how can I know the the rssi value and Lqi Value of ZED is between the ZED and ZR2 (or) ZED and ZC?.

  • 1. If you use AF_SKIP_ROUTING, the message will be sent directly first. If not reachable, it will try to send to its parent.

    2. You can use ZDP_MgmtLqiReq to request all of the devices LQI in the network.

  • Yikai,

           I want to get LQI value when the Device Send AF_DataReq. My Question is if I send Data from ZED to Coordinator through 2 Routers. The RSSI and LQI Value getting in Coordiantor is the signal strength between the ZR2 and ZED (or) ZC and ZED.

    One more thing I noticed is, if keep ZED and ZC very Closer LQI value is Increasing Instead of Decreasing. And if ZED slowly move way from ZC, then LQI id Decreasing instead of Increasing.   

  • If you send data with path ZED ->ZR2->ZR1->ZC, the LQI in AF_DataReq would be the one between ZR1 and ZC.

  • 1) It means I can't know Lqi and rssi value of ZED with Sending Data through 2 ZR. The thing is, if I have large network it is not easy/good to send ZDP_MgmtLqiReq for all. When application is running. Is there any other Method, where I can know the rssi and Lqi Value with above scenario case.

     2) In ZDP_MgmtLqiReq I am confused with the field, StartIndex. What should I give?.

    3) The Document Mentioned that  have to set ZDO_MGMT_LQI_RESPONSE. It Means I need to give it in compile option for all ZED and ZR to Respond this Request?

    4)  ZDP_MgmtLqiReq will give only Lqi Value. What about RSSI.

  • 1. As I know, there is no other alternative.

    2. StartIndex – the responding device could have more response items than can fit in a response message, the
    requester can specify a starting index into the possible response items.

    3. Yes

    4. You need to calculate RSSI from LQI by yourself.

  • 2. That I have seen in the Doc. But I couldn't able to get that. What is response item? what is Starting Index.

    4. How can I calculate it. Is there any Mathematical Theorem/theory. Can you link me.  

  • 2. The LQI response might be very long so you can use this field to specify the start point that you want.

    4. Please refer to http://e2e.ti.com/support/wireless_connectivity/w/design_notes/z-stack-link-quality-indicator-zigbee.aspx

  • Yikai,

             I have seen the link, I have query in that.

    1. The linkQuality that is received at the higher layer is  simply the RSSI value, it means the value which will get from neighborLqiCount is rssi value? 

    typedef struct
    {
      uint8  status;
      uint8  neighborLqiEntries;
      uint8  startIndex;
      uint8  neighborLqiCount;
      neighborLqiItem_t list[];
    } ZDO_MgmtLqiRsp_t;

    2. The exact conversion operation is contained in the macro.  MAC_RADIO_CONVERT_RSSI_TO_LQI(x) that is defined in mac_radio_defs.h file.

                --->But I didn't find that Macro in mac_radio_defs.h. I am using Zstack 2.5.1a.

                ----> I suspect this Macro will convert from unsigned to signed value.

                ----->This MAcro will convert RSSI to LQI (or) LQI to RSSI, Since we request for LQI

    3) My code is

    case Mgmt_Lqi_rsp:
             {
               ZDO_MgmtLqiRsp_t *LqRsp;
                 LqRsp = osal_mem_alloc(sizeof(LqRsp));
                
                 LqRsp = ZDO_ParseMgmtLqiRsp(inMsg);
                uint8 Lqi[2] = {0};
              
                Lqi[0] = LqRsp->list[0].rxLqi;
                Lqi[1] = LqRsp->list[0].txQuality;
                HalUARTWrite(HAL_UART_PORT_0, Lqi, 2);

               osal_mem_free(LqRsp);

            }

    I am getting only two values like 00 04, 0F 00, 06 13. Then after some times continuously I am getting 00 04........ Which is the Lqi Value.

    Is this right or I am doing any stupidity

    But the value Msgpkt->LinkQuality is giving correct value. The Value from Mgmt_Lqi_rsp is not getting

  • I Request Some TI Member/Yikai to help me. I stuck with this to getting LQI Value for Particular Device.With the Above Code I am getting undefined Behaviour.

    Basically I want to find LQI or RSSI value from Each Device.

    If          ZC->ZR1->ZR2->ZED1

                  |

                ZR3 ->ZED2

                 |

                 ZR4->ZED3

    RSSI or LQI Value of ZED1 with ZR2.

    RSSI or LQI Value of ZED2 with ZR3.

    RSSI or LQI Value of ZED3 with ZR4.

    RSSI or LQI Value of ZR3 with ZC.

    RSSI or LQI Value of ZR4 with ZR3.

    If I send ZDP_MgmtLqiReq of Particular Address(ZED1 (or) ZED2 (or) ZED3). Will I Get? If Yes, then how?

    I have Tried with ZC->ZED. with ZDP_MgmtLqiReq. But it is not working. The Status is in Above Post.

  • Hi,

    first of all, if you just need to retrieve the RSSI value of the single hop connection, I would suggest also to taking a look at the AF_INCOMING_MSG_CMD OSAL message sent by the AF layer to the application task when an OTA message is received by the surrounding one hop link.

    The type of the message contains a field, afIncomingMSGPacket_t, which contains the RSSI value of the incoming packet.

    Use of Mgmt_Lqi_req/rsp is an option as well. I think there's a small bug in your code, when you allocate the memory for the parsing of the incoming Mgmt_Lqi_rsp, as it needs to be size of the structure the pointer points to and not the size of the pointer

    case Mgmt_Lqi_rsp:
             {
               ZDO_MgmtLqiRsp_t *LqRsp; 
                 LqRsp = osal_mem_alloc(sizeof(ZDO_MgmtLqiRsp_t ));
                 
                 LqRsp = ZDO_ParseMgmtLqiRsp(inMsg);
                uint8 Lqi[2] = {0};
               
                Lqi[0] = LqRsp->list[0].rxLqi;
                Lqi[1] = LqRsp->list[0].txQuality;
                HalUARTWrite(HAL_UART_PORT_0, Lqi, 2);

     

    Anyway, I think the rest of the code is correct. But please note, Mgmt_Lqi_rsp pulls the entire list of neighboring and associated devices.

    Thanks,

    TheDarkSide 

  • In your  network topology example, you can send ZDP_MgmtLqiReq to ZC and get LQI of ZR1 and ZR3. Send ZDP_MgmtLqiReq to ZR2 to get LQI of ZED1. Send ZDP_MgmtLqiReq to ZR3 to get LQI of ZED2. Send ZDP_MgmtLqiReq to ZR4 to get LQI of ZED3.

  • Thanks Yikai and DarkSide,

               But I am not getting correct value from Mgmt_Lqi_rsp. I revised the code as mentioned by darkside.

     ZDP_MgmtLqiReq(&LdstAddr, f , false);//where f = 0.dst Addr = 0x0000

    case Mgmt_Lqi_rsp:
             {
                 ZDO_MgmtLqiRsp_t *LqRsp;
                 LqRsp = osal_mem_alloc(sizeof(ZDO_MgmtLqiRsp_t));
                
                 LqRsp = ZDO_ParseMgmtLqiRsp(inMsg);
               
                uint8 Lqi[2] = {0};
              
                Lqi[0] = LqRsp->list[0].rxLqi;
                Lqi[1] = LqRsp->list[0].txQuality;
             
                
                HalUARTWrite(HAL_UART_PORT_0, Lqi, sizeof(Lqi));
                osal_mem_free(LqRsp);
             }

     First I am trying with One ZC and One ZED. Then I will move to my actual scenario. But this it self giving undefined behavior for me. I am getting rssi and Lqi value from AF_DataReq, to Check Which I am getting from Mgmt_Lqi_rsp is correct or not. But it's giving undefined behavior. Can you tell me which is Lqi Value, rxLqi or txQuality.

    Observation(Values is in Unsigned):

        RSSI             LQI               rxLqi               txQuality

        222               139                000                  007

        222                139               128                  006

        222               139                255                 000

        223               141                004                 000

        223                141              000                  050

  • Please help to fix the above issue. Or is there any api to get lqi value of its own. Like ZED wants to it's own Lqi Value, how it could be done.

  • There's no such a thing like a device 'own' LQI value. LQI/RSSI are associated to the incoming packet received by the device at a given time.

    The actual LQI/RSSI value measured at the receiver depends on who sent the packet, its distance from the recipient node, the radio channel conditions such multipath or interference at a given time.

    RSSI and LQI may vary over time depending on the actual incoming frame, this is why the best way to get rssi/lqi value for incoming packet is to extract the fields of the incoming AF msg AF_INCOMING_MSG_CMD

    From the data you sent, i see that the rssi reported is ~-32 dBm and an LQI which is above average, which means that the results are consistent.

    Mgmt_LQI_Req/Rsp is an optional ZDP message and support is optional in ZigBee.

    BTW, you can't send this to an ED, but only to the parent of the ED.

    And since in your case you have a two node network with the ED being a child of the C, sending the Mgmt_LQI_Req will not result in any OTA message.

    If all you want to do is extract, in each device, the incoming RSSI and LQI of the received packets and log it, I strongly advise you to use the information in the incoming data packet.

    Thanks,

    TheDarkSide

  • DarkSide,

              I agree with you. But I am  having the Network ZC->ZR1->ZR2->ZED. As Yikai told, if I send a data from ZED to ZC using Af_DataReq, the rssi and Lqi Value in Incoming Packet is between ZC and ZR1 not the Lqi Value of ZED. That's why I thought to use Mgmt_LQI_Req/Rsp.

      As u said "sending the Mgmt_LQI_Req will not result in any OTA message". It means I cannot get a Lqi Value in Mgmt_LQI_Req of ZC child?

              

  • "sending the Mgmt_LQI_Req will not result in any OTA message."  I think TheDarkSide means ZED won't send any OTA message due to your Mgmt_LQI_Req. It only request LQI history from the parent node.

  • But I am sending to ZC only, Then how can I find Lqi of ZED.

     Sync.addrMode = (afAddrMode_t)Addr16Bit;
           
     Sync.addr.shortAddr = 0x0000;
     ZDP_MgmtLqiReq(&Sync, f , false);

  • First, a small clarification which is very important.

    Mgmt_LQI_Req is used to discover the topology of the network and it is responded only if the device that the message is sent to is a router or a coordinator. They respond on behalf of their children ED and they report the LQI values of their immediate one-hop nodes (including neighboring nodes, parent and children).

    Let's assume you have a network where the topology is like this:

    ZC --> ZR1 --> ZR2 --> ZED, then ZED is the child of ZR2.

    With ZigBee standard routing mechanism, ZED must communicate, as a first hop, only with ZR2 for incoming and outgoing data. So any other RSSI/LQI value (which is a measurement of the signal strength and quality of the PHY one hop radio link) relative to ZED sending or receiving packet has sense only relative to its parent. That is another very important point. 

    Now let's assume that all the nodes are in radio range. If ZC sends a Mgmt_Lqi_req to ZR2, the list of devices ZRS would report in its response to ZC will be composed of ZC, ZR1 and ZED, because ZC and ZR1 are neighbors of ZR2 and ZED is a direct child of ZR2.

    Now, in the LQI field of the ZED Neighbor element in that list indicates the average LQI value of the packets that have been received by ZR2 and originated from ZED. Which means for you, back to square 1.

    If i understand this correctly, you may have had the impression that if the ZC sends a Mgmt_Lqi_req to ZED, then ZED would report the LQI/RSSI values of the ZC <->ZED connection. If that is the case, this is unfortunately not what happens with Mgmt_LQI_Req/Rsp.

    The only way to get the LQI/RSSI values of the packets sent by ZED and received by ZC is to have the ZED directly sending the packets to it. Which means, as mentioned use the AF_SKIP_ROUTING option by the end device when sending out the packet to the coordinator and capture the rssi/lqi value in the incoming AF message.

    I hope this clarifies.

    Thanks,

    TheDarkSIde

  • Thanks a lot DarkSide,

                   Very Good Explanation. So, if I send a Af_DataReq from ZED to ZC with option AF_SKIP_ROUTING, the Incoming Msg of rssi/lqi  in ZC is the Values of ZED with same topology ZC --> ZR1 --> ZR2 --> ZED. Please Correct me if I am Wrong.

  • Yes. Assuming ZED and ZC are in radio range, the AF Data incoming msg received at ZC would contain the measured RSSI/LQI value of the packet sent out by the ZED and directly received by the ZC.

    Hope this helps.

    Thanks,

    TheDarkSide

  • I am little Confused, If ZED is not in range of ZC, then AF Data incoming msg received at ZC from ZED through ZR is not a  measured RSSI/LQI value of the packet sent out by the ZED???

  • Hi Mubeen,

    Yes. If AD Data incoming msg received at ZC from ZED through ZR, the RSSI/LQI value is the signal strength or link quality between ZR and ZC.

  • Hi Mubeen,

    i think the misconception is that RSSI/LQI value is a measure of the quality of the link between the packet originator and the final destination node.

    It is not. RSSI/LQI is a measure of the single hop radio link between the transmitter and the receiver. And, it is measured at the receiver end.

    In a multihop scenario, the originator (in this case ZED) sends the packet to the destination node. If the destination node happens to be in radio range with the originator, then the receiver will be able to detect the LQI/RSSI values for that packet and therefore characterize the radio link.

    If instead there's an intermediate node in between (ZC -- ZR -- ZED) that 'extends' the radio distance, then the LQI/RSSI level at the final node will be a measure of the corresponding last segment of the radio communication.

    In other words, if the packet is originated by ZED with final destination ZC, traversing ZR, then AFIncomingMSG will carry RSSI/LQI information of the radio link communication between ZR and ZC, even though the packet originator was ZED and ZR was just used to hop on.

    I hope this clarifies.

    Thanks,

    TheDarkSide 

  • Dear DarkSide/Yikai,

             Yes it is clear for me. My intension is to know the RSSI/LQI Value of the Particular Device. So that I will come to know that data may loss if rssi and lqi is low in range.

               ZC->ZR1->ZR2->ZED1

                  |

                ZR3 ->ZED2 (Which is not in Range to ZC)

                 |

                 ZR4->ZED3 (Which is not in Range to ZC)

    The Topology may vary according to placement of ZED, for Example one more Router may introduce in between ZR4 and ZED3(ZR4->ZR5->ZED3). I mean to say that, if I know the topology, then I know this is the Router, So I can send  Mgmt_Lqi_req to it to get rssi/Lqi. Nothing but rssi value of each hop(like rssi value of ZED3 to ZR4, ZR4 to ZR3, ZED2 to ZR3, ZR3 to ZC, ZR1 to ZC, ZR2 to ZR1, ZED1 to ZR2) .

    Please suggest how can I get all these details, and how can I know which is router, so that I can send Mgmt_Lqi_req to it.

    Main thing is the Mgmt_Lqi_req is not working for me. As I mentioned in Earlier post. The the RSSI and LQI Value which I am getting from AF_DataReq and value from Mgmt_Lqi_rsp(rxLqi,  txQuality) is completely different. Which one is LQI Value from  Mgmt_Lqi_rsp.

  • Hi Yikai and Dark Side,

                       As Yikai suggested, I have done with same. I am sending  Mgmt_Lqi_req. for ZC to get ZR1 and ZR3, then ZR1 to get ZR2, ZR2 to get ZED1, ZR3 to get ZR4 and ZED2 etc. 

                        I am sending these request for Every 20sec. But I found one bug, When ZR4 (or any child) is removed/Switch off, at that time Mgmt_Lqi_req is send to ZR3, I am getting the response as 2 Entries and getting LQI value. After some iteration only it becoming zero. But Entries are there.

  • Hi Mubeen,

    I am confused by your descriptions. Would you describe clearly?

  • Say for Simple Example I am having a network with ZC->ZR1->ZED1

                                                                                         |

                                                                                      ZR2->ZED2.

    After Switch On all the Device, I am sending Lqi Request to Coordinator, then ZR1 and ZR2. This is working fine.

    1)ZC is responding LqRsp->neighborLqiEntries as 2 and giving Lqi Value of ZR1 and ZR2.

    2)ZR1 is responding LqRsp->neighborLqiEntries as 1 and giving Lqi value of ZED1.

    3)ZR2 is responding LqRsp->neighborLqiEntries as 1 and giving Lqi Value of ZED2.

    After Some time, if I remove ZR2 and ZED2 from network, then  result is same as above.

    1) ZC is responding LqRsp->neighborLqiEntries as 2 instead of 1(ZR1) and giving some Lqi Value(Non Zero Value)

    3) ZR2 is responding LqRsp->neighborLqiEntries as 1 and giving Lqi Value of ZED2 though there is no ZR2 and ZED2.

    Then after some Iteration

    1)ZC is responding LqRsp->neighborLqiEntries as 2 instead of 1(ZR1). But Lqi Value is ZERO

     

     

  • Hi Mubeen,

    In your description, you said.

    2)ZR1 is responding LqRsp->neighborLqiEntries as 1 and giving Lqi value of ZED1.

    However, I think you should get ZR1 responsed LqRsp->neighborLqiEntries as 2 or 3 according to my experience. ZR1 would talk with ZC at lease or might talk with ZR2 in your topology so ZR1 should response LqRsp->neighborLqiEntries should be 2 or 3. Would you show me how you do LQI request?

  • Hi Yikai,

          Then according to you, it difficult for me to figure out, the LQI Value which I am getting in a response is which value, I mean, if i send LQI Request to ZR1(All request I am sending from ZC). if ZR1 is able to talk with ZR2, then in the response, the LQI Value of ZR2 is  value of ZR2 and ZC (or) ZR2 and ZR1?

    I will tell my requirement again, The  network which I defined in last post as an example.

    ZC is parent of ZR1 and ZR2,

    ZR1 is parent of ZED1,

    ZR2 is a parent of ZED2.

    If I send LQI Request to ZC from ZC, I need to get LQI value only of its child i.e ZR1 and ZR2, even though ZED1 or ZED2 its in the range.

    If I send LQI Request to ZR1 from ZC, I need to get LQI value only of ZR1 child i.e ZED1, even though ZR2  in the range.

    If I send LQI Request to ZR2 from ZC, I need to get LQI value only of ZR2 child i.e ZED2, even though ZR1 in the range.

    My Code iis in ZC

    #define LQI_ROUT_TIME 1000

    #define LQI_CORD_TIME 20000

     if ( events & SEND_LQI_REQ)// Where SEND_LQI_REQ is 0x0010
        {
          Send_MgmtLqiReq();
          return ( events ^ SEND_LQI_REQ);
        }

    void Send_MgmtLqiReq(void)
    {
        address_list *Lq_temp;
        zAddrType_t Mgt_Dst;
        uint8 f = 0;
        uint8 brk = 0;
        uint8 get = 2;
               
        Mgt_Dst.addrMode = (afAddrMode_t)Addr16Bit;
        if(Coord_bit == 0) //Coord_bit is global
        {
          Mgt_Dst.addr.shortAddr =  0x0000;
          ZDP_MgmtLqiReq(&Mgt_Dst, f, false);
          Coord_bit = 1;
          osal_start_timerEx( zclbot_TaskID , SEND_LQI_REQ , LQI_ROUT_TIME);
        }
        else if(Coord_bit == 1)
        {
          Lq_temp = head;
         
          while((Lq_temp != NULL) && (brk == 0))
          {
             if((Lq_temp->list.rout == 1) && (Lq_temp->list.pck_stat == 0))
             {
                Mgt_Dst.addr.shortAddr = Lq_temp->list.nwkaddr;
                ZDP_MgmtLqiReq(&Mgt_Dst, f, false);
                Lq_temp->list.pck_stat = 1;
                get = check_ChangeStat();
                if(get == 1)
                {
                  osal_start_timerEx( zclbot_TaskID , SEND_LQI_REQ , LQI_ROUT_TIME);
                }
                else
                {
                   Coord_bit = 0;
                   osal_start_timerEx( zclbot_TaskID , SEND_LQI_REQ , LQI_CORD_TIME);
                }
                brk = 1;
             }
             else
             {
               Lq_temp = Lq_temp->link;
             }
          }
          if(get == 2)
          {
            Coord_bit = 0;
            osal_start_timerEx( zclbot_TaskID , SEND_LQI_REQ , LQI_CORD_TIME);
          }
        }
    }

     

    case Mgmt_Lqi_rsp:
             {
                ZDO_MgmtLqiRsp_t *LqRsp;
                uint8 inc;
                uint8 i;
                int8 lqi;
                uint8 entries = 0;
                uint8 U_buff[16] = {0};
              
                LqRsp = osal_mem_alloc(sizeof(ZDO_MgmtLqiRsp_t ));
                LqRsp = ZDO_ParseMgmtLqiRsp(inMsg);
                U_buff[0] = '$';
              
                entries = LqRsp->neighborLqiEntries;
                for(inc = 0; inc < entries; inc++)
                {
                    Get_ExtAddr(LqRsp->list[inc].nwkAddr, &U_buff[1]);
                    lqi = LqRsp->list[inc].rxLqi;
                    U_buff[9] = ',';
                    sprintf((char*)&U_buff[10], "%d", (uint8)lqi);
                    i = 10;
                    if((uint8)lqi > 99)
                    {
                      i = i+3;
                    }                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
                    else if((uint8)lqi > 9)
                    {
                      i = i+2;
                    }
                    else
                    {
                      i = i + 1;
                    }
                    U_buff[i++] = ',';
                    U_buff[i++] = '!';
                    U_buff[i] = '\n';
                  
                    HalUARTWrite(HAL_UART_PORT_0, U_buff, sizeof(U_buff));
                }

                osal_mem_free( LqRsp);
             }
             break;

    OverView of Code:

                        Initially I will know which is router and End Device from UART. I followed some procedure. But that is not case now.

                 After Device_annce I am starting an event SEND_LQI_REQ after 20sec,

               1.First I am sending req to ZC, By expecting to get a Lqi Value of it's child with respective ZC

                2.After 1 Sec I am checking any other Router is there, if it is there then sending req to get LQI value of that router's child with respective to same router.

                3. Step 2 will repeat till router is present.

                4. After again after 20 sec, step 1 will get start.

    This how I am getting LQI Value.

  • Hi Mubeen,

    Your code looks erratic. I would suggest you use Z-tool connect to your coordinator and use MT command to send LQI request. In this way, you can do LQI request manually.

  • My Code may erratic to you, because i am using some logic. But i could able send request to all router. 

    1.Started timer of 20sec send req Coordinator

    2.After One Second send req to router 

    3.After One Second, check any other router and do step for every 1 sec

    4.If req sent to all router,then after 20 sec, do from step1.

    My Question are,

    1.How can i get Lqi value of only its child not neighbour. As you told LqRsp->neighborLqiEntries will tell how many neigbours not its child. 

    2.When i switchoff the any ZED2(ZED1 and ZED2 parent is ZC), Then also ZC is responding that, ZED2 LQI value and after some times it's giving zero. If it is not there, it should not add in an entries right?

  • From your code, I see you might misunderstand some parameters in ZDO_MgmtLqiRsp_t

    neighborLqiEntries is Total number of entries available in the device.

    neighborLqiCount is Number of entries in this response.

    startIndex is Where in the total number of entries this response starts.

    As for your question,

    1.How can i get Lqi value of only its child not neighbor? Except you have the association list on parent node to compare with LQI list, you can't use LQI request to ask for only child node.

    2.You turn off ZED2 so there is not link between ZC and ZED2. When you ask for LQI list, it is correct that ZC still report ZED's LQI since ZED2 doesn't leave ZC.

  • Thanks Yikai,

     1. what you mean by association list, Because in my Application ZC is a Master Mind. I sending all request from ZC only. Then how can i get only Child's Lqi. Please can you suggest me.

    2. Then this might be a serious case for me. Based on Lqi Value only i am doing some process. There will be some case that due to some reason, child will get power off or out of range. Even though it is making entry, by the Lqi Value i should know, it is not there (or) Lqi Value should be Zero. But it is giving nonzero value. At that time, in what base it is giving Non zero value?Because Lqi Value will based  OTA message, Since ZED2 is not sending OTA message while it's Parent is requesting.

  • Hi Yikai,

       I request to give response to my prev questions. I hope this will answer my question of entire post

  • hello Mubeen/Yikai,

                       I am having a problem by sending request to router. Router is responding to Coordinator as i am getting in Mgmt_Lqi_rsp of Coordintor. But i am not getting EndDevice Entry which is connected to router(Coord->Router->ED). That is not getting correct network address of ED and its Lqi Value. Did i done any mistake. 

    case Mgmt_Lqi_rsp:
             {
                ZDO_MgmtLqiRsp_t *LqRsp;
                uint8 num; 
                uint8 i;
                int8 EndDevice_Lqi;
               
                LqRsp = osal_mem_alloc(sizeof(ZDO_MgmtLqiRsp_t ));
                LqRsp = ZDO_ParseMgmtLqiRsp(inMsg);
               
                num = LqRsp->startIndex;
                for(i= 0; i < num; i++)
                {
                    EndDevice_Lqi = LqRsp->list[i].rxLqi;
                    Maintain log(EndDevice_Lqi);

                }

          }

    I am using Sample Switch as Router and enabled LQI Response Flag. Is any thing i need to be done in router code to get Lqi of End Device when i request to router. Why my router is responding with junk values.

  • if i send zdo_mgmt Lqi request from coordinator with destination address of Router 2 for my network (zC-->ZR1-->ZR2) then what is LQI value? is this LQI between R1 and R2 or ZC and R2?? please tell me
  • If both ZC and ZR1 are in radio coverage of ZR2, LQI request would get both.