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.

Lqi req to router

Other Parts Discussed in Thread: Z-STACK

I want to send Lqi Req to Router. After the post http://e2e.ti.com/support/wireless_connectivity/f/158/t/341305.aspx?pi267162=1, i got some idea, but is not clear to me. 

   

               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);

            }

            osal_mem_free(LqRsp);

      }

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.

  • Hi Allen,

    In your code you are doing a for loop from 0 to LqRsp->startIndex, which is not correct, your for loop should go from 0 to LqRsp->neighborLqiCount. If you send the LQI request from the coordinator to the router and startIndex is set to 0 when you send the request, then you should have a response with 2 items in the list (assuming your network is composed of  1 coordinator, 1 router, and 1 ED). One item will be the info from the coordinator which is the parent of the router, and the other one the info from the ED which is the child of the router. 

  • Hector,

            I have revised the code, 

    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->neighborLqiCount;
                for(i= 0; i < num; i++)
                {
                    EndDevice_Lqi = LqRsp->list[i].rxLqi;
                    Maintain log(EndDevice_Lqi);

                }

          }

     This also getting num as zero(startIndex is Zero in Req) though as End device is connect to it. I am getting undefined value. Router is not making Entry of ED, though it is connected to it. Please let me know, Is i need to modify in router or in Coordinator

  • Are you sure ZR and ZED join ZC? Do you use packet sniffer to check it?

  • Allen,

    Make sure that your network is set up correctly and that you are sending the req to the right destination address and as Yikai Chen said, check the messages over the air with a sniffer to see where the error is coming from.

  • Yikai and Hector

          ZR is joins to ZC that's why I am getting responding to lqi request. And ZD joins ZR. When I switch off ZR, ZD is going in to orphan. I have seen in the sniffer. 

  • When you send the LQI request check if it appears in the sniffer log and also check if the LQI response shows in the log. Check the LQI response using the sniffer and make sure that it has the correct information, if it has the correct information in the sniffer log then the problem might be in your code.

  • Hector and Yikai,

             I am still unable to solve this issue. Why it is not giving correct respond with Lqi Request. The Attached file is below. In the dev sniffer, log is there while device announcement. In the lqi sniffer, you can see that, ZC is Sending req and Router also responding(nwk add = F713). I am using SampleSwitch as Router. In Coordinator I am using

    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->neighborLqiCount;
                for(i= 0; i < num; i++)
                {
                    EndDevice_Lqi = LqRsp->list[i].rxLqi;
                    Maintain log(EndDevice_Lqi);

                }

    Can you tell, where I am going wrong.6038.dev.psd6644.lqi.psd

         }  

  • Hi Allen,

    I checked the sniffer log that you attached and I did not see any LQI requests nor any LQI responses. My guess is that the coordinator is not sending the request or it is sending it to a non existing address and that is why the LQI request is not showing up in the sniffer log. Please check your code and make sure you are sending the request. I suggest using breakpoints and check if the coordinator is sending the request and also check that the destination address is correct. 

  • Hi Hector,

           I have attached the two sniffer log in last post with a name lqi. Please see the last part. Where Coordinator is sending lqi request to Router.Destination address is F713 if I an not wrong. Router also responding. I have set a break point before sending lqi request. Then after I set break point in lqi RSP. It is hitting that break point. If destination is incorrect. Then how I am getting the lqi RSP. I request you to help me to fix this issue which is very important to me.

  • I took a look at your sniffer log and the LQI response has a status = NOT SUPPORTED, this is the reason why you are getting a response but you are not able to see any information about the end device. To fix this you need to define MT_ZDO_MGMT.

    Go to your project options then to "C/C++ Compiler", select the "Preprocessor" tab and in the "Defined symbols" box type MT_ZDO_MGMT and then press OK.


     


    After doing that you will need to rebuild the project and flash your boards again, and this should fix your problem.
    Let me know if you have any other questions. 

  •  Hi Hector,

             But i already defined MT_ZDO_MGMT in all three devices. 

  • Hi Allen,

    I use LQI req/rsp in Z-Stack Home 1.2 without problem. Which Z-Stack version do you test this? If you don't use Z-Stack Home 1.2, I would suggest you to try it on Z-Stack Home 1.2 again.

  • Hi Yikai,

       I am using Zstack 2.5.1a. My ZC and ZED is having application based on Zstack 2.5.1a. Can i use router only in Zstack Home 1.2?. If i send a request from ZC to ZC, then it is working fine, it is giving 2 neighbours and two Lqi Value with it's proper network address. Issue is when send req to router.

  • There is no problem to join Z-Stack Home 1.2 router into Z-Stack 2.5.1a ZC.

  • It is creating problem for me. I used Zstack Home SampleLight as Router and flashed. It is not sending a beacon request itself. when I see in packet sniffer.

  • Is there any restriction in Coordinator that Lqi request can be send only this much of time or can Receive response this much of time?. Because, after some times it is not issuing the Lqi request. If I see in the sniffer, Coordinator is asking Lqi to Router. But I am not getting any response.

  • There is no such limitation.

  • Then why it is failing to issue the request. Below is my Code.

    void Send_MgmtLqiReq(uint16 shrtAddr)
    {
       
        zAddrType_t Mgt_Dst;
        uint8 f = 0;     
        Mgt_Dst.addrMode = (afAddrMode_t)Addr16Bit
          Mgt_Dst.addr.shortAddr =  shrtAddr;
          ZDP_MgmtLqiReq(&Mgt_Dst, f, false);

           HalLcdWriteString("Lqi Req Send", 2 ); //put a break point here
         
      }

    Request is issuing for ~3 min. Then it fails. But breakpoint is hitting Every time. When I see the sniffer log. The Request is not send to Router. Before ~3min it is sending to router(I have seen in the Sniffer). What will be cause?. Could you suggest me. 

  • Hi yikai

            I request to suggest me where I am going wrong

  • Is any one tried to send continuously the LQI request with in some period of time say for example 20 sec. I am continuously  sending to Coordinator  and my Router. But it fails to issue the request after some period. If  i asked Lqi Request to coordinator it self for several times, it will create a problem? Then i it is not working for me. Is i am doing the mistake internally?. I would be thank if some one help me out.

             And i request to TI that, please test the API "ZDP_MgmtLqiReq". It is working if it is send some period. But it is not working consistently and periodically

  • Hi Allen, LQI request will cause lots of rf traffic and it is not suggested to request LQI so frequently.
  • Hi Yikai,

               1. Then suggest me, what will be the minimum interval to request, so that my network won't affect.

               2. After not getting the response for Lqi request, i noticed that, if any End device is sending a MatchDec req. ZC is not responding to that. This may be rf Traffic or what. If i send LQI request frequently this will affect my network or Rf Packets?.

  • 1. I don't request LQI periodically in my application. I only provide a user interface allowing me to request LQI when I need the info.

    2. I don't know what is the reason that your ZC stop responding. The only way to know is to trace and debug your ZC.

  • Thanks Yikai Chen.