Chapter 4. Software framework
4.10.67 I'm using ESP-IDF release/v3.3 for ESP32 development, but only bluetooth
function is needed, how to disable Wi-Fi function through software?
• Please call esp_wifi_stop() to disable the Wi-Fi function. For API description, please see
esp_err_t
esp_wifi_stop(void).
• If you need to reclaim the resources occupied by Wi-Fi, call esp_wifi_deinit(). For API
description, please see
• Here is a simple example:
#include
"esp_wifi.h"
#include
"esp_bt.h"
void
app_main()
{
// Turn off Wi-Fi functionality
esp_wifi_stop();
// Initializing Bluetooth functionality
esp_bt_controller_config_t bt_cfg
esp_bt_controller_init(&bt_cfg);
esp_bt_controller_enable(ESP_BT_MODE_BTDM);
// ...
}
In this example, the esp_wifi_stop() function is called to turn off Wi-Fi and then to initialize Bluetooth.
It should be noted that once Wi-Fi is stopped, Wi-Fi related APIs cannot be used.
4.10.68 In ESP-IDF, the esp_wifi_80211_tx() interface can only be used to send
data packets, is there a corresponding function to receive packets?
• Please use callback function to received data packets as follows:
esp_wifi_set_promiscuous_rx_cb(wifi_sniffer_cb);
esp_wifi_set_promiscuous(true);
• The above data receive method is also used in another open-sourced project, please see esp-mdf.
4.10.69 What are the reasons for the high failure rate of esptouch networking?
CHIP: ESP32, ESP32S2, ESP32S3, ESP32C3, ESP8266
• The same hotspot is connected too many people.
• The signal quality of the hotspot connected by cell phone is poor.
• The router does not forward multicast data.
• The router has enabled dual-band integration, and the phone is connected to the 5G frequency
band.
4.10.70 How to optimize the IRAM when ESP32 uses Wi-Fi?
• You can disable WIFI_IRAM_OPT, WIFI_RX_IRAM_OPT and LWIP_IRAM_OPTIMIZATION in menu-
config to optimize IRAM space, but this will degrade Wi-Fi performance.
Espressif Systems
esp_err_t
esp_wifi_deinit(void).
=
BT_CONTROLLER_INIT_CONFIG_DEFAULT();
139
Submit Document Feedback
Release master
Need help?
Do you have a question about the ESP and is the answer not in the manual?