Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need clarification on esp_wifi_sta_get_rssi() (IDFGH-11564) #12685

Closed
3 tasks done
kriegste opened this issue Nov 28, 2023 · 1 comment
Closed
3 tasks done

Need clarification on esp_wifi_sta_get_rssi() (IDFGH-11564) #12685

kriegste opened this issue Nov 28, 2023 · 1 comment
Assignees
Labels
Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally

Comments

@kriegste
Copy link

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

General issue report

https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/network/esp_wifi.html#_CPPv421esp_wifi_sta_get_rssiPi
says

Get the rssi info after station connected to AP.

Which device is "station" and which is "AP" here? My ESP32 opens an AP and my smartphone connects to it. I need to get the rssi of this connection. Is this the right function call? Because it does not work. What is the correct function?

@espressif-bot espressif-bot added the Status: Opened Issue is new label Nov 28, 2023
@github-actions github-actions bot changed the title Need clarification on esp_wifi_sta_get_rssi() Need clarification on esp_wifi_sta_get_rssi() (IDFGH-11564) Nov 28, 2023
@filzek
Copy link

filzek commented Nov 29, 2023

When the ESP32 is connected to a WiFi Network its wireless interface is set to STA, so the function call simple grab the last RSSI frame info and store it, you can use this function to simple return the RSSI information of the ESP32 signal reception to the Router.

There is nothing more than it.

If you want to GET ALL info, you shall use:


if (esp_wifi_sta_get_ap_info(&ap_wifidata)==0){
          printf("\n\nROUTER MAC=bssid[%02x:%02x:%02x:%02x:%02x:%02x]\r\n", ap_wifidata.bssid[0], ap_wifidata.bssid[1], ap_wifidata.bssid[2], ap_wifidata.bssid[3], ap_wifidata.bssid[4], ap_wifidata.bssid[5]);
          printf("rssi=%d\r\n", ap_wifidata.rssi);
          printf("channel=%d\r\n", ap_wifidata.primary);
          printf("antenna=%d\r\n", ap_wifidata.ant);
          printf("phy_11b:1=%d\r\n", ap_wifidata.phy_11b);
          printf("phy_11g:1=%d\r\n", ap_wifidata.phy_11g);
          printf("phy_11n:1=%d\r\n", ap_wifidata.phy_11n);
          printf("phy_lr:1=%d\r\n", ap_wifidata.phy_lr);
          printf("wps:1=%d\r\n", ap_wifidata.wps);
          printf("country code=[%s] channel_start=[%d] total_channels=[%d] max_power=[%d] policy=[%d]\r\n", ap_wifidata.country.cc,ap_wifidata.country.schan, ap_wifidata.country.nchan,ap_wifidata.country.max_tx_power, ap_wifidata.country.policy);
 }

So simple, it is the same as ap_wifidata.rssi

gotcha?

@espressif-bot espressif-bot added Status: Done Issue is done internally Resolution: NA Issue resolution is unavailable and removed Status: Opened Issue is new labels Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally
Projects
None yet
Development

No branches or pull requests

4 participants