Page 1 of 1

Getting the RSSI

Posted: Sat Nov 26, 2016 1:34 am
by mrunmoy
Hi,

I am trying to find a api that returns the RSSI. I found the following function:

Code: Select all

/**
  * @brief     Set vendor specific element callback
  *
  * @param     cb   callback function
  * @param     ctx  reserved
  *
  * @return
  *    - ESP_OK: succeed
  *    - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by eps_wifi_init
  */
esp_err_t esp_wifi_set_vendor_ie_cb(esp_vendor_ie_cb_t cb, void *ctx);
but I am not sure how to use this function. Can anyone please give an example usage of this function to get the rssi ?

Re: Getting the RSSI

Posted: Sat Nov 26, 2016 3:22 am
by kolban
If you perform a WiFi scan then you can retrieve the details of all the found access points with a call to esp_wifi_scan_get_ap_records(). Included in a record is an 8 bit signed (received signal strength indicator) rssi field.

Re: Getting the RSSI

Posted: Sat Nov 26, 2016 11:59 pm
by mrunmoy
Hi Kolban,

Thanks for your response. I tried what you suggested, and it worked like a charm!

Cheers!
Mrunmoy

Re: Getting the RSSI

Posted: Sun Jan 01, 2017 10:52 pm
by jkvarela
You can get rssi that manner:

wifi_ap_record_t wifidata;
if (esp_wifi_sta_get_ap_info(&wifidata)==0){
printf("rssi:%d\r\n", wifidata.rssi);
}

Re: Getting the RSSI

Posted: Wed Nov 28, 2018 7:01 pm
by snahmad75
jkvarela wrote:
Sun Jan 01, 2017 10:52 pm
You can get rssi that manner:

wifi_ap_record_t wifidata;
if (esp_wifi_sta_get_ap_info(&wifidata)==0){
printf("rssi:%d\r\n", wifidata.rssi);
}
esp_wifi_sta_get_ap_info give me ESP_ERR_WIFI_NOT_CONNECT. If am running with in WIFI_MODE_APSTA mode.
and I am not join to any AP.

Is this rssi for its own AP or rssi of AP it joined.