EasyManuals Logo

Espressif ESP32-S2 User Manual

Espressif ESP32-S2
1695 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #1554 background imageLoading...
Page #1554 background image
Chapter 4. API Guides
4.33.22 Wi-Fi Sniffer Mode
The Wi-Fi sniffer mode can be enabled by esp_wifi_set_promiscuous(). If the snier mode is enabled, the following
packets can be dumped to the application:
802.11 Management frame.
802.11 Data frame, including MPDU, AMPDU, AMSDU, etc.
802.11 MIMO frame, for MIMO frame, the sniffer only dumps the length of the frame.
802.11 Control frame.
The following packets will NOT be dumped to the application:
802.11 error frame, such as the frame with a CRC error, etc.
For frames that the sniffer can dump, the application can additionally decide which specific type of
packets can be filtered to the application by using esp_wifi_set_promiscuous_filter() and
esp_wifi_set_promiscuous_ctrl_filter(). By default, it will filter all 802.11 data and management
frames to the application.
The Wi-Fi sniffer mode can be enabled in the Wi-Fi mode of WIFI_MODE_NULL, or WIFI_MODE_STA, or
WIFI_MODE_AP, or WIFI_MODE_APSTA. In other words, the sniffer mode is active when the station is connected
to the AP, or when the AP has a Wi-Fi connection. Please note that the snier has a great impact on the throughput
of the station or AP Wi-Fi connection. Generally, we should NOT enable the sniffer, when the station/AP Wi-Fi
connection experiences heavy traffic unless we have special reasons.
Another noteworthy issue about the sniffer is the callback wifi_promiscuous_cb_t. The callback will be called directly
in the Wi-Fi driver task, so if the application has a lot of work to do for each filtered packet, the recommendation is
to post an event to the application task in the callback and defer the real work to the application task.
4.33.23 Wi-Fi Multiple Antennas
The Wi-Fi multiple antennas selecting can be depicted as following picture:
__________
|Enabled |
___|Antenna 0 |\\ ________
,_
|__________| \\ GPIO[0] <----> antenna_select[0] ---|
, | --- antenna 0
RX/TX ___ \\____\ GPIO[1] <----> antenna_select[1] ---|
,Antenna | --- antenna 1
\ __________ // / GPIO[2] <----> antenna_select[2] ---| Switch
, | ... ...
\ ___|Enabled | // GPIO[3] <----> antenna_select[3] ---|________
,_| --- antenna 15
\ |Antenna 1 |//
|__________|
ESP32-S2 supports up to sixteen antennas through external antenna switch. The antenna switch can be controlled by
up to four address pins - antenna_select[0:3]. Different input value of antenna_select[0:3] means selecting different
antenna. E.g. the value 0b1011means the antenna 11 is selected. The default value of antenna_select[3:0] is
0b0000, it means the antenna 0 is selected by default.
Up to four GPIOs are connected to the four active high antenna_select pins. ESP32-S2 can select the antenna by
control the GPIO[0:3]. The API esp_wifi_set_ant_gpio() is used to configure which GPIOs are connected
to antenna_selects. If GPIO[x] is connected to antenna_select[x], then gpio_config->gpio_cfg[x].gpio_select should
be set to 1 and gpio_config->gpio_cfg[x].gpio_num should be provided.
Although up to sixteen anteenas are supported, only one or two antennas can be simultaneously enabled for RX/TX.
The API esp_wifi_set_ant() is used to configure which antennas are enabled.
The enabled antennas selecting algorithm is also configured by esp_wifi_set_ant(). The RX/TX antenna
mode can be WIFI_ANT_MODE_ANT0, WIFI_ANT_MODE_ANT1 or WIFI_ANT_MODE_AUTO. If the an-
Espressif Systems 1543
Submit Document Feedback
Release v4.4

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Espressif ESP32-S2 and is the answer not in the manual?

Espressif ESP32-S2 Specifications

General IconGeneral
BrandEspressif
ModelESP32-S2
CategorySingle board computers
LanguageEnglish