Closed chaabanemalki closed 3 years ago
When CONFIG_ESP32_WIFI_NVS_ENABLED or CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE, you need to initialise NVS (before esp_wifi_init):
Thanks for reporting, we will look into,
HI @chaabanemalki, dose @boarchuz's suggestion solve your problem? If not, dose this log only shown once or multiple times? It's normal to have this log once when you power on a esp32.
Hello, I have already the piece of code that @boarchuz suggested.
When I freshly compile the project I get the error. See logs below
--- idf_monitor on COM13 115200 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
I (6395) WIFI_AP: esp_event_loop_create_default(): 0
I (6402) WIFI_AP: tcpip_adapter_dhcps_stop(): 0
I (6406) WIFI_AP: tcpip_adapter_set_ip_info(): 0
I (6452) wifi:wifi firmware version: 04f00f3
I (6452) wifi:config NVS flash: enabled
I (6452) wifi:config nano formating: enabled
I (6453) wifi:Init data frame dynamic rx buffer num: 32
I (6457) wifi:Init management frame dynamic rx buffer num: 32
I (6463) wifi:Init management short buffer num: 32
I (6467) wifi:Init dynamic tx buffer num: 32
I (6472) wifi:Init static rx buffer size: 1600
I (6476) wifi:Init static rx buffer num: 10
I (6479) wifi:Init dynamic rx buffer num: 32
W (6484) event: handler already registered, overwriting
W (6497) phy_init: failed to load RF calibration data (0xffffffff), falling back to full calibration
I (6809) wifi:mode : softAP (b4:e6:2d:80:13:f6)
I (6813) wifi:Total power save buffer number: 16
I (6813) wifi:Init max length of beacon: 752/752
I (6814) wifi:Init max length of beacon: 752/752
I (6818) WIFI_AP: WiFi AP Started
I (6820) WIFI_AP: max uri handlers: 10
If I reset the esp32 I don't get this error. So I'm not what config is really used
@chaabanemalki That should not be an issue, it's normal to have it once when you power on esp32.
@YouDONG-ESP so the warning message is miss leading ! how can I make sure that the config I chose is the one being used ? What is the full calibration ? For example I want the power to be 20dB ( CONFIG_ESP32_PHY_MAX_TX_POWER=20) how can I check if I am using this maximum value ?
Hi, these apis could help you set and get power.
/**
* @brief Set maximum transmitting power after WiFi start.
*
* @attention 1. Maximum power before wifi startup is limited by PHY init data bin.
* @attention 2. The value set by this API will be mapped to the max_tx_power of the structure wifi_country_t variable.
* @attention 3. Mapping Table {Power, max_tx_power} = {{8, 2}, {20, 5}, {28, 7}, {34, 8}, {44, 11},
* {52, 13}, {56, 14}, {60, 15}, {66, 16}, {72, 18}, {78, 20}}.
* @attention 4. Param power unit is 0.25dBm, range is [8, 78] corresponding to 2dBm - 20dBm.
* @attention 5. Relationship between set value and actual value. As follows:
* +------------+--------------+
* | set value | actual value |
* +============+==============+
* | [8, 19] | 8 |
* +------------+--------------+
* | [20, 27] | 20 |
* +------------+--------------+
* | [28, 33] | 28 |
* +------------+--------------+
* | [34, 43] | 34 |
* +------------+--------------+
* | [44, 51] | 44 |
* +------------+--------------+
* | [52, 55] | 52 |
* +------------+--------------+
* | [56, 59] | 56 |
* +------------+--------------+
* | [60, 65] | 60 |
* +------------+--------------+
* | [66, 71] | 66 |
* +------------+--------------+
* | [72, 77] | 72 |
* +------------+--------------+
* | 78 | 78 |
* +------------+--------------+
* @param power Maximum WiFi transmitting power.
*
* @return
* - ESP_OK: succeed
* - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init
* - ESP_ERR_WIFI_NOT_START: WiFi is not started by esp_wifi_start
* - ESP_ERR_WIFI_ARG: invalid argument, e.g. parameter is out of range
*/
esp_err_t esp_wifi_set_max_tx_power(int8_t power);
/**
* @brief Get maximum transmiting power after WiFi start
*
* @param power Maximum WiFi transmitting power, unit is 0.25dBm.
*
* @return
* - ESP_OK: succeed
* - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init
* - ESP_ERR_WIFI_NOT_START: WiFi is not started by esp_wifi_start
* - ESP_ERR_WIFI_ARG: invalid argument
*/
esp_err_t esp_wifi_get_max_tx_power(int8_t *power);
The RF calibration method can be found here: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/RF_calibration.html?
@YouDONG-ESP Thank you for these information, very helpful indeed. Yet I still find the message miss leading, but this is another topic :) I'll close the issue.
@YouDONG-ESP : reading in details the documentation, the message makes sense. Thank you for your support, everything is clear now
Environment
Problem Description
We are facing WIFI performance issues as well as WIFI connection stability and behaviors. Our first step is to fix all warnings/ Errors regarding our WIFI code to setup WIFI.
We setup our WIFI to AP mode and stop dhcps to set a specific IP address then start WIFI. This works and I'm able to connect to my esp32 and do HTTP post/get commands, but I always get the following error:
error: failed to load RF calibration data (0xffffffff), falling back to full calibration at first when flashing the device.
This might be the reason for some bad WIFI performance in some devices
Code to reproduce this issue
In SDK I have the following config
Output
Can you please assist us on debugging this error ?