Skip to main content

Module wifi

Module wifi 

Source
Available on crate feature 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.

Modules§

ap
Wi-Fi access point.
csicsi and unstable
Wi-Fi Channel State Information (CSI).
eventunstable
Wi-Fi Events
scan
Wi-Fi scanning.
sniffersniffer and unstable
Wi-Fi sniffer.
sta
Wi-Fi station.

Structs§

Bandwidths
Supported Wi-Fi protocols for each band.
ControllerConfig
Wi-Fi configuration.
CountryInfounstable
Country information.
Interface
Wi-Fi interface.
Protocols
Supported Wi-Fi protocols for each band.
RxControlInfounstable
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.
WifiController
Wi-Fi controller.

Enums§

AuthenticationMethod
Supported Wi-Fi authentication methods.
BandMode
Wi-Fi band mode.
Bandwidth
Wi-Fi bandwidth options.
Config
Configuration of Wi-Fi operation mode.
DisconnectReason
Reason for disconnection.
OperatingClassunstable
Wi-Fi operating class.
PowerSaveModeunstable
Power saving mode settings for the modem.
Protocol
Supported Wi-Fi protocols.
SecondaryChannel
Secondary Wi-Fi channels.
WifiError
Common errors.