Getting the RSSI

mrunmoy
Posts: 2
Joined: Sat Nov 26, 2016 1:28 am

Getting the RSSI

Postby mrunmoy » Sat Nov 26, 2016 1:34 am

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 ?

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

Re: Getting the RSSI

Postby kolban » Sat Nov 26, 2016 3:22 am

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.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

mrunmoy
Posts: 2
Joined: Sat Nov 26, 2016 1:28 am

Re: Getting the RSSI

Postby mrunmoy » Sat Nov 26, 2016 11:59 pm

Hi Kolban,

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

Cheers!
Mrunmoy

jkvarela
Posts: 2
Joined: Mon Dec 14, 2015 7:15 pm

Re: Getting the RSSI

Postby jkvarela » 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);
}

snahmad75
Posts: 445
Joined: Wed Jan 24, 2018 6:32 pm

Re: Getting the RSSI

Postby snahmad75 » Wed Nov 28, 2018 7:01 pm

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.

Who is online

Users browsing this forum: No registered users and 75 guests