wifi only.Expand description
§Wi-Fi (Station, Access Point and Station/AP-coexistence)
§Introduction
The Wi-Fi module provides support for configuring and monitoring the Wi-Fi networking functionality. This includes configuration for:
- Station mode (aka STA mode or Wi-Fi client mode). ESP32-S2 connects to an access point.
- AP mode (aka Soft-AP mode or Access Point mode). Stations connect to the ESP32-S2.
- Station/AP-coexistence mode (ESP32-S2 is concurrently an access point and a station connected to another access point).
- Various security modes for the above (WPA, WPA2, … Please note that WPA3 is currently not supported)
- Scanning for access points (active & passive scanning).
- Promiscuous mode for monitoring of IEEE802.11 Wi-Fi packets.
§Expected heap memory usage
These are numbers measured via esp-alloc’s “internal-heap-stats” feature.
You can easily reproduce these measurements with your own application by checking the
max_usage.
Please note that for these measurements the default ControllerConfig values are used. Changing these (especially queue sizes) will change the results. Also the amount of used memory varies between different targets.
- Station: 47 - 57k
- Open Access Point: 53 - 63k
§Wi-Fi performance considerations
The default configuration is quite conservative to reduce power and memory consumption.
There are a number of settings which influence the general performance (at the cost of memory usage).
Optimal settings are chip and applications specific. You can get inspiration from the ESP-IDF examples
Please note that the configuration keys are usually named slightly different and not all configuration keys apply.
By default the power-saving mode is PowerSaveMode::None
and ESP_PHY_CONFIG_PHY_ENABLE_USB is enabled by default.
In addition pay attention to these configuration keys:
ESP_RADIO_CONFIG_RX_QUEUE_SIZEESP_RADIO_CONFIG_TX_QUEUE_SIZEESP_RADIO_CONFIG_MAX_BURST_SIZE
Modules§
- ap
- Wi-Fi access point.
- csi
csiandunstable - Wi-Fi Channel State Information (CSI).
- event
unstable - Wi-Fi Events
- scan
- Wi-Fi scanning.
- sniffer
snifferandunstable - Wi-Fi sniffer.
- sta
- Wi-Fi station.
Structs§
- Access
Point Station Connected Info - Information about a station connected to the access point.
- Access
Point Station Disconnected Info - Information about a station disconnected from the access point.
- Bandwidths
- Supported Wi-Fi protocols for each band.
- Connected
Station Info - Information about a connected station.
- Controller
Config - Wi-Fi configuration.
- Country
Info unstable - Country information.
- Disconnected
Station Info - Information about a disconnected station.
- Interface
- Wi-Fi interface.
- Interfaces
- Represents the Wi-Fi controller and its associated interfaces.
- Protocols
- Supported Wi-Fi protocols for each band.
- RxControl
Info unstable - The radio metadata header of the received packet, which is the common header at the beginning of all RX callback buffers in promiscuous mode.
- Ssid
- Information about a connected station.
- Wifi
Controller - Wi-Fi controller.
Enums§
- Access
Point Station Event Info - Either the AccessPointStationConnectedInfo or AccessPointStationDisconnectedInfo.
- Authentication
Method - Supported Wi-Fi authentication methods.
- Band
Mode - Wi-Fi band mode.
- Bandwidth
- Wi-Fi bandwidth options.
- Config
- Configuration of Wi-Fi operation mode.
- Disconnect
Reason - Reason for disconnection.
- Operating
Class unstable - Wi-Fi operating class.
- Power
Save Mode unstable - Power saving mode settings for the modem.
- Protocol
- Supported Wi-Fi protocols.
- Secondary
Channel - Secondary Wi-Fi channels.
- Wifi
Error - Common errors.
Functions§
- new
- Create a Wi-Fi controller and it’s associated interfaces. The default initial configuration is [Config::Station(StationConfig::default())].