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.

Link Quality/RSSI measure

Hi,

I deployed a network, this formed by about 20 ZR and a ZC. I use Many-to-one routing and the network work fine.

However I have a problem about the LQI and RSSI value. I need to know that , so I use this code to see the values:

afIncomingMSGPacket_t *MSGpkt;
  
  (void)task_id;  // Intentionally unreferenced parameter
 // uint8 lqi;
  if ( events & SYS_EVENT_MSG )
  {
    while ( (MSGpkt = (afIncomingMSGPacket_t *)osal_msg_receive( zclSampleLight_TaskID )) )
    {
      switch ( MSGpkt->hdr.event )
      {
        case ZCL_INCOMING_MSG:
                 // lqii=0;
                lqii= MSGpkt->rssi;
                HalLcdWriteValue(lqii,10,HAL_LCD_LINE_2);
          // Incoming ZCL Foundation command/response messages
          zclSampleLight_ProcessIncomingMsg( (zclIncomingMsg_t *)MSGpkt );
As you can see I just added and uint value (lqii) to get the value. the problem is that: this values have no sense, every packet I received from the different routers, which are in different place, I received the same value.
But in the packet sniffer the link cost in link status packet is different.
Some one had the same problem?
Thanks!
Danilo

 

  • Ha Danilo,

     

    Description of your problem was truncated from the post... So, can you please repeat what is exactly the problem?

    From a brief viewing of your code:

    "rssi" field in the afIncomingMSGPacket_t structure defined as int8, so you probably should convert it to an unsigned

    value before passing this value to HalLcdWriteValue().

     

    Br,

    Igor

  • Hi Igor,

    the problem is that: if I print on LCD LinkQuality field of afIncomingMSGPacket_t, I obtain ever  same value even if  the packet arrive from different ZR. The same is if I use the other fields, rssi or correlation.

    I tried also to print on UART this field and the result are the same.

    I hope now is more clear, sorry but my english is not so good.

    Br, 

    Danilo


  • Hi Danilo,

     

    Can you observe the value of lqii by setting breakpoints?

    Can you the following:

    1. Set two breakpoints on these two lines
      lqii= MSGpkt->rssi;
      HalLcdWriteValue(lqii,10,HAL_LCD_LINE_2);
    2. Add lqii variable to watch window.
    3. When debugger stops at the first breakpoint the value of lqii you should be
      seeing in the watch window is 0. Proceed with debug running (F5)
    4. When debugger stops at the second breakpoint remember the value of lqii
      (as it'll be changed). Proceed with debug running.
    5. Is the value of lqii displayed on LCD equals to the value you've remembered
      (in section 4)?

    Br,

    Igor

  • Igor Sherer said:

    Hi Danilo,

     

    Can you observe the value of lqii by setting breakpoints?

    Can you the following:

    1. Set two breakpoints on these two lines
      lqii= MSGpkt->rssi;
      HalLcdWriteValue(lqii,10,HAL_LCD_LINE_2);
    2. Add lqii variable to watch window.
    3. When debugger stops at the first breakpoint the value of lqii you should be
      seeing in the watch window is 0. Proceed with debug running (F5)
    4. When debugger stops at the second breakpoint remember the value of lqii
      (as it'll be changed). Proceed with debug running.
    5. Is the value of lqii displayed on LCD equals to the value you've remembered
      (in section 4)?

    Br,

    Igor

    Hi Igor,

    I tried what you suggest me. I also tried to use the HAL_CRITICAL_SESSION  for disable the interrupts when I send on LCD the value. I also tried to force to zero-value the lqii variable before set "lqii= MSGpkt->rssi;" . From the debug the software work fine and the variable is well set. So, I think,  the problem is on the MSGpkt but I have not idea to solve that.


  • Igor Sherer said:

    Hi Danilo,

     

    Can you observe the value of lqii by setting breakpoints?

    Can you the following:

    1. Set two breakpoints on these two lines
      lqii= MSGpkt->rssi;
      HalLcdWriteValue(lqii,10,HAL_LCD_LINE_2);
    2. Add lqii variable to watch window.
    3. When debugger stops at the first breakpoint the value of lqii you should be
      seeing in the watch window is 0. Proceed with debug running (F5)
    4. When debugger stops at the second breakpoint remember the value of lqii
      (as it'll be changed). Proceed with debug running.
    5. Is the value of lqii displayed on LCD equals to the value you've remembered
      (in section 4)?

    Br,

    Igor

    Hi Igor,

    I tried what you suggest me. I also tried to use the HAL_CRITICAL_SESSION  for disable the interrupts when I send on LCD the value. I also tried to force to zero-value the lqii variable before set "lqii= MSGpkt->rssi;" . From the debug the software work fine and the variable is well set. So, I think,  the problem is on the MSGpkt but I have not idea to solve that.


  • Igor Sherer said:

    Hi Danilo,

     

    Can you observe the value of lqii by setting breakpoints?

    Can you the following:

    1. Set two breakpoints on these two lines
      lqii= MSGpkt->rssi;
      HalLcdWriteValue(lqii,10,HAL_LCD_LINE_2);
    2. Add lqii variable to watch window.
    3. When debugger stops at the first breakpoint the value of lqii you should be
      seeing in the watch window is 0. Proceed with debug running (F5)
    4. When debugger stops at the second breakpoint remember the value of lqii
      (as it'll be changed). Proceed with debug running.
    5. Is the value of lqii displayed on LCD equals to the value you've remembered
      (in section 4)?

    Br,

    Igor

    Hi Igor,

    I tried what you suggest me. I also tried to use the HAL_CRITICAL_SESSION  for disable the interrupts when I send on LCD the value. I also tried to force to zero-value the lqii variable before set "lqii= MSGpkt->rssi;" . From the debug the software work fine and the variable is well set. So, I think,  the problem is on the MSGpkt but I have not idea to solve that.


  • Hi Danilo,

     

    You see, the RSSI value calculated by the receiving device and the RSSI value seen in the packet sniffer

    have to be different, as these are two different devices located at two different spots.

    However, by placing the packet sniffer close to receiving device probably will show you a close value

    in the packet sniffer and in the receiving device, is this the case in your experiment.

    You were saying that for several received packets, in a row, the RSSI value isn't changing at all?

     

    Br,

    Igor