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.

CC3200-LAUNCHXL: is there any way to get the WIFI Signal Strength when the CC3200 is connected with the WIFI Router?

Part Number: CC3200-LAUNCHXL
Other Parts Discussed in Thread: CC3200

Hi, 

I want to display the real-time signal strength of the connected wifi on the screen. can we get the WIFI Signal strength when the CC3200 is connected to the router? I have checked the antenna selection example in CC3200 SDK and tried to get the RSSI  sl_WlanRxStatStart() sl_WlanRxStatStop() to get the RSSI when the device is connected but I am getting only zero value. 

please suggest any example code!

Thanks in advance!

  • Hi,

    How long do you wait after starting the stats collection with sl_WlanRxStatStart() before you check the statistics? If there is very little network traffic, then it may not be possible to generate an RSSI statistic.

    What code are you trying to use from the antenna_selection example? It doesn't seem like it uses the sl_WlanRxStat*() APIs. Please try the following code and see if you can get some expected RSSI values:

    SlWlanGetRxStatResponse_t RxStat;
    sl_WlanRxStatStart();
    //add in your platform's wait function here, wait for 15 seconds
    //ex
    //sleep(15);
    sl_WlanRxStatGet(&RxStat,0);
    drawRxHist(&RxStat);
    
    void drawRxHist(SlWlanGetRxStatResponse_t *rxStatResp)
    {
        float percent;
        uint32_t fraction;
        uint32_t integer;
        int32_t i,j;
    
        UART_PRINT(
            "\r\n*********************************Rx Statistics"
    		"**********************************\r\n");
        UART_PRINT("Received Packets: %d \r\n",
                   rxStatResp->ReceivedValidPacketsNumber);
        UART_PRINT(
            "Average RSSI for management: %d Average"
    		" RSSI for other packets: %d\r\n\r\n",
            rxStatResp->AvarageMgMntRssi,rxStatResp->AvarageDataCtrlRssi);
    
        if(rxStatResp->ReceivedValidPacketsNumber == 0)
        {
            UART_PRINT(
                "    -----------------------   no data collected"
    			"   -----------------------\r\n");
        }
        else
        {
            UART_PRINT(
                "    -----------------------   RSSI Histogram"
    			"   -----------------------\r\n\r\n");
            UART_PRINT(
                "-40dBm to -87dBm (below and above RSSI will"
    			" appear in the first and last cells]\r\n\r\n");
    
            UART_PRINT(
                "           10   20   30   40   50   60   70   80   90   100\r\n");
            UART_PRINT(
                "         |----+----+----+----+----+----+----+----+----+----|\r\n");
    
            //RSSI histogram from -40 until -87 
    		//(all below and above RSSI will appear in the first and last cells
            for(i = 0; i < SL_WLAN_SIZE_OF_RSSI_HISTOGRAM; i++)
            {
                percent =
                    ((float)rxStatResp->RssiHistogram[i] /
                     (float)rxStatResp->ReceivedValidPacketsNumber * (float)100);
                if(0 == i)
                {
                    UART_PRINT(">-40dBm  ");
                }
                else
                {
                    if((SL_WLAN_SIZE_OF_RSSI_HISTOGRAM - 1) == i)
                    {
                        UART_PRINT("<-87dBm");
                    }
                    else
                    {
                        UART_PRINT("  -%-2ddBm",40 +
                                   (i * 47 / (SL_WLAN_SIZE_OF_RSSI_HISTOGRAM - 1)));
                    }
                }
                for(j = 0; j < (int)percent / 2; j++)
                {
                    UART_PRINT("*");
                }
                for(j = 0; j < 50 - (int)percent / 2; j++)
                {
                    UART_PRINT(" ");
                }
                integer = (int)percent;
                fraction = (int)((percent - integer)*100);
                UART_PRINT("(%d.%d%%)\r\n",integer,fraction);
                UART_PRINT(
                    "         |----+----+----+----+----+----+----+----+----+----|"
    				"\r\n");
            }
    
            UART_PRINT(
                "              10   20   30   40   50 "
    			"  60   70   80   90   100\r\n\r\n");
    
            /* Print Rate Histogram */
    
            UART_PRINT(
                "    -----------------------   Rate Histogram"
    			"   -----------------------\r\n\r\n");
            UART_PRINT(
                "           10   20   30   40   50   60   70   80   90   100\r\n");
            UART_PRINT(
                "         |----+----+----+----+----+----+----+----+----+----|\r\n");
    
            for(i = 0; i < SL_WLAN_NUM_OF_RATE_INDEXES; i++)
            {
                percent =
                    ((float)rxStatResp->RateHistogram[i] /
                     (float)rxStatResp->ReceivedValidPacketsNumber * (float)100);
                UART_PRINT("%-2d         ",i);
                for(j = 0; j < (int)percent / 2; j++)
                {
                    UART_PRINT("*");
                }
                for(j = 0; j < 50 - (int)percent / 2; j++)
                {
                    UART_PRINT(" ");
                }
                integer = (int)percent;
                fraction = (int)((percent - integer)*100);
                UART_PRINT("(%d.%d%%)\r\n",integer,fraction);
                UART_PRINT(
                    "         |----+----+----+----+----+----+----+----+----+----|"
    				"\r\n");
            }
    
            UART_PRINT(
                "              10   20   30   40   50   60   70   80   90   100\r\n");
        }
    
        UART_PRINT(
            "\r\n                     The data was sampled during %umSec\r\n",
            (((unsigned int)rxStatResp->GetTimeStamp -
              rxStatResp->StartTimeStamp)) / 1000);
    
        UART_PRINT(
            "*******************************End Rx Statistics"
    		"********************************");
    }
    
    

    Regards,

    Michael