EasyManua.ls Logo

Espressif Systems ESP - Page 156

Default Icon
191 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Chapter 4. Software framework
4.10.67 Im 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_wi󰝘_stop(void).
If you need to reclaim the resources occupied by Wi-Fi, call esp_wifi_deinit(). For API
description, please see esp_err_t esp_wi󰝘_deinit(void).
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 = BT_CONTROLLER_INIT_CONFIG_DEFAULT();
esp_bt_controller_init(&bt_cfg);
esp_bt_controller_enable(ESP_BT_MODE_BTDM);
// ...
}
In this example, the esp_wi󰝘_stop() function is called to turn o󰝗 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-
con󰝘g to optimize IRAM space, but this will degrade Wi-Fi performance.
Espressif Systems 139
Submit Document Feedback
Release master

Table of Contents