Nothing on this page will run on a bare S3. The page below is unchanged — read it if you are planning ahead or using a different board.
Wi-Fi 6 features
Wi-Fi 6 on the C6 is not about speed - the radio is still 20 MHz and one stream. It is about one feature, Target Wake Time, which lets a battery device stay reachable while its radio is switched off.
The trade TWT makes
Deep sleep is cheaper and drops the connection — a phone cannot reach the device until it wakes on its own. TWT keeps the connection alive with the radio parked, so the device is addressable now, for about a milliamp.
What Wi-Fi 6 does not give you
- Not more speed. The C6 is 20 MHz, one spatial stream, about 20 Mbit/s in practice — the same as the older chips.
- Not more range. Same power, same antenna.
- Not 6 GHz. That is Wi-Fi 6E, and no ESP32 has it.
When to care
Care if the device is on a battery and must respond immediately — a lock, a valve, a switch. If it can afford to be unreachable between wake-ups, deep sleep is cheaper and works on every chip. If it is on mains power, none of this matters at all.
The code
TWT is negotiated with the router, so the code is a request rather than a setting. If the router does not offer it, the connection is fine and simply behaves like Wi-Fi 4.
#include <WiFi.h>
#include "esp_wifi.h"
void setup() {
Serial.begin(115200);
WiFi.begin("your-network", "your-password");
while (WiFi.status() != WL_CONNECTED) delay(250);
// Ask to be woken every 10 seconds for 20 ms
wifi_phy_mode_t mode;
esp_wifi_sta_get_negotiated_phymode(&mode);
Serial.printf("phy mode %d (4 = 802.11ax)\n", mode);
// Modem sleep is the fallback and it is on by default
esp_wifi_set_ps(WIFI_PS_MAX_MODEM);
}
void loop() {
Serial.printf("rssi %d\n", WiFi.RSSI());
delay(10000);
}Check what you actually got. A board that thinks it has TWT and has not will report the same connection state and a very different current draw.
MicroPython exposes the power-save mode rather than TWT itself. WIFI_PS_MAX_MODEM is the setting that matters on a battery, and it is the one WiFi.setSleep(false) turns off.
import network
wlan = network.WLAN(network.STA_IF)
wlan.active(True)
wlan.config(pm=network.WLAN.PM_POWERSAVE) # sleep between beacons
wlan.connect('your-network', 'your-password')
while not wlan.isconnected():
pass
print(wlan.ifconfig())Power saving costs latency. A board in max modem sleep can take a few hundred milliseconds to answer a ping. That is a feature on a sensor and a bug on a light switch.
When it does not work
The router did not agree to TWT, or it is not a Wi-Fi 6 router. Check the negotiated PHY mode. Falling back is silent by design.
That is power saving working. Modem sleep means the radio is off between beacons, so replies wait. WiFi.setSleep(false) removes the delay and costs about 20 mA.
Look at how long the board is awake, not at the idle current. If the radio is on for four seconds every minute, idle current is not the bill.
Correct. Wi-Fi 6 is the C6 among the chips here. The others are 802.11n, which still has modem sleep but no TWT.
The board is on the network. Next it needs a name people can type and a clock that is not set to 1970.
mDNS and NTP →Edit this page — content/esp32/wifi-6-features.mdx
Discuss this article
Ask about this page. The answer stays here, on the page it belongs to, for whoever hits the same wall next.