Skip to main content

Module wifi

Module wifi 

Source
Expand description

WiFi sub-function of the shared radio.

Layered, fully-async surface built on esp-radio:

  • wifi feature — Wifi: owns the WifiController and exposes on-demand scanning (Wifi::scan). No IP stack, no embassy-net.

  • wifi-sta feature — Wifi::into_sta: consumes the handle and returns a DHCP/static embassy_net::Stack, a WifiControl command handle, and a WifiRunner you spawn via wifi_task. The runner owns the single controller and manages association (auto-connect + reconnect), so scanning while associated is routed through WifiControl::scan — there is never more than one owner of the controller.

  • wifi-ap feature — [Wifi::into_ap]: brings the radio up as a soft-AP and returns an [ApRadio] that reports stations joining and leaving. It stops at the WiFi link on purpose — handing out addresses needs a DHCP server, which embassy-net does not provide.

§Mode roadmap

Station and access point are wired. ESP-NOW / sniffer / CSI are separate esp-radio features that layer on the same way. AP+STA at once (Config::AccessPointStation) is the one combination still missing, and it needs the wifi_task actor to own both halves rather than just the station.

§Variant differences (Fire27 / ESP32 vs CoreS3 / ESP32-S3)

The esp-radio WiFi API is identical on both chips; the differences are RAM:

  • The RX/TX buffer counts in [controller_config] are trimmed on Fire27 (ESP32) where internal SRAM is tighter, and left at the esp-radio defaults on CoreS3 (ESP32-S3).
  • Fire27 cannot DMA out of PSRAM — the application must keep the embassy_net::StackResources and socket buffers in internal RAM. CoreS3 has headroom and may place large app buffers in PSRAM (see crate::mem).
  • With BLE coexistence (coex), budget the extra controller heap (~96 KB reclaimed on ESP32, less on S3).

Structs§

AccessPointInfo
Information about a detected Wi-Fi access point.
ConnectedInfo
Information about a station connected to the access point.
DisconnectedInfo
Information about a station disconnected from the access point.
Password
A password.
StaCredentials
Station credentials for Wifi::into_sta.
Wifi
Low-level WiFi handle: owns the controller.
WifiControl
Cloneable-free command handle for the running station.
WifiRunner
The owned controller + network runner. Hand to wifi_task.

Enums§

AuthenticationMethod
Supported Wi-Fi authentication methods.
AuthenticationMethodConfig
Authentication Configuration for a Wi-Fi network.
EventInfo
Either the ConnectedInfo or DisconnectedInfo.
IpSetup
How the station obtains its IPv4 configuration.
WifiError
Errors from the WiFi sub-system.

Functions§

wifi_task
Drive the network stack and manage station association.

Type Aliases§

ScanList
Scan results, capped at 16 access points.